@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo-latin-wdth-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo-latin-ext-wdth-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Identidade: preto, branco e o vermelho do REC só nos detalhes */
:root {
  --ink: #000000;      /* fundo */
  --nave: #121212;     /* superfícies */
  --pew: #232323;      /* bordas e elevados */
  --pew-2: #383838;
  --linen: #ffffff;    /* texto */
  --dust: #9a9a9a;     /* texto secundário */
  --rec: #ef2b2d;      /* vermelho: só detalhes (REC, aba ativa, contadores, alertas) */
  --candle: #ffffff;   /* ação principal: branco */
  --candle-ink: #000000;
  --sage: #ffffff;     /* concluído */
  --tally: var(--rec);
  --cond: 72%;         /* largura condensada dos títulos */

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--linen);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--candle); outline-offset: 2px; }

/* ---------- Botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 999px;
  background: none; cursor: pointer; font-weight: 600; font-size: 15px;
  white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--candle); color: var(--candle-ink); }
.btn-primary:hover { background: #dcdcdc; }
.btn-ghost { border-color: var(--pew-2); }
.btn-ghost:hover { background: var(--pew); }
.btn-danger { color: var(--rec); }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 999px; background: none; cursor: pointer;
}
.icon-btn:hover { background: var(--pew); }

.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; color: var(--dust); }
.field input, .field select {
  min-height: 46px; padding: 0 14px;
  background: var(--nave); border: 1px solid var(--pew-2); border-radius: var(--r-md);
}
.field-inline { grid-template-columns: auto 1fr; align-items: center; gap: 12px; }
.form-error { min-height: 1.5em; margin: 0; color: var(--rec); font-size: 14px; }

/* ---------- Entrar ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(360px, 100%); display: grid; gap: 14px; }
.login-card .mark { width: 64px; height: 64px; color: var(--linen); }
.login-title { margin: 8px 0 0; font-size: 40px; line-height: 1; font-weight: 800; letter-spacing: -.02em; }
.login-sub { margin: 0 0 12px; color: var(--dust); }

/* ---------- Estrutura ---------- */
.app { min-height: 100dvh; padding-bottom: calc(76px + var(--safe-b)); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: calc(10px + var(--safe-t)) 20px 10px;
  border-bottom: 1px solid var(--nave);
}
/* O desfoque fica num pseudo-elemento: no próprio header ele prenderia a barra de abas fixa */
.topbar::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.01em; min-width: 0; }
.brand-name { display: grid; line-height: 1; min-width: 0; }
.brand-name b { font-weight: 800; white-space: nowrap; }
.brand-name small { margin-top: 2px; font-size: 12px; font-weight: 600; font-stretch: 100%; letter-spacing: .06em; color: var(--dust); }
.brand .mark { width: 28px; height: 28px; color: var(--linen); }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + var(--safe-b));
  background: var(--nave); border-top: 1px solid var(--pew);
}
.tab {
  position: relative; display: grid; justify-items: center; gap: 2px;
  padding: 6px; border-radius: var(--r-md); color: var(--dust); font-size: 12px; font-weight: 600;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current='page'] { color: var(--linen); }
.tab[aria-current='page']::before {
  content: ''; position: absolute; top: 0; left: 50%; width: 18px; height: 3px; margin-left: -9px;
  border-radius: 0 0 3px 3px; background: var(--rec);
}
.badge {
  position: absolute; top: 2px; left: calc(50% + 6px);
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--rec); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}

.badge-muted { background: var(--pew-2); color: var(--linen); }
.storage {
  margin-left: auto; display: grid; gap: 5px; justify-items: end; padding: 6px 8px; margin-right: -8px;
  border: 0; border-radius: var(--r-md); background: none; cursor: pointer; font-size: 12px; color: var(--dust);
}
.storage:hover { background: var(--nave); color: var(--linen); }
.storage-bar { width: 96px; height: 4px; border-radius: 4px; background: var(--pew); overflow: hidden; }
.storage-bar i { display: block; height: 100%; width: 0; background: var(--dust); }
.storage.low .storage-bar i { background: var(--tally); }

.view { padding: 16px 20px 32px; max-width: 1480px; margin: 0 auto; }

