:root { --bg:#EBEEF2; --grid:#C6CDD6; --surface:#FFFFFF; --surface-2:#F2F4F7; --fg:#141A21; --muted:#5C6571; --line:#DBE0E6; --accent:#E4532D; --accent-fg:#FFFFFF; --accent-soft:#FCE9E3; --danger:#C7372F;
  --ok:#1F9D6B; --ok-soft:#DDF3EA; --warn:#B07A08; --warn-soft:#FBF0D3; --chg:#C2410C; --chg-soft:#FDE6DA; --draft-soft:#E7EAEE;
  --f-display:"Bricolage Grotesque","Avenir Next",system-ui,sans-serif; --f-body:"Figtree",system-ui,-apple-system,"Segoe UI",sans-serif; --r:16px; color-scheme: light; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg:#0C0F14; --grid:#212833; --surface:#151A21; --surface-2:#1C222B; --fg:#E6EAF0; --muted:#96A0AC; --line:#29303A; --accent:#FF7350; --accent-fg:#1B0A04; --accent-soft:#2D1912; --danger:#FF6A60; --ok:#3DD598; --ok-soft:#10261D; --warn:#E8B64A; --warn-soft:#2A2210; --chg:#FF9A6B; --chg-soft:#2D1A12; --draft-soft:#212832; color-scheme: dark; } }
:root[data-theme="dark"] { --bg:#0C0F14; --grid:#212833; --surface:#151A21; --surface-2:#1C222B; --fg:#E6EAF0; --muted:#96A0AC; --line:#29303A; --accent:#FF7350; --accent-fg:#1B0A04; --accent-soft:#2D1912; --danger:#FF6A60; --ok:#3DD598; --ok-soft:#10261D; --warn:#E8B64A; --warn-soft:#2A2210; --chg:#FF9A6B; --chg-soft:#2D1A12; --draft-soft:#212832; color-scheme: dark; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); background-image: radial-gradient(var(--grid) 1px, transparent 1.6px); background-size: 24px 24px; background-attachment: fixed; color: var(--fg); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; overflow-wrap: anywhere; }
h1,h2,h3 { font-family: var(--f-display); letter-spacing: -.02em; margin: 0; line-height: 1.15; }
h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 750; } h2 { font-size: 20px; font-weight: 700; } h3 { font-size: 16px; font-weight: 650; }
a { color: inherit; } button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .grow { flex: 1; min-width: 0; } .hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .col { display: flex; flex-direction: column; gap: 12px; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* marque */
.brand { display: inline-flex; align-items: center; gap: 9px; font: 750 22px var(--f-display); letter-spacing: -.03em; text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }

/* boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; text-decoration: none; touch-action: manipulation; white-space: nowrap; transition: transform .08s, filter .15s, background .15s; }
.btn:hover { background: var(--surface-2); } .btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); } .btn.primary:hover { filter: brightness(1.07); background: var(--accent); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; } .btn.ok:hover { filter: brightness(1.07); background: var(--ok); }
.btn.warn { background: var(--chg-soft); border-color: transparent; color: var(--chg); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); } .btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; } .btn.icon { padding: 0; width: 44px; } .btn.sm.icon { width: 36px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* cartes, champs */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.field { display: flex; flex-direction: column; gap: 6px; } .field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, textarea.input, select.input { width: 100%; min-height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); padding: 10px 14px; font-size: 16px; }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.45; } .input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.err { color: var(--danger); font-weight: 600; font-size: 14px; margin: 0; }
.switch { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; } .switch input { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 2px; }

/* statuts */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.pending { background: var(--warn-soft); color: var(--warn); } .pill.changes { background: var(--chg-soft); color: var(--chg); }
.pill.approved { background: var(--ok-soft); color: var(--ok); } .pill.draft { background: var(--draft-soft); color: var(--muted); }

