/* =========================================================================
   PDrop · design system (ver BRAND.md)
   Cores e medidas ficam só nos tokens abaixo; os componentes usam as variáveis.
   ========================================================================= */
:root {
  color-scheme: light;
  /* Marca */
  --brand-1: #4f46e5;           /* índigo */
  --brand-2: #06b6d4;           /* ciano */
  --brand-grad: linear-gradient(135deg, var(--brand-1), var(--brand-2));

  /* Superfícies e texto */
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e4e8f0;
  --border-strong: #cbd2df;

  /* Ação */
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-text: #4338ca;
  --on-accent: #ffffff;
  --focus: color-mix(in srgb, var(--accent) 35%, transparent);

  /* Estados */
  --ok: #059669;
  --warn: #b45309;
  --err: #dc2626;

  /* Forma */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / .06);
  --shadow: 0 1px 2px rgb(15 23 42 / .04), 0 8px 24px -8px rgb(15 23 42 / .12);
  --shadow-lg: 0 24px 60px -12px rgb(15 23 42 / .28);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --topbar-h: 60px;
  --bottom-nav-h: 0px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b0e17;
    --surface: #131826;
    --surface-2: #181e2e;
    --text: #e6e9f2;
    --muted: #8b93a7;
    --border: #232a3b;
    --border-strong: #343d53;
    --accent: #6d68f5;
    --accent-hover: #827df8;
    --accent-soft: #1d1f45;
    --accent-text: #a5a2ff;
    --ok: #34d399;
    --warn: #fbbf24;
    --err: #f87171;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -8px rgb(0 0 0 / .5);
    --shadow-lg: 0 24px 60px -12px rgb(0 0 0 / .7);
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2 { margin: 0 0 12px; letter-spacing: -.02em; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center-text { text-align: center; }
.error { color: var(--err); margin: 0; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.err { color: var(--err); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Ícones do sprite (index.html) */
.i {
  width: 18px; height: 18px; flex: none; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.logo { width: 30px; height: 30px; flex: none; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.brand-lg { font-size: 26px; gap: 10px; }
.brand-lg .logo { width: 42px; height: 42px; }

/* ---------- Formulários ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.row { display: flex; gap: 8px; }
.row > button { flex: none; }

.input-wrap { position: relative; display: flex; }
.input-wrap input { padding-right: 44px; }
.input-wrap .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

.search { position: relative; display: block; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px; }

/* ---------- Botões ---------- */
button {
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-sm); padding: 9px 14px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: background .15s, border-color .15s, color .15s, transform .05s, box-shadow .15s;
}
button:hover { border-color: var(--border-strong); background: var(--surface-2); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.lg { padding: 12px 18px; font-size: 15px; }
button.sm { padding: 6px 11px; font-size: 13px; }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--surface-2); }
button.link { border: 0; background: none; padding: 4px 6px; color: var(--accent-text); font-weight: 600; }
button.link:hover { text-decoration: underline; }
button.link.danger { color: var(--err); }
button:disabled { opacity: .55; cursor: default; transform: none; }

/* Botão só com ícone (ações da lista, fechar, sair…) */
.icon-btn {
  width: 36px; height: 36px; padding: 0; border-color: transparent; background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.icon-btn.danger:hover { color: var(--err); background: color-mix(in srgb, var(--err) 10%, transparent); }
.icon-btn.accent { color: var(--accent-text); }

.chip-btn { padding: 5px 10px; font-size: 13px; border-radius: 99px; color: var(--muted); }
.chip-btn:hover { color: var(--text); }
.chip-btn .i { width: 15px; height: 15px; }

/* ---------- Avisos fixos ---------- */
.alert {
  margin: 0; display: flex; align-items: center; gap: 8px;
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; font-weight: 500;
}
.alert.warn { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.alert.err { background: color-mix(in srgb, var(--err) 10%, var(--surface)); color: var(--err); border: 1px solid color-mix(in srgb, var(--err) 30%, transparent); }
.alert.info { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }

/* Painéis da fila: arquivos irrecuperáveis e arquivos que ainda não chegaram */
.queue-panel { display: grid; gap: 6px; }
.queue-panel > span { color: var(--text); opacity: .85; font-size: 14px; }
.queue-panel ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.queue-panel li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--surface); color: var(--text); border-radius: 8px; padding: 8px 10px; font-size: 14px;
}
.queue-panel li .file-cell { min-width: 0; }
.missing-actions { display: flex; gap: 4px; }

/* ---------- Login ---------- */
/* Tela única: o céu da marca (aurora + chuva) ocupa tudo; a órbita fica à esquerda e o formulário
   flutua à direita num cartão de vidro. Sem divisão em duas metades. */
.login-view {
  position: relative; overflow: hidden; isolation: isolate; min-height: 100dvh; color: #fff;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 440px); grid-template-rows: auto 1fr;
  column-gap: clamp(32px, 6vw, 96px); row-gap: 8px;
  padding: max(32px, env(safe-area-inset-top)) clamp(24px, 6vw, 96px) max(28px, env(safe-area-inset-bottom));
  background: radial-gradient(1100px 700px at 15% 10%, #3730a3 0%, transparent 60%),
              radial-gradient(900px 600px at 95% 100%, rgb(6 182 212 / .45) 0%, transparent 60%), #0b0e17;
}
/* Textura de pontos bem suave por cima do céu */
.login-view::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgb(255 255 255 / .07) 1px, transparent 1px); background-size: 24px 24px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000, transparent 75%);
}
/* Fundo animado (desenhado no app.js) */
.login-view > .brand-rain { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; pointer-events: none; }
.login-header { grid-column: 1; grid-row: 1; }
.login-view .logo use { filter: drop-shadow(0 4px 10px rgb(0 0 0 / .25)); }

/* Lado da marca: órbita no centro e funcionalidades logo abaixo */
.login-brand { grid-column: 1; grid-row: 2; display: grid; place-content: center; justify-items: center; gap: 28px; min-width: 0; }

/* Órbita: 440×440, a gota no centro e dois anéis girando devagar em sentidos opostos */
.orbit-scene { position: relative; width: 440px; height: 440px; max-width: 100%; }
.orbit-scene::before {
  content: ""; position: absolute; inset: 15%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgb(6 182 212 / .3), transparent 65%);
}
.orbit {
  position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 1px dashed rgb(255 255 255 / .16);
  transform: translate(-50%, -50%); animation: orbit-spin 40s linear infinite; pointer-events: none;
}
.orbit.o1 { width: 200px; height: 200px; }
.orbit.o2 { width: 360px; height: 360px; animation-duration: 60s; animation-direction: reverse; border-style: solid; border-color: rgb(255 255 255 / .08); }
/* Um "satélite" brilhante em cada anel */
.orbit::after {
  content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%;
  background: #67e8f9; box-shadow: 0 0 12px 3px rgb(103 232 249 / .6);
}
.orbit.o2::after { background: #a5b4fc; box-shadow: 0 0 12px 3px rgb(165 180 252 / .55); top: auto; bottom: -4px; }
@keyframes orbit-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.drop-core {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center; z-index: 2;
  background: radial-gradient(circle at 35% 30%, rgb(255 255 255 / .22), rgb(255 255 255 / .06));
  border: 1px solid rgb(255 255 255 / .22); box-shadow: 0 20px 60px -10px rgb(6 182 212 / .5), inset 0 1px 0 rgb(255 255 255 / .25);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: core-pulse 1.5s ease-out infinite;
}
.drop-core .logo { width: 70px; height: 70px; }
.ripple {
  position: absolute; inset: -2px; border-radius: 50%; border: 2px solid rgb(103 232 249 / .55);
  animation: ripple 1.5s ease-out infinite; pointer-events: none;
}
.ripple.r2 { animation-delay: .35s; border-color: rgb(165 180 252 / .45); }
.fly {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 6px; border-radius: 12px;
  font-size: 14px; font-weight: 600; white-space: nowrap; color: #fff;
  background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 10px 24px -12px rgb(0 0 0 / .5);
  opacity: 0; animation: fly 6s cubic-bezier(.45, .05, .4, 1) infinite; animation-delay: var(--d);
}
.fly .file-icon { --c: inherit; background: var(--c); color: #fff; width: 28px; height: 28px; border-radius: 8px; }
.fly .file-icon .i { width: 15px; height: 15px; }
/* Espiral: começa num canto (--sx/--sy), passa pelo meio do caminho girado 90° (--mx/--my) e cai no centro */
@keyframes fly {
  0% { transform: translate(-50%, -50%) translate(var(--sx), var(--sy)) scale(1); opacity: 0; }
  12% { opacity: 1; }
  55% { transform: translate(-50%, -50%) translate(var(--mx), var(--my)) scale(.85); opacity: 1; }
  80% { transform: translate(-50%, -50%) scale(.25); opacity: .8; }
  84%, 100% { transform: translate(-50%, -50%) scale(.1); opacity: 0; }
}
@keyframes ripple {
  0% { transform: scale(1); opacity: .9; }
  100% { transform: scale(1.75); opacity: 0; }
}
@keyframes core-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  12% { transform: translate(-50%, -50%) scale(1.06); }
}

/* Funcionalidades em carrossel */
.feature-reel { display: grid; gap: 14px; width: min(420px, 100%); }
.reel { list-style: none; margin: 0; padding: 0; position: relative; height: 78px; }
.reel > li {
  position: absolute; inset: 0; display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 16px; background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(16px); transition: opacity .5s, transform .5s cubic-bezier(.2, .8, .2, 1);
}
.reel > li.active { opacity: 1; transform: none; }
.reel > li.leaving { opacity: 0; transform: translateY(-16px); }
.reel > li div { display: grid; gap: 2px; min-width: 0; }
.reel strong { font-size: 15px; }
.reel li div > span { font-size: 13.5px; color: rgb(255 255 255 / .75); }
.reel-icon {
  width: 46px; height: 46px; flex: none; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgb(255 255 255 / .26), rgb(255 255 255 / .06)); color: #fff;
}
.reel .reel-icon .i { width: 22px; height: 22px; }
.reel > li.active .reel-icon .i { animation: pop .5s ease-out; }
.reel-dots { display: flex; justify-content: center; gap: 6px; }
.reel-dots span { width: 6px; height: 6px; border-radius: 3px; background: rgb(255 255 255 / .3); overflow: hidden; transition: width .3s; }
.reel-dots span.active { width: 26px; }
.reel-dots span.active::after {
  content: ""; display: block; height: 100%; background: #fff; border-radius: 3px;
  animation: reel-progress 4s linear forwards;
}
@keyframes reel-progress { from { width: 0; } to { width: 100%; } }
/* Telas baixas: a órbita encolhe e, se não couber, some (fica só o carrossel) */
@media (max-height: 820px) { .orbit-scene { zoom: .8; } }
@media (max-height: 640px) { .orbit-scene { display: none; } }