@media (min-width: 820px) {
  .app { padding-bottom: 0; }
  .tabs {
    position: static; display: flex; gap: 4px; padding: 0; margin-left: 24px;
    background: none; border: 0;
  }
  .tab { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 15px; }
  .tab svg { width: 20px; height: 20px; }
  .tab[aria-current='page'] { background: var(--nave); }
  .tab[aria-current='page']::before { top: 50%; left: 8px; width: 6px; height: 6px; margin: -3px 0 0; border-radius: 50%; }
  .tab { padding-left: 20px; }
  .badge { position: static; }
  .storage-bar { width: 140px; }
  .view { padding: 24px 32px 48px; }
}

/* ---------- Biblioteca ---------- */
.toolbar { display: flex; gap: 10px; }
.search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 16px;
  background: var(--nave); border: 1px solid var(--pew); border-radius: 999px;
}
.search:focus-within { border-color: var(--candle); }
.search svg { color: var(--dust); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; }
.search input::-webkit-search-cancel-button { filter: invert(.7); }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; }
.sort select {
  appearance: none; -webkit-appearance: none; border: 0; background: none; cursor: pointer;
  padding: 6px 22px 6px 8px; border-radius: var(--r-sm);
  color: var(--linen); font-weight: 600; font-size: 14px; text-align: right;
  background: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22m7 10 5 5 5-5%22 fill=%22none%22 stroke=%22%239c99b8%22 stroke-width=%222%22 stroke-linecap=%22round%22/%3E%3C/svg%3E') right 2px center / 18px no-repeat;
}
.sort select:hover { background-color: var(--nave); }
.sort option { background: var(--nave); }