/* mise en page équipe */
.shell { max-width: 1180px; margin: 0 auto; padding: 0 16px 120px; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin: 0 -16px 18px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .brand { margin-right: auto; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-fg); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.hero { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.kpi { padding: 16px 18px; } .kpi b { display: block; font: 750 32px/1.1 var(--f-display); letter-spacing: -.03em; } .kpi span { color: var(--muted); font-size: 13px; font-weight: 500; }
.two { display: grid; grid-template-columns: 1fr 360px; gap: 22px; align-items: start; }
.spaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.space { display: flex; flex-direction: column; gap: 14px; text-decoration: none; position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.space:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -18px rgba(0,0,0,.4); }
.space::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--c); }
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); gap: 2px; } .bar i { display: block; height: 100%; } .bar .a { background: var(--ok); } .bar .c { background: var(--chg); } .bar .p { background: var(--warn); opacity: .55; }
.feed { display: flex; flex-direction: column; } .ev { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; } .ev:first-child { border-top: 0; }
.dot { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; font-size: 15px; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); } .empty b { display: block; color: var(--fg); font: 700 18px var(--f-display); margin-bottom: 6px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; } .tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 99px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; } .tabs button.on { background: var(--fg); color: var(--bg); }

/* grille d'éléments */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(0,0,0,.4); }
.thumb { aspect-ratio: 4/3; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; position: relative; color: var(--muted); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; } .thumb .ic { font-size: 38px; }
.thumb .txt { padding: 14px; font-size: 13px; line-height: 1.4; color: var(--fg); align-self: start; max-height: 100%; overflow: hidden; }
.kindtag { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.62); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; backdrop-filter: blur(4px); }
.tile .meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; } .tile .meta b { font-weight: 650; line-height: 1.25; }
.cnt { position: absolute; right: 8px; top: 8px; background: var(--accent); color: var(--accent-fg); font-size: 12.5px; font-weight: 700; min-width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; padding: 0 7px; }

/* feuille / modale */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(8,10,14,.55); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { width: min(560px, 100%); max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); animation: up .22s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 24px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } } @keyframes fade { from { opacity: 0; } }
.drop { border: 2px dashed var(--line); border-radius: 16px; padding: 26px 16px; text-align: center; color: var(--muted); cursor: pointer; background: var(--surface-2); } .drop.over, .drop:hover { border-color: var(--accent); color: var(--fg); }
.up { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; } .up progress { width: 80px; accent-color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.3); animation: up .2s; max-width: 90vw; }

/* auth */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth { width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; padding: 30px 26px; border-radius: 24px; box-shadow: 0 24px 60px -24px rgba(0,0,0,.35); }