/* Formulário: cartão de vidro flutuando sobre o céu, com o rodapé logo abaixo */
.login-panel { grid-column: 2; grid-row: 1 / 3; display: grid; align-content: center; gap: 18px; min-width: 0; }
.login {
  width: 100%; display: grid; gap: 20px; padding: 36px 34px 32px; border-radius: 24px; color: var(--text);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 60%, rgb(255 255 255 / .25));
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / .6), inset 0 1px 0 rgb(255 255 255 / .1);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
.login-title { margin-bottom: 2px; }
.login h1 { font-size: clamp(26px, 2.4vw, 30px); margin: 0; }
.login p { margin: 0; }
.login label { font-size: 14px; color: var(--text); }

/* Campo com ícone à esquerda */
.field { position: relative; display: flex; }
.field > .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; transition: color .15s; }
.field input { height: 50px; padding-left: 44px; font-size: 15px; border-radius: 10px; background: var(--surface); }
.field:focus-within > .i { color: var(--accent); }
.field .icon-btn { right: 6px; }
.field-hint { font-size: 13px; font-weight: 600; }

.login-submit { height: 52px; font-size: 16px; border-radius: 10px; gap: 8px; margin-top: 4px; }
.login-submit .i { transition: transform .2s; }
.login-submit:hover .i { transform: translateX(3px); }
.login-help {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; color: var(--muted);
}
.login-help .i { flex: none; width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.login-foot { width: 100%; display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 0 6px; }
.login-view .login-foot { color: rgb(255 255 255 / .6); }
.login-foot span { display: inline-flex; align-items: center; gap: 6px; }
.login-foot .i { width: 14px; height: 14px; color: var(--ok); }

/* ---------- Topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 20px;
  min-height: var(--topbar-h); padding: 10px 20px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
}
.tabs { display: flex; gap: 4px; flex: 1; }
.tab {
  border: 0; background: none; color: var(--muted); padding: 8px 12px; font-weight: 600; position: relative;
}
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.active { background: var(--accent-soft); color: var(--accent-text); }
.me { display: flex; align-items: center; gap: 10px; }
.me-id { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.me-name { font-size: 14px; font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  --h: 230;
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; letter-spacing: 0;
  color: hsl(var(--h) 60% 35%); background: hsl(var(--h) 85% 92%);
}
@media (prefers-color-scheme: dark) {
  .avatar { color: hsl(var(--h) 85% 80%); background: hsl(var(--h) 40% 22%); }
}
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }

.count {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--accent); color: #fff; font-size: 11.5px; line-height: 20px; text-align: center; font-weight: 700;
}

/* ---------- Conteúdo ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 56px; display: grid; gap: 20px; align-content: start; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.card-head { margin-bottom: 16px; }
.card-head h2 { margin-bottom: 2px; }
.card-head p { margin: 0; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }

/* ---------- Área de envio ---------- */
.dropzone {
  position: relative; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 200px at 50% 0%, color-mix(in srgb, var(--brand-1) 6%, transparent), transparent 70%),
    var(--surface);
  padding: 44px 20px 36px; text-align: center; cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .2s;
}
.dropzone p { margin: 4px 0; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.over { border-color: var(--accent); background-color: var(--accent-soft); outline: none; }
.dropzone:hover .drop-icon { transform: translateY(-3px); }
.drop-icon {
  width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center;
  background: var(--brand-grad); color: #fff; box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--brand-1) 70%, transparent);
  transition: transform .2s;
}
.drop-icon .i { width: 28px; height: 28px; }
.drop-title { font-size: 17px; font-weight: 700; }
.link-text { color: var(--accent-text); font-weight: 600; }
.drop-features { list-style: none; margin: 18px 0 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); }
.drop-features li { display: inline-flex; align-items: center; gap: 6px; }
.drop-features .i { width: 15px; height: 15px; color: var(--ok); }

