/* Aba Tutoriais. Apenas apresentação; permissões ficam no servidor e no banco. */
#tutorials{--tut-ink:#004d43;--tut-muted:#4d6d63;--tut-line:#d5e1d7;--tut-card:#fffdf8;--tut-soft:#eef3ea;--tut-accent:#ff6945;max-width:1200px;margin-inline:auto}
#tutorials button::before,.tut-dialog button::before{display:none}
#tutorials button,.tut-dialog button{gap:8px;letter-spacing:0;text-transform:none}
#tutorials button span,.tut-dialog button span{letter-spacing:0;text-transform:none;font-size:inherit;font-weight:inherit}
#tutorials .tut-section{border:0;background:none;padding:0;box-shadow:none;border-radius:0;margin:0 0 28px}
#tutorials svg,.tut-dialog svg{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tut-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap;margin:0 0 18px}
.tut-head h2{margin:0}
.tut-head p{margin:6px 0 0;color:var(--tut-muted);font-size:15px}
.tut-head-actions{display:flex;gap:10px;flex-wrap:wrap}
#tutorials .tut-primary,.tut-dialog .tut-primary{background:var(--tut-ink);color:#fff;border-color:var(--tut-ink)}
#tutorials .tut-primary[disabled],.tut-dialog .tut-primary[disabled]{opacity:.6;cursor:progress}
.tut-status,.tut-msg{margin:0 0 14px;padding:10px 12px;border-radius:10px;font-size:14px;background:#e9f4e4;border:1px solid #b9d6ad;color:#24502a}
.tut-status[data-kind=error],.tut-msg[data-kind=error]{background:#fdeee9;border-color:#e3b2a6;color:#8a2a17}
.tut-status[hidden],.tut-msg[hidden]{display:none}
.tut-chips{display:flex;gap:8px;overflow-x:auto;padding:2px 2px 10px;margin-bottom:6px;scrollbar-width:none}
.tut-chips::-webkit-scrollbar{display:none}
#tutorials .tut-chip{flex:none;min-height:42px;padding:8px 16px;border-radius:999px;background:#fff;font-size:15px;white-space:nowrap}
#tutorials .tut-chip[aria-pressed=true]{background:var(--tut-ink);color:#fff;border-color:var(--tut-ink)}
.tut-section{margin:0 0 28px}
.tut-section h3{display:flex;align-items:center;gap:10px;margin:0 0 14px;font-size:20px}
.tut-count{font-size:13px;font-weight:600;color:var(--tut-muted);background:var(--tut-soft);border-radius:999px;padding:2px 10px}
.tut-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}
.tut-card{display:flex;flex-direction:column;gap:8px;padding:12px 12px 14px;border:1px solid var(--tut-line);border-radius:18px;background:var(--tut-card)}
.tut-card h4{margin:2px 4px 0;font-size:17px;line-height:1.25;overflow-wrap:anywhere}
.tut-card-desc{margin:0 4px;font-size:14px;line-height:1.45;color:var(--tut-ink);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.tut-meta{margin:0 4px;font-size:13px;color:var(--tut-muted)}
#tutorials .tut-open{display:block;width:100%;min-height:0;padding:0;border:0;border-radius:12px;background:none}
.tut-thumb{position:relative;display:grid;place-items:center;aspect-ratio:16/9;border-radius:12px;background:linear-gradient(160deg,#0b5f4f,#003a32);color:#fff}
#tutorials .tut-thumb svg{width:48px;height:48px;padding:13px;border-radius:50%;background:rgba(255,255,255,.18);fill:currentColor;stroke:none}
.tut-thumb b{position:absolute;right:8px;bottom:8px;padding:2px 8px;border-radius:6px;background:rgba(0,0,0,.55);font-size:12px;font-weight:600}
#tutorials .tut-open:hover .tut-thumb{filter:brightness(1.12)}
#tutorials .tut-open:focus-visible{outline:3px solid #df741b;outline-offset:2px}
.tut-card-actions{display:flex;gap:8px;margin-top:auto;padding-top:4px}
.tut-card-actions button{flex:1;min-height:42px;padding:8px 10px;font-size:14px}
#tutorials .danger,.tut-dialog .danger{color:#963e29}
.tut-empty{padding:40px 20px;text-align:center;border:1.5px dashed var(--tut-line);border-radius:18px;background:var(--tut-card)}
.tut-empty h3{margin:0 0 6px}
.tut-empty p{margin:0 0 14px;color:var(--tut-muted)}
.tut-empty-line{margin:0;color:var(--tut-muted);font-size:14px}
/* Janelas */
.tut-dialog{width:min(640px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:0;border:0;border-radius:20px;background:var(--tut-card,#fffdf8);color:#004d43;box-shadow:0 24px 60px rgba(0,30,24,.35);overflow:auto}
.tut-dialog::backdrop{background:rgba(0,30,24,.55)}
.tut-dlg-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:16px 18px;border-bottom:1px solid #d5e1d7}
.tut-dlg-head h3{margin:0;font-size:20px;overflow-wrap:anywhere}
.tut-dialog .tut-icon-btn{min-height:44px;width:44px;padding:0;border-radius:50%}
.tut-dlg-body{padding:18px;display:grid;gap:14px}
.tut-player{width:min(900px,calc(100vw - 24px))}
.tut-player video{width:100%;max-height:70dvh;border-radius:12px;background:#000;display:block}
.tut-desc{margin:0;font-size:16px;line-height:1.5}
.tut-form{display:grid;gap:14px}
.tut-field{display:grid;gap:6px;font-weight:600;font-size:15px}
.tut-field small{font-weight:400;color:#4d6d63;font-size:13px}
.tut-field :is(input,select,textarea){font:inherit;min-height:48px;padding:10px 12px;border:1.5px solid #b9cebf;border-radius:12px;background:#fff;color:#16231d;width:100%}
.tut-field textarea{resize:vertical;min-height:84px}
.tut-field :is(input,select,textarea):focus-visible{outline:2px solid #004d43;outline-offset:1px;border-color:#004d43}
.tut-file-info{margin:-6px 0 0;font-size:14px;color:#4d6d63;overflow-wrap:anywhere}
.tut-progress{height:10px;border-radius:999px;background:#e3eadf;overflow:hidden}
.tut-progress span{display:block;height:100%;background:#004d43;transition:width .2s}
.tut-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}
.tut-actions button{min-height:48px}
.tut-cats{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.tut-cats li{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;gap:8px;align-items:center}
.tut-cats input,.tut-newcat input{font:inherit;min-height:46px;padding:8px 12px;border:1.5px solid #b9cebf;border-radius:12px;background:#fff;width:100%;min-width:0}
.tut-cats button{min-height:46px;padding:8px 12px;font-size:14px}
.tut-newcat{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding-top:6px;border-top:1px solid #d5e1d7}
@media(max-width:640px){
 .tut-head-actions{width:100%}.tut-head-actions button{flex:1}
 .tut-grid{grid-template-columns:minmax(0,1fr)}
 .tut-cats li{grid-template-columns:minmax(0,1fr) auto}
 .tut-cats .tut-count{display:none}
 .tut-cats li button{grid-column:auto}
 .tut-newcat{grid-template-columns:minmax(0,1fr)}
 .tut-actions button{flex:1 1 100%}
}
@media(prefers-reduced-motion:reduce){.tut-progress span{transition:none}}

nav[aria-label="Navegação principal"] a[href="#tutoriais"]{--action-icon:url("assets/ui-play.svg")}