.folder-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 16px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 15px; min-width: 0; }
.crumbs button {
  border: 0; background: none; padding: 6px 6px; border-radius: var(--r-sm);
  color: var(--dust); cursor: pointer; font-weight: 600; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crumbs button:last-child { color: var(--linen); font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.crumbs button:hover { background: var(--nave); }
.crumbs .sep { color: var(--pew-2); }
.folder-actions { display: flex; gap: 8px; }
@media (max-width: 480px) { .folder-actions .btn span { display: none; } .folder-actions .btn { padding: 0 11px; } }

.section-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--dust); }
.folders-wrap { margin-top: 20px; }
.folders-wrap .section-title { margin-bottom: 10px; }
.folders { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 620px) { .folders { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.folder {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 12px 14px; border: 1px solid var(--pew); border-radius: var(--r-md);
  background: var(--nave); cursor: pointer; text-align: left;
}
.folder:hover { border-color: var(--pew-2); background: var(--pew); }
.folder-ico { color: #d8d8d8; display: grid; }
.folder-ico svg { width: 26px; height: 26px; }
.folder-text { display: grid; min-width: 0; }
.folder-text strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-text small { color: var(--dust); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.summary { margin: 2px 0 0; color: var(--dust); font-size: 14px; }

.group-title { margin: 22px 0 12px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.more { height: 40px; }
.grid {
  display: grid; gap: 18px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 620px) { .grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 24px 16px; } }

.card { position: relative; display: grid; gap: 8px; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden;
  background: var(--nave); touch-action: pan-y;
}
/* Prévia ao passar o dedo */
.scrub { position: absolute; inset: 0; background-repeat: no-repeat; background-color: #000; opacity: 0; pointer-events: none; transition: opacity .12s; }
.thumb.scrubbing .scrub { opacity: 1; }
.thumb.scrubbing .dur, .thumb.scrubbing .res, .thumb.scrubbing .check { opacity: 0; }
.scrub-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--rec); }
.scrub-time {
  position: absolute; right: 6px; bottom: 8px; padding: 1px 7px; border-radius: 5px;
  background: rgba(0, 0, 0, .72); font-size: 12px; font-weight: 700; color: var(--linen);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.thumb.portrait img { object-fit: contain; background: #000; }
.card:hover .thumb img { transform: scale(1.03); }
.thumb .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--pew-2); }
.thumb .placeholder svg { width: 36px; height: 36px; }
.thumb .pending { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .4; } }
.dur {
  position: absolute; right: 6px; bottom: 6px;
  padding: 1px 7px; border-radius: 5px; background: rgba(0, 0, 0, .72);
  font-size: 12px; font-weight: 600;
}
.res {
  position: absolute; left: 6px; bottom: 6px;
  padding: 1px 6px; border-radius: 5px; background: rgba(0, 0, 0, .72);
  font-size: 11px; font-weight: 700; color: var(--linen); letter-spacing: .02em;
}
.check {
  position: absolute; top: 8px; left: 8px; width: 28px; height: 28px;
  display: grid; place-items: center; border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, .85); background: rgba(0, 0, 0, .35);
  opacity: 0; transition: opacity .15s;
}
.check svg { width: 16px; height: 16px; opacity: 0; }
.card:hover .check, .selecting .check { opacity: 1; }
.card.selected .check { background: var(--candle); border-color: var(--candle); color: var(--candle-ink); opacity: 1; }
.card.selected .check svg { opacity: 1; }
.card.selected .thumb { outline: 3px solid var(--candle); outline-offset: 2px; }
.card-title {
  margin: 0; font-size: 15px; line-height: 1.3; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.card-sub span { white-space: nowrap; }
.card-where { display: flex; align-items: center; gap: 4px; margin: -6px 0 0; font-size: 12px; color: var(--dust); min-width: 0; }
.card-where svg { width: 13px; height: 13px; flex: none; }
.card-sub { margin: -4px 0 0; font-size: 13px; color: var(--dust); }
.card-sub .err { color: var(--rec); }

.empty { margin: 64px auto; max-width: 380px; text-align: center; color: var(--dust); }
.empty h3 { margin: 0 0 6px; color: var(--linen); font-size: 20px; }
.empty .btn { margin-top: 16px; }

/* ---------- Seleção ---------- */
.selbar {
  position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b));
  display: flex; align-items: center; gap: 6px;
  padding: 8px 8px 8px 4px; border-radius: 999px;
  background: var(--pew); border: 1px solid var(--pew-2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  max-width: 620px; margin: 0 auto;
}
.selbar #sel-count { flex: 1; font-weight: 700; }

/* ---------- Enviar ---------- */
.dest {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 16px; border: 1px solid var(--pew-2); border-radius: var(--r-lg);
  background: var(--nave); cursor: pointer; text-align: left;
}
.dest:hover { border-color: var(--candle); }
.dest > svg { width: 28px; height: 28px; color: var(--candle); }
.dest-text { flex: 1; display: grid; min-width: 0; }
.dest-label { font-size: 13px; color: var(--dust); }
.dest-text strong { font-size: 17px; overflow-wrap: anywhere; }
.dest-change { color: var(--linen); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.pick-row { display: flex; gap: 10px; }
.pick-row .drop { flex: 1; }
.drop-alt { flex: 0 0 34% !important; }
.drop-hint-native { color: var(--dust); font-size: 13px; }
.shared-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; margin-bottom: 14px; border-radius: var(--r-lg); background: var(--nave); border: 1px solid var(--pew-2); }
.shared-box p { margin: 0; font-weight: 600; }

.drop {
  position: relative; margin-top: 16px;
  display: grid; justify-items: center; gap: 6px; padding: 34px 20px;
  border: 2px dashed var(--pew-2); border-radius: var(--r-lg);
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop svg { width: 34px; height: 34px; color: var(--candle); }
.drop strong { font-size: 19px; }
.drop-hint { color: var(--dust); font-size: 14px; }
.drop.over, .drop:hover { border-color: var(--linen); background: var(--nave); }
@media (pointer: coarse) { .drop-hint { display: none; } .drop { padding: 26px 20px; } }

.progress {
  margin-top: 20px; padding: 22px 20px 16px;
  border-radius: var(--r-lg); background: var(--nave);
}
.progress-figures { display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: flex-end; }
.figure { display: grid; }
.figure-num {
  font-size: clamp(40px, 11vw, 64px); line-height: .95; font-weight: 800; letter-spacing: -.035em;
}

.figure-label { margin-top: 6px; font-size: 14px; color: var(--dust); }
.progress.done .figure-num { color: var(--sage); }

/* Barra segmentada: um bloco por vídeo */
.segments { display: flex; gap: 3px; height: 14px; margin: 20px 0 12px; }
.seg { position: relative; flex: 1 1 0; min-width: 3px; border-radius: 3px; background: var(--pew); overflow: hidden; }
.seg i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--candle); transition: width .4s linear; }
.seg.done i { background: var(--sage); width: 100%; }
.seg.error { background: color-mix(in srgb, var(--tally) 55%, var(--pew)); }
.segments.many { gap: 0; border-radius: 4px; overflow: hidden; }
.segments.many .seg { border-radius: 0; min-width: 0; }

