/* Saham Affichage – app layout */
html,body{margin:0;background:#F3F6F6;color:#12201F;font-family:Inter,system-ui,sans-serif;-webkit-font-smoothing:antialiased}
a{color:#1B6F74}a:hover{color:#124F53}
h1,h2,h3{font-family:Outfit,sans-serif;font-weight:600;margin:0}
[hidden]{display:none!important}
.shell{min-height:100vh;display:flex}
.sidebar{width:260px;flex-shrink:0;background:#005156;color:#fff;padding:36px 20px 24px;display:flex;flex-direction:column;gap:36px;position:sticky;top:0;height:100vh;overflow:auto}
.sidebar-logo{display:flex;justify-content:center;padding:0 16px}
.sidebar-logo img{display:block;height:auto}
.sidebar-nav{display:flex;flex-direction:column;gap:4px}
.nav-badge{font-size:12px;font-weight:600;background:#FDEEE6;color:#A33A0B;border-radius:999px;padding:2px 8px}
.sidebar-foot{margin-top:auto;display:flex;flex-direction:column;gap:16px}
.storage{background:rgba(255,255,255,.08);border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:10px}
.storage-bar{height:8px;border-radius:999px;background:rgba(255,255,255,.18);overflow:hidden}
.storage-bar div{height:8px;background:#fff;border-radius:999px}
.me{display:flex;align-items:center;gap:12px;padding:0 4px}
.me-avatar{width:36px;height:36px;border-radius:999px;background:rgba(255,255,255,.16);display:flex;align-items:center;justify-content:center;font-weight:600;font-size:14px}
.sidebar-close,.topbar,.nav-scrim{display:none}
.content{flex:1;min-width:0;padding:32px clamp(16px,3vw,40px) 48px;display:flex;flex-direction:column;gap:24px}

.page-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}
.page-head h1{font-size:30px;line-height:1.2}
.page-head p{margin:6px 0 0;font-size:15px;color:#566664}
.actions{display:flex;flex-wrap:wrap;gap:10px}
.muted{color:#566664}
.small{font-size:12px}
.chips{display:flex;gap:6px;padding-bottom:2px}

/* Screens page */
.project{padding:20px;display:flex;flex-direction:column;gap:18px}
.project-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 16px}
.project-head h2{font-size:20px}
.stat-line{margin:4px 0 0;font-size:13px;color:#566664;display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
.dot{width:7px;height:7px;border-radius:999px;display:inline-block}
.dot.on{background:#16A34A}.dot.sync{background:#D9A400}.dot.off{background:#EA580C}
.screens-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px}
.screen-card{border:1px solid #E1E8E8;border-radius:14px;display:flex;flex-direction:column;background:#fff}
.shotbox{position:relative;aspect-ratio:16/9;display:flex;align-items:center;justify-content:center;border-radius:13px 13px 0 0;background:#DCE7E7;overflow:hidden;text-decoration:none}
.shotbox img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.shotbox.is-off{background:#EEF1F1}
.shotbox.is-off img{filter:grayscale(1);opacity:.35}
.shotbox .nosig{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;color:#566664;font-size:12px;font-weight:500}
.pill{position:absolute;left:10px;top:10px;display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;border-radius:999px;padding:4px 9px;background:#fff}
.pill.on{color:#146B3A}.pill.sync{color:#7A5B00}.pill.off{color:#A33A0B}
.pill-inline{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;border-radius:999px;padding:4px 10px}
.pill-inline.on{background:#E5F4EA;color:#146B3A}.pill-inline.sync{background:#FBF3D9;color:#7A5B00}.pill-inline.off{background:#FDEEE6;color:#A33A0B}
.caplabel{position:absolute;right:10px;bottom:10px;background:rgba(10,20,19,.75);color:#fff;font-size:11px;font-weight:500;border-radius:6px;padding:3px 7px}
.capturing{position:absolute;inset:0;background:rgba(255,255,255,.72);display:flex;align-items:center;justify-content:center;gap:8px;font-size:12px;font-weight:600;color:#34423F}
.screen-head{padding:12px 8px 4px 16px;display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.screen-head h3{font-family:Inter,sans-serif;font-size:15px}
.loop-head{padding:8px 16px 4px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:#566664}
.loop-head b{font-weight:600;text-transform:uppercase;letter-spacing:.04em}
.loop-mini{list-style:none;margin:0;padding:4px 8px 8px;display:flex;flex-direction:column;gap:2px}
.loop-mini li{display:flex;align-items:center;gap:10px;padding:4px 4px 4px 8px;border-radius:8px}
.loop-mini li.is-current{background:#EFF7F7}
.num{width:22px;height:22px;flex-shrink:0;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;background:#F3F6F6;color:#566664}
.is-current .num{background:#1B6F74;color:#fff}
.now{display:none;font-size:11px;font-weight:600;color:#1B6F74}
.is-current .now{display:block}
.vt{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.vt span:first-child{font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.snd{display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:600;border-radius:6px;padding:3px 6px;flex-shrink:0}
.snd.on{background:#E3F1F1;color:#1B6F74}.snd.off{background:#F1F3F3;color:#566664}
.dur{width:36px;text-align:right;font-size:12px;color:#566664;font-variant-numeric:tabular-nums}
.card-foot{margin-top:auto;border-top:1px solid #EEF2F2;padding:6px 8px}

.empty{padding:48px 24px;display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center}
.empty-icon{width:64px;height:64px;border-radius:18px;background:#E3F1F1;color:#1B6F74;display:flex;align-items:center;justify-content:center}
.steps3{list-style:none;margin:0;padding:0;width:100%;max-width:880px;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;text-align:left}
.steps3 li{border:1px solid #E1E8E8;border-radius:14px;padding:18px;display:flex;flex-direction:column;gap:10px}
.stepnum{width:30px;height:30px;border-radius:999px;background:#F3F6F6;color:#566664;font-weight:700;font-size:14px;display:flex;align-items:center;justify-content:center}
.stepnum.first{background:#1B6F74;color:#fff}

/* Tables */
.table{width:100%;min-width:820px;border-collapse:collapse;font-size:14px}
.table th{text-align:left;color:#566664;font-size:12px;text-transform:uppercase;letter-spacing:.04em;font-weight:600;padding:14px 16px 12px}
.table td{padding:10px 16px;border-top:1px solid #EEF2F2;vertical-align:middle}
.table th:first-child,.table td:first-child{padding-left:20px}
.table th:last-child,.table td:last-child{padding-right:20px;width:56px}
.thumb{position:relative;width:112px;height:63px;flex-shrink:0;border:0;padding:0;border-radius:8px;background:#DCE7E7 center/cover no-repeat;cursor:pointer;overflow:hidden}
.thumb .d{position:absolute;right:4px;bottom:4px;background:rgba(10,20,19,.8);color:#fff;font-size:11px;font-weight:600;border-radius:4px;padding:1px 5px}
.badge{font-size:12px;font-weight:600;border-radius:999px;padding:3px 9px;white-space:nowrap}
.badge.teal{background:#E3F1F1;color:#1B6F74}.badge.grey{background:#F3F6F6;color:#566664}.badge.warn{background:#FBF3D9;color:#7A5B00}.badge.err{background:#FEF0EE;color:#B42318}.badge.dark{background:#005156;color:#fff}

/* Screen editor */
.two-col{display:flex;flex-wrap:wrap;gap:20px;align-items:flex-start}
.two-col>.main{flex:999 1 520px;min-width:0}
.two-col>.side{flex:1 1 320px;min-width:0;display:flex;flex-direction:column;gap:20px}
.loop-edit{list-style:none;margin:0;padding:0 12px 4px;display:flex;flex-direction:column;gap:6px}
.loop-edit li{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:10px 8px;border:1px solid #E1E8E8;border-radius:12px;background:#fff}
.loop-edit .n{width:28px;height:28px;flex-shrink:0;border-radius:8px;background:#E3F1F1;color:#1B6F74;font-size:13px;font-weight:700;display:flex;align-items:center;justify-content:center}
.loop-edit .t{flex:1 1 160px;min-width:0;display:flex;flex-direction:column;gap:2px}
.info dl{margin:0}
.info .row{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-top:1px solid #EEF2F2;font-size:13px}
.info dt{color:#566664}.info dd{margin:0;text-align:right;font-weight:500}
.lib-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}
.check-card .tb{position:relative;display:block;aspect-ratio:16/9;border-radius:8px;background:#DCE7E7 center/cover no-repeat}
.check-card .ck{position:absolute;left:6px;top:6px;width:24px;height:24px;border-radius:7px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.92);border:1.5px solid #9FB4B3;color:transparent}
.check-card.is-checked .ck{background:#1B6F74;border-color:#1B6F74;color:#fff}
.check-card:disabled{opacity:.55;cursor:not-allowed}
.opt{display:flex;align-items:center;gap:12px;min-height:48px;padding:0 14px;border-radius:10px;cursor:pointer;border:1px solid #E1E8E8;background:#fff}
.opt:has(input:checked){border-color:#1B6F74;background:#F2F8F8}
.opt:has(input:disabled){background:#F7F9F9;cursor:not-allowed}
.opt-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.savebar[hidden]{display:none}
.player{position:relative;aspect-ratio:16/9;border-radius:12px;background:#0E1716;overflow:hidden}
.player video{width:100%;height:100%;display:block;background:#0E1716}
.code-demo{background:#0E1716;color:#fff;border-radius:12px;padding:14px 22px;display:inline-flex;flex-direction:column;gap:4px;align-items:center}
.code-demo b{font-family:Outfit,sans-serif;font-weight:600;font-size:28px;letter-spacing:.3em}
.filelist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.filerow{display:flex;align-items:center;gap:12px;padding:10px 8px 10px 12px;border-radius:12px;border:1px solid #E1E8E8;background:#fff}
.filerow.bad{border-color:#F4C7C1;background:#FFF8F7}
.fileicon{width:40px;height:40px;flex-shrink:0;border-radius:10px;display:flex;align-items:center;justify-content:center;background:#E3F1F1;color:#1B6F74}
.filerow.bad .fileicon{background:#FEF0EE;color:#B42318}
.filerow.done .fileicon{background:#E5F4EA;color:#146B3A}
.filerow.conv .fileicon{background:#FBF3D9;color:#7A5B00}
.progress{height:6px;border-radius:999px;background:#E1E8E8;overflow:hidden}
.progress>div{height:6px;border-radius:999px;background:#1B6F74;transition:width .3s}

/* Auth pages */
.auth{min-height:100vh;display:flex;flex-wrap:wrap;background:#fff}
.auth-brand{flex:1 1 420px;background:#005156;color:#fff;padding:clamp(32px,6vw,72px);display:flex;flex-direction:column;justify-content:space-between;gap:40px;min-height:260px}
.auth-form{flex:1 1 480px;display:flex;align-items:center;justify-content:center;padding:clamp(24px,5vw,64px)}
.auth-form>div{width:100%;max-width:400px;display:flex;flex-direction:column;gap:24px}

/* Mobile */
@media (max-width: 900px){
  .shell{flex-direction:column}
  .topbar{display:flex;position:sticky;top:0;z-index:30;height:64px;background:#005156;align-items:center;justify-content:space-between;padding:0 8px 0 16px}
  .topbar img{display:block;height:40px;width:auto}
  .sidebar{position:fixed;left:0;top:0;bottom:0;height:auto;width:290px;z-index:60;transform:translateX(-105%);transition:transform .22s cubic-bezier(.2,.8,.2,1);padding-top:20px}
  .sidebar.is-open{transform:none;box-shadow:12px 0 32px rgba(0,0,0,.2)}
  .sidebar-logo{justify-content:flex-start;padding:0}
  .sidebar-logo img{width:110px}
  .sidebar-close{display:inline-flex;position:absolute;right:12px;top:16px}
  .nav-scrim.is-open{display:block;position:fixed;inset:0;background:rgba(10,25,24,.5);z-index:55}
  .content{padding:20px 16px 32px;gap:18px}
  .page-head h1{font-size:24px}
  .page-head .actions{width:100%}
  .page-head .actions .btn{flex:1}
  .screens-grid{grid-template-columns:1fr}
  .opt-grid{grid-template-columns:1fr}
  .modal{max-height:calc(100vh - 16px)}
  .overlay{padding:8px;align-items:flex-end}
  .overlay .modal{border-radius:18px 18px 12px 12px}
  .toast{bottom:16px;left:16px;right:16px;transform:none;max-width:none}
  @keyframes toastIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
  .savebar{bottom:8px}
}
@media (prefers-reduced-motion:reduce){.sidebar{transition:none}}
select.select{appearance:auto;-webkit-appearance:auto;padding-right:10px}
.mobile-meta{display:none}
@media (max-width: 900px){
  .table{min-width:0}
  .table th:not(:first-child):not(:last-child),.table td:not(:first-child):not(:last-child){display:none}
  .table td:first-child{padding-left:12px}
  .table .thumb{width:96px;height:54px}
  .mobile-meta{display:block}
}