/* visionneuse */
.viewer { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; align-items: start; }
.stagewrap { position: sticky; top: 74px; }
.stage { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.media { position: relative; display: block; line-height: 0; user-select: none; -webkit-user-select: none; background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 0 0/16px 16px; }
.media img, .media canvas { display: block; width: 100%; height: auto; max-height: 76vh; object-fit: contain; margin: 0 auto; }
.media video { display: block; width: 100%; max-height: 72vh; background: #000; }
.pinlayer { position: absolute; inset: 0; z-index: 3; cursor: crosshair; } .pinlayer.off { pointer-events: none; }
.pinning .pinlayer { cursor: crosshair; outline: 3px solid var(--accent); outline-offset: -3px; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.pin { position: absolute; z-index: 4; width: 30px; height: 30px; margin: -30px 0 0 -15px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; border: 2.5px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.35); cursor: pointer; font: 700 13px var(--f-display); line-height: 1; padding: 0; transition: transform .15s; }
.pin span { transform: rotate(45deg); } .pin.team { background: #2D7FE4; color: #fff; } .pin.resolved { background: var(--ok); opacity: .8; } .pin.sel { transform: rotate(-45deg) scale(1.28); z-index: 6; } .pin.draft { animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 25%, transparent); } }
.hint { position: absolute; z-index: 5; left: 50%; top: 12px; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 600; line-height: 1.3; pointer-events: none; white-space: nowrap; }
.slidebar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px; border-top: 1px solid var(--line); line-height: 1; }
.dots { display: flex; gap: 6px; } .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); } .dots i.on { background: var(--accent); }
.textdoc { padding: 24px; white-space: pre-wrap; font-size: 17px; line-height: 1.6; max-height: 70vh; overflow: auto; }
.linkdoc { padding: 36px 24px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.vchips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; cursor: pointer; } .chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* commentaires */
.panel { display: flex; flex-direction: column; gap: 14px; }
.threads { display: flex; flex-direction: column; gap: 10px; }
.th { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; transition: border-color .15s; } .th.sel { border-color: var(--accent); } .th.resolved { opacity: .62; }
.cm { display: flex; gap: 10px; } .cm + .cm { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.av { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 13px var(--f-display); flex: none; } .av.team { background: #DDEBFB; color: #2D7FE4; }
.cm .who { font-weight: 650; font-size: 14px; } .cm .when { color: var(--muted); font-size: 12px; font-weight: 500; } .cm p { margin: 2px 0 0; white-space: pre-wrap; }
.num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 11px; background: var(--accent); color: var(--accent-fg); font-size: 12px; font-weight: 700; margin-right: 4px; }
.tstamp { border: 0; background: var(--surface-2); border-radius: 8px; padding: 2px 8px; font-weight: 700; font-size: 12.5px; cursor: pointer; margin-right: 6px; }
.tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: #DDEBFB; color: #2D7FE4; margin-left: 4px; }
.acts { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; } .acts button { border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; padding: 6px 8px; border-radius: 8px; cursor: pointer; } .acts button:hover { background: var(--surface-2); color: var(--fg); }
.composer { background: var(--surface); border: 1.5px solid var(--accent); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.composer textarea { border: 0; background: transparent; resize: none; min-height: 64px; width: 100%; font-size: 16px; outline: none; }
.audio { width: 100%; height: 38px; } .rec { color: var(--danger); font-weight: 700; display: flex; align-items: center; gap: 8px; } .rec::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse2 1s infinite; } @keyframes pulse2 { 50% { opacity: .25; } }
.actionbar { display: flex; gap: 10px; }
.actionbar .btn { flex: 1; min-height: 52px; font-size: 16px; }
.decided { text-align: center; padding: 14px; border-radius: 14px; font-weight: 650; }
.crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; } .crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; } .crumbs a:hover { color: var(--fg); }

/* espace client */
.rtop { position: sticky; top: 0; z-index: 30; padding: 12px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; } .progress i { display: block; height: 100%; background: var(--ok); transition: width .4s; }
.rhead { padding: 22px 0 8px; } .rhead .cl { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.reviewbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); display: none; }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin: 40px 0 10px; } .foot a { font-weight: 600; text-decoration: none; }

@media (max-width: 960px) {
  .kpis { grid-template-columns: repeat(2, 1fr); } .two { grid-template-columns: 1fr; }
  .viewer { grid-template-columns: 1fr; gap: 14px; } .stagewrap { position: static; }
  .media img, .media canvas { max-height: 62vh; } .media video { max-height: 54vh; }
  .reviewbar.on { display: block; } body.hasbar { padding-bottom: 86px; }
}
@media (max-width: 520px) {
  .items { grid-template-columns: repeat(2, 1fr); gap: 10px; } .spaces { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; } .hint { white-space: normal; width: max-content; max-width: 86%; text-align: center; border-radius: 14px; }
  .card { padding: 16px; border-radius: 18px; } .kpi b { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* retouches */
.thumb .txt { padding-top: 40px; }
.panel .btn, .actionbar .btn { white-space: normal; text-align: center; line-height: 1.2; padding-top: 8px; padding-bottom: 8px; }