.progress-foot .rate { color: var(--linen); font-weight: 600; margin-left: 10px; }
.progress-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; color: var(--dust); font-size: 14px; }
.progress-actions { display: flex; gap: 8px; }

.queue { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 2px; }
.qitem {
  display: grid; grid-template-columns: 88px 1fr auto; gap: 14px; align-items: center;
  padding: 10px 6px; border-bottom: 1px solid var(--nave);
}
.qthumb { position: relative; width: 88px; aspect-ratio: 16/9; border-radius: var(--r-sm); background: var(--nave); overflow: hidden; display: grid; place-items: center; color: var(--pew-2); }
.qthumb img { width: 100%; height: 100%; object-fit: cover; }
.qinfo { min-width: 0; display: grid; gap: 4px; }
.qname { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qstate span { white-space: nowrap; display: inline-flex; align-items: center; }
.qstate { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; color: var(--dust); }
.qstate .ok { color: var(--sage); }
.qstate .bad { color: var(--rec); }
.qbar { height: 4px; border-radius: 4px; background: var(--pew); overflow: hidden; }
.qbar i { display: block; height: 100%; width: 0; background: var(--candle); transition: width .4s linear; }
.qitem.done .qbar i { background: var(--sage); }
.qitem.done .qbar, .qitem.waiting .qbar { visibility: hidden; }

/* ---------- Lixeira ---------- */
.trash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.page-title { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.page-sub { margin: 4px 0 0; color: var(--dust); font-size: 14px; max-width: 60ch; }
.trash-list { list-style: none; margin: 16px 0 0; padding: 0; }
.titem { display: grid; grid-template-columns: 88px 1fr auto; gap: 14px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--nave); }
.titem .qstate svg { width: 14px; height: 14px; margin-right: 4px; flex: none; }
.titem .qstate span:has(svg) { white-space: normal; }
.titem .qthumb img { filter: saturate(.6); }
.tactions { display: flex; align-items: center; gap: 2px; }
@media (max-width: 480px) { .tactions .btn span { display: none; } .tactions .btn { padding: 0 10px; } }

/* ---------- Escolher pasta ---------- */
.sheet {
  width: 100%; max-width: 560px; max-height: min(86dvh, 720px); margin: auto auto 0; padding: 0;
  border: 1px solid var(--pew-2); border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--nave);
}
.sheet[open] { display: flex; flex-direction: column; animation: rise .2s ease-out; }
@media (min-width: 620px) { .sheet { margin: auto; border-radius: var(--r-lg); border-bottom: 1px solid var(--pew-2); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 0 20px; }
.sheet-head h3 { margin: 0; font-size: 19px; }
.pk-crumbs { padding: 4px 14px 8px; border-bottom: 1px solid var(--pew); }
.pk-crumbs button:last-child { font-size: 16px; }
.pk-list { list-style: none; margin: 0; padding: 6px 8px; overflow-y: auto; flex: 1; min-height: 180px; }
.pk-list button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 10px;
  border: 0; border-radius: var(--r-md); background: none; cursor: pointer; text-align: left;
}
.pk-list button:hover { background: var(--pew); }
.pk-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-list small { color: var(--dust); }
.pk-list button > svg:last-child { color: var(--dust); width: 18px; height: 18px; }
.pk-empty { padding: 24px 12px; color: var(--dust); text-align: center; }
.sheet-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--pew); }
.sheet-foot .btn-primary { flex: 1; }

/* ---------- Aviso do app Android ---------- */
.banner {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px 44px 14px 16px; margin-bottom: 16px; border-radius: var(--r-lg);
  background: var(--nave); border: 1px solid var(--pew-2);
}
.banner > svg { width: 28px; height: 28px; color: var(--candle); }
.banner-text { flex: 1 1 200px; display: grid; font-size: 14px; color: var(--dust); }
.banner-text strong { color: var(--linen); font-size: 15px; }
.banner-actions { display: flex; gap: 8px; }
.banner-close { position: absolute; top: 4px; right: 4px; width: 38px; height: 38px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--linen); }
.steps b { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; background: var(--candle); color: var(--candle-ink); font-size: 14px; }
.steps span { padding-top: 3px; line-height: 1.45; }
.steps svg { width: 20px; height: 20px; vertical-align: -4px; color: var(--candle); }
.steps-note { margin: 14px 0 0; font-size: 14px; }
.progress-hint { margin: 14px 0 0; padding: 10px 14px; border-radius: var(--r-md); background: var(--nave); border-left: 3px solid var(--linen); color: var(--linen); font-size: 14px; }