.drag-overlay {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--brand-1) 22%, transparent); backdrop-filter: blur(3px);
  border: 3px dashed var(--accent); animation: fade .15s ease-out;
}
.drag-card {
  display: grid; justify-items: center; gap: 8px; padding: 28px 40px; border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-lg); font-weight: 700; font-size: 17px;
}
.drag-card p { margin: 0; }
.drag-card .i { width: 36px; height: 36px; color: var(--accent); animation: bob 1s ease-in-out infinite; }

/* ---------- Fila de envio ---------- */
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.queue:empty { display: none; }
.queue li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; display: grid; gap: 8px; box-shadow: var(--shadow-sm); animation: rise .2s ease-out;
}
.queue .q-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.queue .q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.queue .q-top > span:last-child { font-size: 13px; text-align: right; flex: none; max-width: 60%; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.bar > span { display: block; height: 100%; width: 0; background: var(--brand-grad); border-radius: 3px; transition: width .2s; }

/* ---------- Lista de arquivos ---------- */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.list-head h2 { margin: 0; }
.count-text { font-weight: 500; font-size: 14px; }
.list-tools { display: flex; gap: 8px; }
.list-tools .search { width: 230px; }
.list-tools select { width: auto; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.name { white-space: normal; min-width: 220px; }
td.actions { text-align: right; }
.actions-wrap { display: inline-flex; gap: 2px; }
.actions-wrap .icon-btn { width: 34px; height: 34px; }

.file-cell { display: flex; align-items: center; gap: 12px; }
.file-cell .file-name { font-weight: 600; word-break: break-word; }
.file-cell .file-sub { display: none; font-size: 12.5px; color: var(--muted); }
.file-icon {
  --c: var(--muted);
  width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent);
}
.file-icon .i { width: 18px; height: 18px; }
.file-icon.sm { width: 30px; height: 30px; border-radius: 8px; }
.file-icon.sm .i { width: 16px; height: 16px; }
.kind-image { --c: #db2777; }
.kind-video { --c: #9333ea; }
.kind-audio { --c: #ea580c; }
.kind-pdf { --c: #dc2626; }
.kind-doc { --c: #2563eb; }
.kind-sheet { --c: #16a34a; }
.kind-slides { --c: #d97706; }
.kind-archive { --c: #a16207; }
.kind-code { --c: #0891b2; }
@media (prefers-color-scheme: dark) {
  .kind-image { --c: #f472b6; } .kind-video { --c: #c084fc; } .kind-audio { --c: #fb923c; }
  .kind-pdf { --c: #f87171; } .kind-doc { --c: #60a5fa; } .kind-sheet { --c: #4ade80; }
  .kind-slides { --c: #fbbf24; } .kind-archive { --c: #facc15; } .kind-code { --c: #22d3ee; }
}

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.badge .i { width: 13px; height: 13px; }
.badge.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); border-color: transparent; }
.badge.err { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.format-tag { font-size: 12px; font-weight: 600; color: var(--muted); }
#create-msg { margin: 0 0 14px; white-space: pre-line; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }

/* Estado vazio */
.empty { padding: 40px 20px; text-align: center; margin: 0; display: grid; justify-items: center; gap: 4px; }
.empty p { margin: 0; }
.empty.sm { padding: 28px 16px; }
.empty-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 8px;
  background: var(--accent-soft); color: var(--accent-text);
}
.empty-icon .i { width: 24px; height: 24px; }
.empty-title { font-weight: 700; font-size: 16px; }

/* Carregando */
.skeleton td { padding: 14px; }
.skeleton span {
  display: block; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

/* ---------- Janelas ---------- */
.share-dialog {
  width: min(460px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); padding: 22px; box-shadow: var(--shadow-lg);
}
.share-dialog[open] { animation: pop .18s ease-out; }
.share-dialog::backdrop { background: rgb(15 23 42 / .5); backdrop-filter: blur(2px); }
.share-dialog > * + * { margin-top: 14px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px -6px 0 0; }
.dialog-head h2 { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.share-name { margin: 0; font-weight: 600; word-break: break-word; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-actions.end { justify-content: flex-end; }
#share-link { font-size: 13px; color: var(--muted); }
#share-msg, #google-msg { margin: 8px 0 0; min-height: 1.5em; font-size: 14px; }
#google-body p { margin: 0 0 10px; }

/* ---------- Avisos rápidos ---------- */
.toast {
  position: fixed; right: 16px; bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--bottom-nav-h)); z-index: 40;
  max-width: min(380px, calc(100vw - 32px)); padding: 12px 16px 12px 14px; border-radius: var(--radius);
  display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); animation: rise .2s ease-out;
}
.toast .i { width: 18px; height: 18px; }
.toast.ok { background: var(--ok); color: #fff; }
.toast.err { background: var(--err); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }
@media (prefers-color-scheme: dark) {
  .toast.ok, .toast.warn { color: #0b0e17; }
}

/* ---------- Google Drive ---------- */
.google-btn { font-size: 13px; padding: 6px 12px; border-radius: 99px; }
.google-btn.connected { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 8%, transparent); }

/* ---------- Chat ---------- */
/* Com o chat aberto, a página ocupa exatamente a tela e só as listas rolam */
#app-view:has(#chat-view:not([hidden])) { height: 100dvh; display: flex; flex-direction: column; padding-bottom: var(--bottom-nav-h); }
.chat-view {
  display: grid; grid-template-columns: 320px 1fr; gap: 16px;
  width: 100%; max-width: 1180px; margin: 0 auto; padding: 20px;
  flex: 1; min-height: 0;
}
.chat-list, .chat-pane {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  min-height: 0; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-sm);
}
.chat-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px; border-bottom: 1px solid var(--border); }
.chat-list-head h2 { margin: 0; }
.conv-list, .pick-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.conv-list { padding: 6px; display: grid; gap: 2px; align-content: start; }
.conv {
  width: 100%; text-align: left; border: 0; border-radius: var(--radius); font-weight: 400;
  background: none; padding: 10px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; justify-content: stretch;
}
.conv:hover { background: var(--surface-2); }
.conv.active { background: var(--accent-soft); }
.conv-text { display: grid; gap: 1px; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.conv-name, .conv-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-name { font-weight: 600; }
.conv-last { font-size: 13px; }
.conv.unread .conv-name, .conv.unread .conv-last { font-weight: 700; color: var(--text); }

.chat-empty { margin: auto; }
.chat-thread { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chat-head-text { min-width: 0; }
.chat-head .muted { font-size: 13px; }
.chat-back { display: none; margin-left: -8px; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 8px;
  background: var(--surface-2);
}
.chat-loading { margin: auto; }

/* Linha da mensagem: foto de quem enviou + balão (os meus à direita, foto do lado direito) */
.msg-row { display: flex; align-items: flex-start; gap: 8px; max-width: min(82%, 580px); align-self: flex-start; min-width: 0; }
.msg-row.mine { flex-direction: row-reverse; align-self: flex-end; }
.msg-row.first:not(:first-child) { margin-top: 8px; }
.msg-avatar, .msg-avatar-space { width: 32px; height: 32px; flex: none; }
.msg-avatar { font-size: 12px; margin-top: 2px; }
.msg {
  min-width: 0; display: grid; gap: 6px; animation: rise .15s ease-out;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 9px 13px;
  box-shadow: var(--shadow-sm);
}
/* A "ponta" do balão aponta para a foto, só na primeira mensagem da sequência */
.msg-row.first .msg { border-top-left-radius: 4px; }
.msg.mine { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.msg-row.first .msg.mine { border-top-left-radius: 16px; border-top-right-radius: 4px; }
.msg.mine .msg-time { color: rgb(255 255 255 / .75); }
.msg.mine .msg-file { background: rgb(255 255 255 / .14); border-color: rgb(255 255 255 / .2); }
.msg.mine .msg-file-meta, .msg.mine .muted { color: rgb(255 255 255 / .8); }
.msg.mine .file-icon { --c: #fff; }
.msg.mine button.link { color: #fff; }
.msg-body { margin: 0; white-space: pre-wrap; word-break: break-word; }
.msg-time { font-size: 11px; color: var(--muted); justify-self: end; }
.msg-removed { margin: 0; font-style: italic; }
.msg-file {
  display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; padding: 8px 10px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.msg-file .file-icon { grid-row: span 3; }
.msg-file-name { font-weight: 600; word-break: break-word; font-size: 14px; }
.msg-file-meta { font-size: 12px; color: var(--muted); }
.msg-file-actions { display: flex; gap: 4px; margin-left: -6px; }
.msg-file-actions button.link { font-size: 13px; }

.chat-uploads { padding: 8px 14px 0; }
.chat-uploads:empty, .chat-selected:empty { display: none; }
.chat-selected { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  background: var(--accent-soft); color: var(--accent-text); border-radius: 99px; padding: 3px 4px 3px 11px; font-size: 13px; font-weight: 600;
}
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-x { border: 0; background: none; color: inherit; padding: 0 6px; font-size: 16px; line-height: 1; }
.chip-x:hover { background: none; }

.chat-form {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 14px;
  border-top: 1px solid var(--border); padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.chat-attach { grid-column: 1 / -1; display: flex; gap: 6px; }
.chat-form textarea {
  font: inherit; color: inherit; resize: none; min-height: 44px; max-height: 160px; overflow-y: hidden;
  padding: 11px 14px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s;
}
.send-btn { align-self: end; width: 44px; height: 44px; padding: 0; border-radius: 50%; }

.pick-list { max-height: 50vh; border: 1px solid var(--border); border-radius: var(--radius); }
.pick-list > li { border-bottom: 1px solid var(--border); }
.pick-list > li:last-child { border-bottom: 0; }
.pick-list > li.muted { padding: 14px; text-align: center; }
.contact {
  width: 100%; border: 0; border-radius: 0; background: none; text-align: left; padding: 10px 12px;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; justify-content: stretch; font-weight: 400;
}
.contact:hover { background: var(--accent-soft); }
.contact-text { display: grid; min-width: 0; }
.contact-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-text .muted { font-size: 13px; }
.saved-item {
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px;
  color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer;
}
.saved-item:hover { background: var(--surface-2); }
.saved-item:has(input:checked) { background: var(--accent-soft); }
.saved-item input { width: 18px; height: 18px; accent-color: var(--accent); }
.saved-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Animações ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
@keyframes fade { from { opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-4px); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Toque (celular) ---------- */
@media (pointer: coarse) {
  button.link { padding: 8px 10px; }
  .icon-btn, .actions-wrap .icon-btn { width: 40px; height: 40px; }
}

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
  /* Sem a órbita: logo no topo e o cartão centralizado sobre o mesmo céu animado */
  .login-view { grid-template-columns: minmax(0, 440px); grid-template-rows: auto 1fr; justify-content: center; row-gap: 28px; padding-inline: 16px; }
  .login-header { justify-self: center; }
  .login-brand { display: none; }
  .login-panel { grid-column: 1; grid-row: 2; align-content: start; }
}

/* ---------- Celular ---------- */
@media (max-width: 760px) {
  :root { --bottom-nav-h: calc(64px + env(safe-area-inset-bottom)); }
  /* Sem backdrop-filter aqui: ele faria a barra de abas (fixa) se prender ao topo em vez da tela */
  .topbar {
    padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); gap: 10px; min-height: 54px;
    background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .topbar .brand { flex: 1; }
  .me-name { display: none; }

  /* Abas viram barra inferior, como num app */
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; flex: none; gap: 0;
    height: var(--bottom-nav-h); padding: 6px 8px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
    border-top: 1px solid var(--border);
  }
  .tab { flex: 1; flex-direction: column; gap: 2px; font-size: 11.5px; padding: 6px 4px; border-radius: var(--radius); }
  .tab .i { width: 22px; height: 22px; }
  .tab.active { background: none; }
  .tab.active .i { color: var(--accent); }
  .tab .count { position: absolute; top: 2px; left: calc(50% + 6px); }
  #app-view { padding-bottom: var(--bottom-nav-h); }

  .container { padding: 16px 14px 32px; gap: 16px; }
  .dropzone { padding: 26px 16px 22px; }
  .drop-icon { width: 52px; height: 52px; border-radius: 16px; margin-bottom: 10px; }
  .list-tools { width: 100%; }
  .list-tools .search { flex: 1; width: auto; }

  /* Tabela de arquivos vira lista de cartões */
  .files-table thead { display: none; }
  .files-table, .files-table tbody { display: block; }
  .files-table tr { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px; padding: 12px 10px 12px 14px; border-bottom: 1px solid var(--border); }
  .files-table tr:last-child { border-bottom: 0; }
  .files-table td { display: none; padding: 0; border: 0; }
  .files-table td.name, .files-table td.actions { display: block; }
  .files-table td.name { min-width: 0; }
  .file-cell > div { min-width: 0; }
  .file-cell .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .file-cell .file-sub { display: block; }
  .actions-wrap { flex-wrap: nowrap; }
  .actions-wrap .icon-btn:not(.keep) { display: none; }
  .files-table td.actions .more { display: inline-flex; }

  .users-table th:nth-child(4), .users-table td:nth-child(4),
  .users-table th:nth-child(5), .users-table td:nth-child(5) { display: none; }

  .chat-view { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .chat-list, .chat-pane { border-radius: 0; border: 0; box-shadow: none; }
  .chat-view .chat-pane { display: none; }
  .chat-view.thread-open .chat-list { display: none; }
  .chat-view.thread-open .chat-pane { display: flex; }
  .chat-back { display: inline-flex; }
  .msg-row { max-width: 92%; }
  .msg-avatar, .msg-avatar-space { width: 28px; height: 28px; }
}
.more { display: none; }

/* Textos diferentes para mouse e toque */
.touch-only { display: none; }
@media (pointer: coarse) {
  .touch-only { display: inline; }
  .mouse-only { display: none; }
}

/* Menu de ações do arquivo no celular */
.action-sheet .sheet-file { display: flex; align-items: center; gap: 12px; }
.action-sheet .sheet-file strong { word-break: break-word; }
.sheet-actions { display: grid; gap: 4px; }
.sheet-actions button { justify-content: flex-start; border-color: transparent; background: none; padding: 12px; font-size: 15px; }
.sheet-actions button:hover { background: var(--surface-2); }
.sheet-actions button.danger { color: var(--err); }
@media (max-width: 760px) {
  .action-sheet { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
}

/* ---------- Perfis, papéis, equipe, grupos e convites ---------- */
/* Avatar com foto (cai nas iniciais quando não há foto) */
.avatar.has-photo { background: var(--surface-2); overflow: hidden; }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.avatar.xl { width: 96px; height: 96px; font-size: 32px; }
/* Grupo: cantos arredondados em vez de círculo, para diferenciar de pessoa */
.avatar.group { border-radius: 30%; }

/* Selo do Gerente: tom ciano da marca (Admin usa .badge.accent, Comum o .badge padrão) */
.badge.manager { background: color-mix(in srgb, var(--brand-2) 14%, transparent); color: color-mix(in srgb, var(--brand-2) 70%, var(--text)); border-color: transparent; }

/* Botão do perfil no topo */
button.me-id { background: none; border: 1px solid transparent; padding: 4px 10px 4px 4px; border-radius: 99px; color: var(--text); cursor: pointer; }
button.me-id:hover, button.me-id.active { background: var(--surface-2); border-color: var(--border); }

/* Meu perfil */
.profile-card { display: grid; gap: 18px; }
.profile-top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-photo { display: grid; justify-items: center; gap: 10px; }
.profile-photo-actions { display: flex; gap: 6px; }
.profile-id { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.profile-id h2 { margin: 0; font-size: 22px; }
.profile-id p { margin: 0; }
.grid .span-2 { grid-column: 1 / -1; }
.grid textarea {
  font: inherit; color: inherit; resize: vertical; min-height: 80px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
input[readonly] { background: var(--surface-2); color: var(--muted); }

/* Equipe */
.person-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-text { display: grid; min-width: 0; }
.person-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.small { font-size: 12.5px; }
.role-select { width: auto; padding: 5px 8px; font-size: 13px; }
.invite-result {
  display: grid; gap: 10px; padding: 14px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ok) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent);
}
.invite-result p { margin: 0; }
#invite-msg { margin: 0; }
.invites-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.invite-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.invite-item .person-text { flex: 1; }

/* Contatos e grupos: linha com avatar, texto e itens extras (selo, remover) */
.contact { display: flex; }
.contact .contact-text { flex: 1; }
.contact.pick { cursor: pointer; }
.contact.pick input { width: auto; }
.contact.pick:has(input:checked) { background: var(--accent-soft); }
#group-new { justify-self: start; }
#group-members:empty { display: none; }
#group-members, #group-candidates { max-height: 32vh; }
.danger-btn { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, transparent); background: none; margin-right: auto; }

/* Autor da mensagem em grupos */
.msg-author { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--accent-text); }

/* Aceitar convite: cartão sobre o fundo noturno da marca, com ondas saindo do centro */
.invite-view {
  position: relative; overflow: hidden; min-height: 100dvh; display: grid; place-items: center;
  padding: max(32px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
  background: radial-gradient(900px 500px at 0% 0%, rgb(79 70 229 / .55), transparent 60%),
              radial-gradient(800px 500px at 100% 100%, rgb(6 182 212 / .35), transparent 60%), #0b0e17;
}
.invite-ripples { position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; transform: translate(-50%, -50%); pointer-events: none; }
.invite-ripples span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgb(103 232 249 / .35); animation: invite-ripple 4.5s ease-out infinite; }
.invite-ripples span:nth-child(2) { animation-delay: 1.5s; border-color: rgb(165 180 252 / .3); }
.invite-ripples span:nth-child(3) { animation-delay: 3s; }
@keyframes invite-ripple { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }
.accept-card { position: relative; width: min(480px, 100%); display: grid; gap: 18px; padding: 32px; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.accept-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.accept-body { display: grid; gap: 16px; }
.accept-body .login-title h1 { font-size: clamp(24px, 3vw, 30px); }
.accept-body label { color: var(--text); font-size: 14px; }
.accept-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.accept-pair input { height: 50px; border-radius: 10px; }
#accept-login { justify-self: center; font-weight: 600; }
@media (max-width: 480px) {
  .login { padding: 28px 22px 24px; border-radius: 20px; }
  .accept-card { padding: 24px 20px; }
  .accept-pair { grid-template-columns: 1fr; }
}

/* Equipe: convite compacto (e-mail, perfil e botão na mesma linha) */
.invite-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.invite-row .invite-email { flex: 1 1 260px; }
.invite-row > label:not(.invite-email) { flex: 0 1 170px; }
.invite-row > button { height: 42px; flex: none; }
.more-fields { margin-top: 14px; }
.more-fields > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent-text); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.more-fields > summary::-webkit-details-marker { display: none; }
.more-fields > summary::before { content: "+"; font-size: 16px; line-height: 1; width: 18px; text-align: center; }
.more-fields[open] > summary::before { content: "–"; }
.more-fields > summary .muted { font-weight: 500; }
.more-fields .grid { margin: 12px 0 0; }
#invite-form .invite-result, #invite-form #invite-msg { margin-top: 14px; }

/* Cartão recolhível ("Criar acesso direto") */
.collapse-card { padding: 0; }
.collapse-card > details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; margin: 0; }
.collapse-card > details > summary::-webkit-details-marker { display: none; }
.collapse-card .summary-text { display: grid; gap: 2px; }
.collapse-card .summary-text h2 { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-size: 16px; }
.collapse-card .chevron { color: var(--muted); transform: rotate(-90deg); transition: transform .2s; }
.collapse-card details[open] .chevron { transform: rotate(90deg); }
.collapse-card details > :not(summary) { margin-left: 22px; margin-right: 22px; }
.collapse-card details > :last-child { margin-bottom: 22px; }
.collapse-card summary:hover h2 { color: var(--accent-text); }

/* Meu perfil: faixa da marca atrás da foto */
.profile-card { position: relative; overflow: hidden; padding-top: 0; }
.profile-card::before {
  content: ""; display: block; height: 96px; margin: 0 -22px;
  background: radial-gradient(400px 120px at 80% 0%, rgb(255 255 255 / .18), transparent 70%), var(--brand-grad);
}
.profile-card .profile-top { margin-top: -52px; align-items: flex-end; }
.profile-card .avatar.xl { box-shadow: 0 0 0 4px var(--surface), var(--shadow); }
.profile-card .profile-id { padding-bottom: 6px; }
.profile-card > button[type="submit"] { justify-self: start; }
#profile-msg:empty, #password-msg:empty { display: none; }

/* Fila: saídas para um arquivo que está esperando nova tentativa */
.queue .q-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; margin-top: 2px; }
/* Botões-pílula: "Tentar agora" na cor da marca, "Remover da fila" discreto (vermelho só no hover) */
.queue .q-actions button.link {
  padding: 5px 12px; border-radius: 99px; font-size: 13px; text-decoration: none;
  background: var(--accent-soft); color: var(--accent-text); border: 1px solid transparent;
}
.queue .q-actions button.link:hover { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); text-decoration: none; }
.queue .q-actions button.link.danger { background: transparent; color: var(--muted); border-color: var(--border); }
.queue .q-actions button.link.danger:hover { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); background: color-mix(in srgb, var(--err) 8%, transparent); }
@media (pointer: coarse) { .queue .q-actions button.link { padding: 8px 14px; } }

/* Telas bem estreitas (celular pequeno, painel lateral): nada pode rolar para os lados */
@media (max-width: 480px) {
  .topbar { gap: 6px; padding-left: 12px; padding-right: 8px; }
  .topbar .brand { font-size: 17px; min-width: 0; }
  .me { gap: 2px; min-width: 0; }
  /* Botão do Google Drive só com o ícone (o texto completo fica na dica e na janela) */
  .google-btn { font-size: 0; gap: 0; width: 36px; height: 36px; padding: 0; border-radius: 50%; }
  .google-btn .i { width: 18px; height: 18px; }
  button.me-id { padding: 2px; }
  .list-tools { flex-wrap: wrap; }
  .list-tools .search, .list-tools select { flex: 1 1 100%; width: 100%; }
  .queue .q-top { flex-direction: column; align-items: stretch; gap: 4px; }
  .queue .q-top > span:last-child { max-width: none; text-align: left; }
}