/* ---------- Compartilhar ---------- */
.share-dlg h3 { overflow-wrap: anywhere; }
.seg-pick { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.seg-pick legend { padding: 0; margin-bottom: 8px; font-size: 14px; color: var(--dust); }
.seg-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; border-radius: 999px; background: var(--ink); }
.seg-pick label { position: relative; }
.seg-pick input { position: absolute; opacity: 0; }
.seg-pick span { display: block; padding: 9px 4px; border-radius: 999px; text-align: center; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--dust); }
.seg-pick input:checked + span { background: var(--candle); color: var(--candle-ink); }
.seg-pick input:focus-visible + span { outline: 2px solid var(--candle); outline-offset: 2px; }
.check-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; cursor: pointer; font-weight: 600; }
.check-row input { width: 22px; height: 22px; accent-color: #fff; }
.linkbox {
  width: 100%; min-height: 48px; margin-bottom: 16px; padding: 0 14px;
  border: 1px solid var(--pew-2); border-radius: var(--r-md); background: var(--ink);
  color: var(--linen); font-weight: 600; font-size: 15px;
}
.links-list { list-style: none; margin: 16px 0 0; padding: 0; }
.litem { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--nave); }
.litem-ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--nave); color: var(--linen); }
.litem.expired .litem-ico { color: var(--dust); }
.litem.expired .qname { color: var(--dust); }
.litem .qstate .bad { color: var(--rec); }

/* ---------- Tipografia de títulos (Archivo estreita) ---------- */
.brand, .login-title, .page-title, .detail-title, .group-title, .figure-num,
.crumbs button:last-child, .pub-title, .confirm h3, .sheet-head h3, .empty h3 {
  font-stretch: var(--cond);
}
.brand { font-size: 23px; font-weight: 800; letter-spacing: -.005em; }
.login-title { display: grid; font-size: 60px; font-weight: 800; letter-spacing: -.02em; line-height: .92; }
.login-title-2 { color: var(--dust); font-weight: 700; }
.page-title { font-size: 38px; letter-spacing: -.015em; }
.detail-title { font-size: clamp(28px, 7vw, 40px); }
.group-title { font-size: 26px; font-weight: 800; }
.figure-num { font-size: clamp(52px, 15vw, 84px); font-weight: 800; letter-spacing: -.02em; }
.crumbs button:last-child { font-size: 24px; }

/* Sinal de "gravando" enquanto envia */
.rec { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--linen); }
.rec::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--rec); box-shadow: 0 0 0 4px color-mix(in srgb, var(--rec) 25%, transparent); animation: rec 1.4s ease-in-out infinite; }
@keyframes rec { 50% { opacity: .35; } }

/* ---------- Entrar / criar conta ---------- */
.auth-form { display: grid; gap: 14px; }
.pass { position: relative; display: block; }
.pass input { width: 100%; padding-right: 92px; }
.pass-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 6px 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--dust); font-weight: 600; font-size: 13px; cursor: pointer; }
.pass-toggle:hover { color: var(--linen); background: var(--pew); }
.field-hint { margin: -8px 0 0; font-size: 13px; color: var(--dust); }
.auth-switch { margin: 18px 0 0; text-align: center; color: var(--dust); font-size: 15px; }
.auth-switch button { border: 0; background: none; color: var(--linen); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px; }
.auth-done { padding: 18px; border-left: 3px solid var(--rec); background: var(--nave); }
.auth-done p { margin: 0; color: var(--dust); }
.auth-done .auth-done-title { margin-bottom: 6px; color: var(--linen); font-weight: 800; font-size: 20px; font-stretch: var(--cond); }
.login-card { width: min(380px, 100%); }

/* ---------- Conta ---------- */
.avatar {
  position: relative; flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--pew-2); border-radius: 50%; background: var(--nave); color: var(--linen);
  font-size: 13px; font-weight: 700; cursor: pointer; padding: 0;
}
button.avatar:hover { border-color: var(--linen); }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; cursor: default; }
.avatar-dot { position: absolute; top: -1px; right: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--rec); border: 2px solid var(--ink); }
.storage { margin-right: 4px; }
.account-sheet { max-width: 420px; }
.acc-body { padding: 4px 16px calc(16px + var(--safe-b)); }
.acc-who { display: flex; align-items: center; gap: 14px; padding: 6px 4px 16px; border-bottom: 1px solid var(--pew); }
.acc-name { display: grid; min-width: 0; }
.acc-name strong { font-size: 18px; }
.acc-name small { color: var(--dust); }
.acc-menu { display: grid; padding-top: 8px; }
.acc-item { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 8px; border: 0; border-radius: var(--r-md); background: none; text-align: left; font-weight: 600; font-size: 16px; cursor: pointer; }
.acc-item:hover { background: var(--pew); }
.acc-item span { flex: 1; }
.acc-item .badge { position: static; }
.acc-out { color: var(--dust); }

/* ---------- Equipe ---------- */
.group-count { margin-left: 10px; font-size: 16px; color: var(--dust); font-weight: 600; font-stretch: 100%; }
.team { list-style: none; margin: 0; padding: 0; }
.member { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--nave); }
.member-info { display: grid; min-width: 0; }
.member-info strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-info small { color: var(--dust); font-size: 13px; }
.role { margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--linen); color: var(--ink); font-size: 11px; font-weight: 700; }
.member-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Atividade ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: start; padding: 10px 4px; border-bottom: 1px solid var(--nave); }
.feed .avatar { cursor: default; }
.feed p { margin: 7px 0 0; line-height: 1.4; overflow-wrap: anywhere; color: var(--dust); }
.feed p strong, .feed p b { color: var(--linen); font-weight: 600; }
.feed time { margin-top: 7px; color: var(--dust); font-size: 13px; }
#activity-more { margin-top: 16px; }

/* ---------- Qualidade do player ---------- */
.quality { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 20px 0; }
.quality-opts { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--nave); border: 1px solid var(--pew); }
.quality-opts button { padding: 7px 14px; border: 0; border-radius: 999px; background: none; color: var(--dust); font-weight: 700; font-size: 13px; cursor: pointer; }
.quality-opts button[aria-checked='true'] { background: var(--linen); color: var(--ink); }
.quality-opts button:disabled { cursor: default; opacity: .5; }
.quality-note { color: var(--dust); font-size: 13px; }
@media (min-width: 820px) { .quality { padding: 14px 28px 0; } }

/* ---------- Destaque de evento ---------- */
.hl-wrap { display: grid; gap: 12px; margin-bottom: 18px; }
.hl {
  display: grid; grid-template-columns: 68px 1fr; gap: 14px 16px; align-items: center;
  padding: 16px; border: 1px solid var(--pew-2); border-radius: var(--r-lg); background: var(--nave);
}
.hl-date {
  display: grid; justify-items: center; align-content: center; width: 68px; height: 76px;
  border-radius: 12px; background: var(--linen); color: var(--ink); overflow: hidden;
}
.hl-mon { font-size: 13px; font-weight: 800; color: var(--rec); text-transform: lowercase; }
.hl-day { margin-top: -2px; font-size: 38px; line-height: 1; font-weight: 800; font-stretch: var(--cond); }
.hl-body { min-width: 0; }
.hl-when { margin: 0; color: var(--dust); font-size: 13px; font-weight: 600; }
.hl-when.rec { margin: 0; color: var(--linen); letter-spacing: 0; }
.hl-title { margin: 2px 0 4px; font-size: clamp(24px, 6.5vw, 32px); line-height: 1.02; font-weight: 800; font-stretch: var(--cond); overflow-wrap: anywhere; }
.hl-folder { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--dust); font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.hl-folder svg { width: 14px; height: 14px; flex: none; }
.hl-actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.hl-actions .btn { flex: 1; }
.hl-edit { margin-left: auto; flex: none; width: 36px; height: 36px; border: 1px solid var(--pew-2); }
@media (min-width: 720px) {
  .hl { grid-template-columns: 68px 1fr auto; }
  .hl-actions { grid-column: auto; }
  .hl-actions .btn { flex: none; }
}
.hl-add {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 8px 14px;
  border: 1px dashed var(--pew-2); border-radius: 999px; background: none; color: var(--dust); font-weight: 600; font-size: 14px; cursor: pointer;
}
.hl-add:hover { color: var(--linen); border-color: var(--linen); }
.hl-add svg { width: 16px; height: 16px; }
.hl-chips { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.chip-hl {
  flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--pew-2); border-radius: 999px; background: var(--nave); cursor: pointer; font-weight: 700; font-size: 14px;
}
.chip-hl svg { width: 16px; height: 16px; color: var(--rec); }
.chip-hl small { color: var(--dust); font-weight: 500; }
.chip-hl:hover { border-color: var(--linen); }
.dest-sm { padding: 10px 14px; border-radius: var(--r-md); }
.seg-opts-2 { grid-template-columns: 1fr 1fr; }
.hl-mode { margin-bottom: 12px; }
.hl-new { display: grid; gap: 12px; margin-bottom: 4px; }
.hl-preview { margin: 0; padding: 10px 12px; border-left: 3px solid var(--linen); background: var(--ink); color: var(--dust); font-size: 14px; overflow-wrap: anywhere; }
.hl-preview strong { color: var(--linen); }
#hl-dlg form { display: grid; gap: 12px; }
#hl-dlg .confirm-text, #hl-dlg .field, #hl-dlg .seg-pick { margin: 0; }
#hl-dlg { max-height: 92dvh; overflow-y: auto; }
.dest-sm > svg { width: 22px; height: 22px; }
.dest-sm .dest-text strong { font-size: 15px; }

/* ---------- Pedidos de acesso (admin) ---------- */
.pending-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px;
  padding: 10px 10px 10px 16px; border: 1px solid var(--pew-2); border-radius: 999px; background: var(--nave);
}
.pending-bar .rec { margin: 0; font-size: 14px; letter-spacing: 0; min-width: 0; }

/* ---------- Níveis de acesso ---------- */
.roles { display: grid; gap: 8px; margin-bottom: 18px; }
.role-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--pew-2); border-radius: var(--r-md); cursor: pointer; }
.role-opt:has(input:checked) { border-color: var(--linen); background: var(--pew); }
.role-opt input { margin-top: 3px; width: 18px; height: 18px; accent-color: #fff; flex: none; }
.role-opt span { display: grid; gap: 2px; }
.role-opt small { color: var(--dust); font-size: 13px; line-height: 1.35; }
.role-midia { background: #cfcfcf; }
.role-visitante { background: var(--pew-2); color: var(--linen); }
.acc-state { font-style: normal; font-size: 13px; color: var(--dust); }
.acc-state.on { color: var(--linen); }
.acc-state.on::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--rec); vertical-align: 1px; }
html.no-tabs .app { padding-bottom: 0; }

/* ---------- Armazenamento ---------- */
.storage-sheet { max-width: 520px; }
.sto-body { padding: 8px 20px calc(20px + var(--safe-b)); overflow-y: auto; }
.sto-loading { color: var(--dust); padding: 24px 0; }
.sto-hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.sto-big { font-size: clamp(48px, 14vw, 72px); font-weight: 800; font-stretch: var(--cond); letter-spacing: -.02em; line-height: 1; }
.sto-of { color: var(--dust); font-size: 17px; }
.sto-warn { margin: 12px 0 0; }
.sto-bar { display: flex; height: 18px; margin: 18px 0 10px; border-radius: 4px; overflow: hidden; background: var(--ink); border: 1px solid var(--pew-2); }
.sto-bar span { min-width: 2px; height: 100%; }
.sto-bar span + span { border-left: 2px solid var(--ink); }
.sto-used { margin: 0; color: var(--dust); font-size: 14px; }
.sto-est { margin: 14px 0 0; padding: 10px 14px; border-left: 3px solid var(--linen); background: var(--nave); font-size: 14px; }
.sto-list { list-style: none; margin: 18px 0 0; padding: 0; }
.sto-list li { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--pew); }
.sto-list li[data-folder], .sto-list li[data-trash] { cursor: pointer; }
.sto-list li[data-folder]:hover, .sto-list li[data-trash]:hover { background: var(--pew); }
.sw { width: 14px; height: 14px; border-radius: 3px; }
.sw-trash { background: repeating-linear-gradient(45deg, #777 0 3px, #2a2a2a 3px 6px); }
.sw-free { border: 1px solid var(--pew-2); background: var(--ink); }
.sto-name { display: grid; min-width: 0; }
.sto-name strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sto-name small, .sto-size small { color: var(--dust); font-size: 13px; }
.sto-size { display: grid; justify-items: end; }
.sto-size strong { font-size: 15px; white-space: nowrap; }

/* ---------- Detalhes ---------- */
dialog { color: var(--linen); }
dialog::backdrop { background: rgba(0, 0, 0, .78); backdrop-filter: blur(4px); }
.detail {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 0;
  border: 0; background: var(--ink);
}
.detail[open] { animation: rise .22s ease-out; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.detail-inner { position: relative; min-height: 100%; padding-bottom: calc(24px + var(--safe-b)); }
.detail-close {
  position: absolute; z-index: 2; top: calc(10px + var(--safe-t)); right: 10px;
  background: rgba(0, 0, 0, .55);
}
.player { position: relative; background: #000; }
.player video { display: block; width: 100%; max-height: 62vh; aspect-ratio: 16/9; background: #000; }
.player-note { position: absolute; left: 0; right: 0; bottom: 56px; margin: 0; text-align: center; font-size: 14px; color: var(--dust); }
.detail-body { padding: 20px; max-width: 880px; }
.detail-folder { margin: 0; padding: 4px 0; border: 0; background: none; cursor: pointer; color: var(--dust); font-size: 14px; display: flex; align-items: center; gap: 6px; text-align: left; }
.detail-folder:hover { color: var(--linen); }
.detail-folder svg { width: 16px; height: 16px; }
.detail-title { margin: 4px 0 16px; font-size: clamp(24px, 6vw, 34px); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px;
  margin: 26px 0 0;
}
.meta div { padding: 12px 0; border-top: 1px solid var(--nave); min-width: 0; }
.meta dt { font-size: 13px; color: var(--dust); }
.meta dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.meta .wide { grid-column: 1 / -1; }
@media (min-width: 820px) {
  .detail { width: min(1040px, 94vw); height: auto; max-height: 92vh; margin: auto; border-radius: var(--r-lg); background: var(--nave); }
  .detail-inner { min-height: 0; }
  .detail-close { top: 10px; }
  .detail-body { padding: 24px 28px 8px; }
  .meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .meta div { border-top-color: var(--pew); }
}

/* ---------- Confirmação e aviso ---------- */
.confirm {
  width: min(420px, calc(100vw - 32px)); padding: 24px;
  border: 1px solid var(--pew-2); border-radius: var(--r-lg); background: var(--nave);
}
.confirm h3 { margin: 0 0 8px; font-size: 20px; }
.confirm-text { margin: 0 0 16px; color: var(--dust); }
.confirm-actions { flex-wrap: wrap; }
.dup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dup-list li { display: flex; align-items: center; gap: 12px; }
.dup-list img { width: 64px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; flex: none; }
.dup-list span { display: grid; min-width: 0; }
.dup-list strong { color: var(--linen); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dup-list small { font-size: 13px; overflow-wrap: anywhere; }
.dup-more { margin: 10px 0 0; font-size: 14px; }
.confirm .field { margin-bottom: 16px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 22px; text-align: center;
  background: var(--linen); color: var(--ink); font-weight: 600; font-size: 15px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
}
@media (min-width: 820px) { .toast { bottom: 28px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Fotos e arquivos (pasta de troca) ---------- */
.file-ph { display: grid; place-items: center; align-content: center; gap: 6px; color: var(--dust); }
.file-ph svg { width: 34px; height: 34px; }
.file-ph b { font-size: 12px; letter-spacing: .04em; color: var(--linen); }
.card-file .card-title { overflow-wrap: anywhere; }
.file-view { display: grid; place-items: center; width: 100%; aspect-ratio: 16/9; max-height: 62vh; background: var(--ink); }
.file-view[hidden], .player video[hidden] { display: none; }
.file-view img { max-width: 100%; max-height: 100%; object-fit: contain; }
.file-big { display: grid; place-items: center; gap: 10px; color: var(--dust); }
.file-big svg { width: 64px; height: 64px; }
.file-big b { color: var(--linen); font-size: 15px; }
.drop.disabled { opacity: .55; }
.sto-sep { border: 0; border-top: 1px solid var(--pew); margin: 22px 0; }
.sto-disk { font-stretch: var(--cond); font-size: 22px; margin: 0 0 10px; display: flex; align-items: baseline; gap: 10px; }
.sto-disk small { font-size: 13px; font-stretch: 100%; font-weight: 400; color: var(--dust); }
