/* ============================================================ Convites — tema (base do FB Ranker)
   Tokens em :root. Tema escuro: automático pelo sistema, ou forçado por data-theme. */
:root {
  --bg: #f5f6fa;
  --bg-accent: radial-gradient(1200px 500px at 10% -10%, rgba(59, 130, 246, .10), transparent 60%),
               radial-gradient(900px 400px at 100% 0%, rgba(139, 92, 246, .08), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f2f4f9;
  --surface-3: #e8ebf3;
  --border: #e3e6ee;
  --border-strong: #d3d8e3;
  --text: #0f1729;
  --text-2: #344054;
  --muted: #667085;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-text: #ffffff;
  --primary-soft: #eaf1ff;
  --link: #2563eb;
  --grad: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --ok: #12813a;   --ok-bg: #e2f6e9;
  --info: #1f5fd6; --info-bg: #e6efff;
  --warn: #9a5b00; --warn-bg: #fff2d9;
  --bad: #c42b2b;  --bad-bg: #fde7e7;
  --gold: #e8a400; --silver: #8d99ab; --bronze: #c2702e;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .16);
  --radius: 14px;
  --radius-sm: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0e14;
    --bg-accent: radial-gradient(1200px 500px at 10% -10%, rgba(59, 130, 246, .12), transparent 60%),
                 radial-gradient(900px 400px at 100% 0%, rgba(139, 92, 246, .10), transparent 60%);
    --surface: #131722;
    --surface-2: #1a1f2c;
    --surface-3: #232938;
    --border: #262c3b;
    --border-strong: #333b4e;
    --text: #e9ecf3;
    --text-2: #c3c9d6;
    --muted: #8a93a8;
    --primary: #3f74f5;
    --primary-hover: #5a88f7;
    --primary-text: #ffffff;
    --primary-soft: #1b2645;
    --link: #7ea6ff;
    --ok: #4fd07f;   --ok-bg: #14301f;
    --info: #7ea6ff; --info-bg: #1a2644;
    --warn: #f3b64b; --warn-bg: #3a2b0e;
    --bad: #ff7272;  --bad-bg: #3e1a1c;
    --gold: #ffc53d; --silver: #b3bccb; --bronze: #e08d4f;
    --shadow-sm: none;
    --shadow: none;
    --shadow-lg: 0 16px 40px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0e14;
  --bg-accent: radial-gradient(1200px 500px at 10% -10%, rgba(59, 130, 246, .12), transparent 60%),
               radial-gradient(900px 400px at 100% 0%, rgba(139, 92, 246, .10), transparent 60%);
  --surface: #131722; --surface-2: #1a1f2c; --surface-3: #232938;
  --border: #262c3b; --border-strong: #333b4e;
  --text: #e9ecf3; --text-2: #c3c9d6; --muted: #8a93a8;
  --primary: #3f74f5; --primary-hover: #5a88f7; --primary-text: #ffffff; --primary-soft: #1b2645; --link: #7ea6ff;
  --ok: #4fd07f; --ok-bg: #14301f; --info: #7ea6ff; --info-bg: #1a2644;
  --warn: #f3b64b; --warn-bg: #3a2b0e; --bad: #ff7272; --bad-bg: #3e1a1c;
  --gold: #ffc53d; --silver: #b3bccb; --bronze: #e08d4f;
  --shadow-sm: none; --shadow: none; --shadow-lg: 0 16px 40px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ============================================================ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  background: var(--bg-accent), var(--bg); background-repeat: no-repeat; background-size: 100% 700px;
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; line-height: 1.25; letter-spacing: -.015em; font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 700; }
p { margin: 0 0 12px; }
b, strong { font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; word-break: break-all; }
.text-bad { color: var(--bad); }
.text-warn { color: var(--warn); }
.text-ok { color: var(--ok); }
.inline { display: inline; }
.note { margin: 14px 0 0; }
::selection { background: var(--primary-soft); }

.wrap { margin: 0 auto; padding: 0 clamp(20px, 2.5vw, 40px); }
main.wrap { padding-top: 24px; padding-bottom: 56px; }

/* ============================================================ topo */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-mark { flex: none; border-radius: 9px; box-shadow: 0 4px 12px -4px rgba(99, 102, 241, .55); }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--muted); padding: 7px 13px; border-radius: 9px; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, color .15s; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--primary); background: var(--primary-soft); }
.nav-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 3px; border-radius: 999px;
  font-size: 11px; font-weight: 700; background: var(--primary); color: var(--primary-text); vertical-align: 1px;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.worker-pill {
  font-size: 12.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); margin-right: 4px;
}
.worker-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.worker-pill.on i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px transparent; } }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); transition: color .15s, background .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

/* ============================================================ cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h1, .card-head h2 { margin-bottom: 2px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { margin-top: 6px; }
.empty { color: var(--muted); text-align: center; padding: 36px 0; margin: 0; display: flex; justify-content: center; align-items: center; gap: 10px; }

/* início */
.url-row { display: flex; gap: 10px; margin-top: 14px; }
.url-field { position: relative; flex: 1; }
.url-field svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.url-row textarea {
  display: block; width: 100%; margin: 0; min-height: 50px; max-height: 240px; resize: none; overflow: hidden;
  padding: 12px 14px 12px 44px; border-radius: 12px; font: inherit; font-size: 16px; line-height: 1.5;
}
.url-row .btn { padding: 0 24px; border-radius: 12px; font-size: 15px; }
.url-row input { display: block; width: 100%; margin: 0; min-height: 50px; padding: 12px 14px 12px 44px; border-radius: 12px; font-size: 16px; }

/* Baixar reels */
.reel-card .url-row { margin-top: 0; }
.reel-card > .muted.small { margin: 10px 0 0; }
.reel-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.reel-list:empty { display: none; }
.reel-list li { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; }
.reel-list .reel-link { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.reel-list .reel-state { flex: none; max-width: 55%; text-align: right; color: var(--muted); }
.reel-list li.is-ok .reel-state { color: var(--ok); font-weight: 600; }
.reel-list li.is-error .reel-state { color: var(--bad); white-space: normal; }
.reel-list li:not(.is-busy) .spinner { display: none; }
.advanced { margin-top: 14px; }
.advanced summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; width: max-content; }
.advanced summary:hover { color: var(--text); }
.advanced .grid-3 { margin-top: 14px; }

/* ============================================================ formulários */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-weight: 400; font-size: 14.5px;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
select:disabled { opacity: .6; }
textarea { font-family: ui-monospace, Consolas, monospace; font-size: 12px; resize: vertical; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; color: var(--text); font-size: 14px; }
label.check input { margin-top: 3px; accent-color: var(--primary); width: 16px; height: 16px; flex: none; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 0 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; margin: 0; flex: 1 1 200px; }
.inline-form select { flex: 0 1 150px; }
.form-card h2 { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }
.form-card h2:first-of-type, .form-card h1 + h2 { margin-top: 0; padding-top: 0; border-top: 0; }
.form-card h1 { margin-bottom: 18px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.two-col > div > .card:last-child { margin-bottom: 0; }

/* ============================================================ botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px;
  padding: 8px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); cursor: pointer;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 14px; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, .nav a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft), 0 0 0 1px var(--primary); }
.btn-primary { background: var(--primary); border-color: transparent; color: var(--primary-text); box-shadow: 0 6px 16px -8px var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--bad); border-color: transparent; color: #fff; }
.btn-danger:hover { background: var(--bad); filter: brightness(1.08); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost-danger { background: transparent; color: var(--bad); border-color: transparent; box-shadow: none; }
.btn-ghost-danger:hover { background: var(--bad-bg); }
.btn-block { width: 100%; }
.btn-lg { min-height: 46px; font-size: 15px; }
.btn-sm { min-height: 28px; padding: 3px 10px; font-size: 12.5px; border-radius: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.card-head .actions { margin-top: 0; }

/* ============================================================ selos e avisos */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; vertical-align: middle; white-space: nowrap; line-height: 1.3; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-bad { color: var(--bad); background: var(--bad-bg); }
.badge-muted { color: var(--muted); background: var(--surface-2); }
h1 .badge { font-size: 12.5px; margin-left: 8px; position: relative; top: -2px; }
.flash { padding: 12px 15px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--bad-bg); color: var(--bad); }
.flash-warn { background: var(--warn-bg); color: var(--warn); }
.flash-info { background: var(--info-bg); color: var(--info); }
.flash a { color: inherit; text-decoration: underline; font-weight: 600; }

/* ============================================================ tabela */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.page-cell a { font-weight: 600; color: var(--text); }
.page-cell a:hover { color: var(--link); }
.page-cell small { display: block; margin-top: 2px; }
.status-cell .btn-sm { display: flex; margin-top: 6px; }
.pager { display: flex; gap: 4px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager a { padding: 5px 11px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.pager a:hover { background: var(--surface-2); text-decoration: none; }
.pager a.active { background: var(--primary); color: var(--primary-text); }
.search input { margin: 0; min-width: 240px; }
.head-tools { display: flex; gap: 8px; align-items: center; }
.icon-btn-sm { width: 28px; height: 28px; border-radius: 8px; vertical-align: middle; position: relative; top: -2px; }
.icon-btn-danger:hover { color: var(--bad); background: var(--bad-bg); border-color: transparent; }

/* seleção em massa */
.check-cell { width: 1%; }
.check-cell input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--primary); cursor: pointer; }
.row-actions { width: 1%; text-align: right; padding-top: 8px !important; padding-bottom: 8px !important; }
.row-actions .icon-btn { width: 32px; height: 32px; border-color: transparent; background: transparent; opacity: .55; }
.table tr:hover .row-actions .icon-btn, .row-actions .icon-btn:focus-visible { opacity: 1; }
.table tbody tr.selected { background: var(--primary-soft); }
.bulk-bar {
  display: none; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px;
  background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); border-radius: var(--radius-sm);
}
.has-selection .bulk-bar { display: flex; }
.bulk-bar strong { font-size: 14px; white-space: nowrap; }
.bulk-tag { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.bulk-tag input { width: auto; flex: 0 1 220px; margin: 0; padding: 7px 11px; }
.bulk-bar .btn { min-height: 36px; }

/* tags */
.tag {
  --c: #64748b; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; line-height: 1.4;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  color: color-mix(in srgb, var(--c) 78%, var(--text)); background: color-mix(in srgb, var(--c) 15%, transparent);
}
.tag small { font-weight: 600; opacity: .7; }
.tag-blue { --c: #3b82f6; } .tag-green { --c: #16a34a; } .tag-amber { --c: #d97706; } .tag-red { --c: #dc2626; }
.tag-purple { --c: #8b5cf6; } .tag-pink { --c: #db2777; } .tag-teal { --c: #0d9488; } .tag-gray { --c: #64748b; }
.tag-list { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.tag-filter { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: -2px 0 16px; }
.tag-filter a { border-radius: 999px; }
.tag-filter a:hover { text-decoration: none; }
.tag-filter .tag { padding: 4px 11px; font-size: 12.5px; border: 1px solid transparent; transition: border-color .15s, box-shadow .15s; }
.tag-filter a:hover .tag { border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.tag-filter a.active .tag { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 25%, transparent); }
.tag-all { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 4px 11px; border: 1px solid var(--border); }
.tag-all.active { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.tag-edit { align-items: center; margin-top: 8px; }
.tag-x { border: 0; background: none; color: inherit; font: inherit; font-size: 14px; line-height: 1; padding: 0 0 0 2px; cursor: pointer; opacity: .6; }
.tag-x:hover { opacity: 1; }
.tag-add input { margin: 0; width: 120px; padding: 2px 10px; font-size: 12.5px; border-radius: 999px; border-style: dashed; }
.tag-add input:focus { width: 180px; border-style: solid; }
.tag-add { display: inline-flex; gap: 6px; align-items: center; }
.tag-add input:not(:placeholder-shown) { width: 180px; border-style: solid; }
.tag-add .tag-add-btn { min-height: 0; padding: 3px 12px; font-size: 12.5px; border-radius: 999px; }
.tag-add input:placeholder-shown + .tag-add-btn { display: none; }
.rename-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.rename-form input { width: auto; flex: 1 1 280px; margin: 0; font-size: 16px; font-weight: 600; }
.rename-form small { flex-basis: 100%; }
.rename-form[hidden] { display: none; }

/* janela de tags */
.dialog {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 0; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgba(8, 11, 18, .55); backdrop-filter: blur(2px); }
.dialog-body { padding: 20px 22px 22px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dialog-head h2 { margin: 0; }
.tag-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border); }
.tag-row input[type=text] { width: auto; flex: 1 1 140px; margin: 0; padding: 7px 11px; }
.tag-row .btn { min-height: 34px; padding: 6px 12px; }
.tag-new { margin-top: 4px; padding-top: 14px; }
.tag-count { min-width: 70px; }
.swatches { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.swatch { margin: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--c); cursor: pointer; position: relative; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 3px; }

/* ============================================================ análise */
.page-ident { display: flex; gap: 14px; align-items: center; min-width: 0; }
.page-ident > div { min-width: 0; }
.page-ident a { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.avatar {
  flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 20px; box-shadow: 0 8px 18px -8px rgba(99, 102, 241, .7);
}
.meta-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 4px; }
.meta-grid div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; min-width: 0; }
.meta-grid span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.meta-grid strong { font-variant-numeric: tabular-nums; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
.progress-line { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; font-size: 14px; color: var(--text-2); }
.spinner { width: 15px; height: 15px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.tabs { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: -10px -22px 18px; padding: 0 22px; }
.tabs > a { padding: 12px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s; }
.tabs > a:hover { color: var(--text); text-decoration: none; }
.tabs > a.active { color: var(--text); border-bottom-color: var(--primary); }
.tabs small { color: var(--muted); font-weight: 600; margin-left: 3px; background: var(--surface-2); padding: 1px 7px; border-radius: 999px; font-size: 11.5px; }
.tabs > a.active small { background: var(--primary-soft); color: var(--primary); }
.sort { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; gap: 2px; align-items: center; padding: 6px; background: var(--surface-2); border-radius: 10px; }
.sort > span { padding: 0 8px 0 6px; font-weight: 500; }
.sort > span, .sort a { flex: none; white-space: nowrap; }
.sort a { padding: 4px 11px; border-radius: 7px; color: var(--muted); font-weight: 600; }
.sort a:hover { color: var(--text); text-decoration: none; }
.sort a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 22px; }
.summary div { background: var(--surface); padding: 12px 16px; }
.summary span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.summary strong { font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.rank-title { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }

.rank-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); gap: 16px; }
.rank-card {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column;
  background: var(--surface); transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.rank-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.thumb { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--surface-2); overflow: hidden; }
.thumb-tall { aspect-ratio: 4 / 5; }
.thumb img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.rank-card:hover .thumb img { transform: scale(1.04); }
.thumb-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); opacity: .7; }
.thumb-empty small { font-size: 12px; }
.rank-pos {
  position: absolute; z-index: 2; top: 10px; left: 10px; min-width: 34px; text-align: center;
  background: rgba(10, 12, 18, .72); backdrop-filter: blur(6px); color: #fff; font-weight: 800; font-size: 13px; padding: 3px 9px; border-radius: 8px;
}
.medal-1 .rank-pos { background: var(--gold); color: #3a2800; }
.medal-2 .rank-pos { background: var(--silver); color: #10151f; }
.medal-3 .rank-pos { background: var(--bronze); color: #2a1404; }
.medal-1 { border-color: color-mix(in srgb, var(--gold) 55%, var(--border)); }
.rank-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.rank-main strong { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.rank-main span { color: var(--muted); font-size: 13px; margin-left: 5px; font-weight: 500; }
.rank-sub { display: flex; gap: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.rank-sub span { display: inline-flex; align-items: center; gap: 5px; }
.rank-sub svg { opacity: .75; }
.caption { font-size: 13px; color: var(--text-2); margin: 4px 0 0; overflow-wrap: anywhere; line-height: 1.5; }
.rank-foot { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.rank-foot a { font-weight: 600; }

.logs summary { cursor: pointer; font-weight: 700; }
.logs ul { list-style: none; margin: 14px 0 0; padding: 0; font-size: 12.5px; font-family: ui-monospace, Consolas, monospace; max-height: 360px; overflow: auto; }
.logs li { padding: 5px 0; border-bottom: 1px dashed var(--border); overflow-wrap: anywhere; color: var(--text-2); }
.logs time { color: var(--muted); margin-right: 8px; }
.log-error { color: var(--bad) !important; }
.log-warn { color: var(--warn) !important; }

/* ============================================================ início: nova análise e páginas */
.new-analysis { position: relative; overflow: hidden; padding: 18px 20px; }
.new-analysis::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); }
.new-analysis .url-row { margin-top: 0; align-items: flex-start; }
.new-analysis .url-field svg { top: 16px; transform: none; }
.new-analysis .url-row .btn { min-height: 50px; }
.new-analysis-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 10px; }
.new-analysis-foot .advanced { margin-top: 0; flex: 1; }
.new-analysis-foot small { padding-top: 1px; white-space: nowrap; }
.new-analysis .flash { margin: 14px 0 0; }
.queue-strip {
  display: flex; align-items: center; gap: 10px; margin: -4px 0 18px; padding: 11px 16px; border-radius: var(--radius-sm);
  background: var(--info-bg); color: var(--info); font-size: 14px; font-weight: 600;
}
.queue-strip:hover { text-decoration: none; filter: brightness(1.04); }
.queue-strip .spinner { border-color: color-mix(in srgb, var(--info) 30%, transparent); border-top-color: var(--info); }
.queue-strip-link { margin-left: auto; white-space: nowrap; }

/* Admin dentro do sistema de um usuário */
.impersonate-bar { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); font-size: 14px; }
.impersonate-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.impersonate-inner > span { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.impersonate-inner small { opacity: .8; }

/* Aviso de página já analisada */
.dup-warning { border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-bg); }
.dup-warning h2 { color: var(--warn); display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.dup-warning > p { margin: 0 0 12px; color: var(--text-2); }
.dup-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.dup-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); }
.dup-list .dup-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dup-list .dup-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dup-list .dup-name small { color: var(--muted); }
.dup-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Usuários */
.user-enter { all: unset; cursor: pointer; display: inline-flex; flex-direction: column; border-radius: 6px; }
.user-enter strong { color: var(--link); }
.user-enter:hover strong, .user-enter:focus-visible strong { text-decoration: underline; }
.user-enter:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.user-ident { display: inline-flex; flex-direction: column; }
.user-ident small, .user-enter small { color: var(--muted); font-size: 12.5px; }

.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin: 8px 0 14px; }
.section-head h1 { margin: 0; }
.section-head .head-tools input[type=search] { margin: 0; min-width: 220px; }
.section-head .head-tools select { margin: 0; width: auto; }

.page-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.page-grid > li { min-width: 0; }
.page-card {
  display: flex; flex-direction: column; height: 100%; overflow: hidden; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.page-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.page-cover { position: relative; display: block; aspect-ratio: 16 / 7; overflow: hidden; background: var(--grad); }
.page-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.page-card:hover .page-cover img { transform: scale(1.04); }
.page-cover-post::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(8, 11, 18, .38)); }
.page-card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; padding: 0 16px 14px; }
.page-avatar {
  position: relative; z-index: 1; flex: none; width: 64px; height: 64px; margin-top: -32px; overflow: hidden;
  display: grid; place-items: center; border-radius: 50%; border: 3px solid var(--surface); background: var(--grad);
  color: #fff; font-size: 24px; font-weight: 800; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .55);
}
.page-card-title { font-size: 16px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-card .tag-list { margin-top: 0; }
.page-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 4px; overflow: hidden;
  background: var(--border); border: 1px solid var(--border); border-radius: 10px;
}
.page-metrics > span { min-width: 0; padding: 7px 9px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.page-metrics strong { display: block; color: var(--text); font-size: 15.5px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.page-card-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; color: var(--muted); font-size: 12.5px; }
.avatar { overflow: hidden; }
.avatar:has(img) { border-radius: 50%; background: var(--surface-2); }
.avatar img, .page-avatar img, .mini-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-avatar {
  flex: none; width: 22px; height: 22px; overflow: hidden; display: inline-grid; place-items: center; border-radius: 50%;
  background: var(--grad); color: #fff; font-size: 11px; font-weight: 800;
}
.pager-gap { padding: 5px 4px; color: var(--muted); }

/* ============================================================ ranking e cards de post */
.segmented { display: inline-flex; gap: 2px; padding: 4px; background: var(--surface-2); border-radius: 10px; }
.segmented a { padding: 6px 14px; border-radius: 7px; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.segmented a:hover { color: var(--text); text-decoration: none; }
.segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.page-tabs { margin-bottom: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filters .sort, .status-filter { margin-left: 0; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.status-filter { margin: -4px 0 12px; }
.status-filter small { font-weight: 600; opacity: .75; }
.status-filter a.has-failed small { color: var(--bad); opacity: 1; }
.note-top { margin: -6px 0 12px; }
.rank-table th a { color: inherit; }
.rank-table th a:hover { color: var(--text); text-decoration: none; }
.rank-table th a.active { color: var(--primary); }
.rank-table td.sorted { font-weight: 700; }
.pos-cell { width: 1%; color: var(--muted); font-weight: 700; }
.page-link { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.page-link .mini-avatar { width: 30px; height: 30px; font-size: 13px; }

.rank-title-row { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rank-title-row .rank-title { margin: 0; }
.btn.is-busy { cursor: progress; opacity: .85; }
.kind-badge {
  position: absolute; z-index: 2; top: 10px; right: 10px; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(10, 12, 18, .62); color: #fff; backdrop-filter: blur(6px);
}
.rank-page { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--text-2); font-size: 13px; font-weight: 600; }
.rank-page span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-page:hover { color: var(--link); text-decoration: none; }
.caption {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  white-space: pre-line; cursor: pointer; border-radius: 6px;
}
.caption.open { display: block; -webkit-line-clamp: unset; overflow: visible; }
.caption:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.rank-foot { gap: 8px; }
.rank-actions { display: inline-flex; gap: 4px; }
.rank-actions .icon-btn { top: 0; width: 30px; height: 30px; border-color: transparent; background: var(--surface-2); color: var(--text-2); }
.rank-actions .icon-btn:hover { color: var(--primary); background: var(--primary-soft); border-color: transparent; text-decoration: none; }
.icon-btn.is-busy { pointer-events: none; }
.icon-btn.is-busy svg { display: none; }
.icon-btn.is-busy::after {
  content: ""; width: 14px; height: 14px; border: 2px solid var(--border-strong); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
.rank-actions .icon-btn.is-done { color: var(--ok); background: var(--ok-bg); }
.rank-actions .icon-btn.is-error { color: var(--bad); background: var(--bad-bg); }

/* ============================================================ armazenamento */
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; font-size: 14px; }
.meter-head span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.meter p { margin: 8px 0 0; }
.bar { position: relative; height: 12px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.bar-thin { height: 6px; }
.bar-fill, .bar-mark { position: absolute; inset: 0 auto 0 0; border-radius: inherit; }
.bar-fill { background: var(--grad); }
.bar-bad { background: var(--bad); }
.bar-mark { background: var(--gold); }
.dot-gold { display: inline-block; width: 8px; height: 8px; margin-right: 3px; border-radius: 50%; background: var(--gold); }
.usage { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.usage-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 14px; }
.usage-size { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.usage-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 28px; margin-top: 5px; }
.repeated {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 20px; padding: 14px 16px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
}
.repeated p { margin: 4px 0 0; }
.compact-table th, .compact-table td { padding: 9px 10px; }

/* avisos rápidos */
.toast-box {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 60; transform: translateX(-50%);
  display: grid; gap: 8px; width: min(460px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  pointer-events: auto; padding: 11px 15px; border-radius: 12px; font-size: 14px; font-weight: 500; line-height: 1.45;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  animation: toast-in .2s ease;
}
.toast-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.toast-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ============================================================ perfis */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; }
.profile-grid .card { margin: 0; display: flex; flex-direction: column; }
.profile-grid .card .actions { margin-top: auto; padding-top: 16px; }
.profile-card.disabled { opacity: .6; }
.profile-card .card-head > div:last-child { display: flex; gap: 6px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv + .inline-form, .kv + .actions { margin-top: 18px; }
.proxy-status { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; min-height: 24px; margin-top: 4px; }
details.sub { margin: 18px 0; padding: 14px 16px; background: var(--surface-2); border-radius: var(--radius-sm); }
details.sub summary { cursor: pointer; font-weight: 600; font-size: 14px; }
details.sub form { margin-top: 12px; }
.steps { font-size: 14px; padding-left: 20px; color: var(--text-2); }
.steps li { margin-bottom: 5px; }
.vnc-frame { margin: 16px 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 16 / 10; max-height: 78vh; }
.vnc-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.type-box { margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; }
.type-box > label:first-child { margin-bottom: 2px; }
.type-box p { margin: 0 0 10px; }
.type-box .inline-form { margin-bottom: 10px; }
.type-box label.check { margin-bottom: 4px; }

/* ============================================================ login */
.login-body { display: grid; place-items: center; padding: 20px; }
.login-theme { position: fixed; top: 16px; right: 16px; }
.login-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 34px 30px 30px; box-shadow: var(--shadow-lg); text-align: left;
}
.login-brand { display: flex; justify-content: center; margin-bottom: 14px; }
.login-brand .logo-mark { border-radius: 14px; }
.login-card h1 { text-align: center; font-size: 24px; font-weight: 600; }
.login-card h1 b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.login-card > p { text-align: center; margin-bottom: 24px; font-size: 14px; }

/* ============================================================ responsivo */
@media (max-width: 960px) {
  .two-col { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: repeat(3, 1fr); }
  .summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .wrap { padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
  main.wrap { padding-top: 16px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
  body { font-size: 15px; }
  h1 { font-size: 20px; }

  /* topo: marca + ações numa linha, menu rolável na de baixo */
  .topbar-inner { gap: 10px; padding-top: 10px; padding-bottom: 6px; flex-wrap: wrap; min-height: 0; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -6px; }
  .nav a { padding: 9px 12px; }
  .topbar-right { margin-left: auto; }
  .worker-pill { font-size: 0; gap: 0; padding: 9px; }
  .icon-btn { width: 40px; height: 40px; }

  /* campos com 16px: o iPhone não dá zoom ao tocar */
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea { font-size: 16px; padding: 11px 12px; }
  textarea { font-size: 13px; }
  .btn { min-height: 44px; }

  .card { padding: 16px; border-radius: 12px; margin-bottom: 14px; }
  .url-row { flex-direction: column; }
  .url-row .btn { min-height: 48px; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .inline-form input, .inline-form select { flex: 1 1 100%; }
  .inline-form .btn { flex: 1 1 100%; }
  .actions .btn, .actions form, .actions form .btn { flex: 1 1 auto; }
  .actions form { display: flex; }

  /* tabelas viram cartões */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody { display: block; }
  .table-cards tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
  .table-cards tbody tr:hover { background: transparent; }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards td { display: block; padding: 0; border: 0; }
  .table-cards .page-cell { flex: 1 1 100%; order: 1; }
  .table-cards .page-cell a { font-size: 15.5px; overflow-wrap: anywhere; }
  .table-cards .status-cell { order: 2; }
  .table-cards .num { order: 3; font-size: 13.5px; font-weight: 600; }
  .table-cards .num::after { content: " " attr(data-label); color: var(--muted); font-weight: 400; }
  .table-cards .profile-cell { display: none; }
  .table-cards .date-cell { order: 4; flex: 1 1 100%; font-size: 12.5px; }
  .table-wrap { overflow: visible; margin: 0; padding: 0; }
  .search, .search input { width: 100%; min-width: 0; }
  .head-tools { width: 100%; }
  .head-tools .search { flex: 1; }
  .table-cards tr { position: relative; }
  .table-cards .check-cell { order: 0; width: auto; flex: none; }
  .table-cards .check-cell + .page-cell { flex: 1 1 calc(100% - 40px); min-width: 0; padding-right: 40px; }
  .table-cards .check-cell input { width: 20px; height: 20px; margin: 2px 0 0; }
  .table-cards tr:has(.check-cell) { align-items: flex-start; }
  .table-cards .row-actions { position: absolute; top: 8px; right: 0; padding: 0 !important; }
  .table-cards .row-actions .icon-btn { opacity: .7; width: 36px; height: 36px; }
  .table-cards tbody tr.selected { background: transparent; }
  .table-cards tbody tr.selected .page-cell a { color: var(--primary); }
  .bulk-bar { position: sticky; top: 108px; z-index: 5; }
  .bulk-tag input { flex: 1 1 100%; }
  .bulk-tag .btn, .bulk-bar > .btn { flex: 1 1 auto; }
  .tag-row input[type=text] { flex-basis: 100%; }
  .tag-count { min-width: 0; margin-right: auto; }
  .dialog-body { padding: 16px; }
  .rename-form input { flex-basis: 100%; }
  .tag-add input { padding: 4px 12px; }

  /* análise */
  .page-ident { gap: 12px; align-items: flex-start; }
  .avatar { width: 42px; height: 42px; font-size: 18px; border-radius: 12px; }
  .analysis-head .card-head { gap: 12px; }
  .analysis-head .card-head .actions { width: 100%; }
  .analysis-head .card-head .actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
  .analysis-head .card-head .actions .btn { padding: 8px 10px; font-size: 13.5px; width: 100%; }
  .analysis-head .card-head .actions:has(.btn-danger) { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .meta-grid div { padding: 9px 10px; }
  .meta-grid span { font-size: 11px; }
  .meta-grid strong { font-size: 14px; }
  .progress-line { font-size: 13.5px; }
  .tabs { margin: -6px -16px 14px; padding: 0 16px; }
  .tabs > a { padding: 12px 10px; white-space: nowrap; }
  .sort { order: 5; margin: 2px 0 12px; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs + .summary, .summary { margin-bottom: 16px; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .summary div { padding: 10px 12px; }
  .summary strong { font-size: 17px; }
  .rank-title { font-size: 11.5px; margin-bottom: 10px; }
  .rank-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .rank-card:hover { transform: none; box-shadow: none; }
  .rank-main strong { font-size: 19px; }
  .rank-main span { font-size: 12px; }
  .rank-body { padding: 10px 11px 11px; gap: 4px; }
  .rank-sub { gap: 10px; font-size: 12.5px; }
  .rank-foot { font-size: 12px; padding-top: 8px; }
  .rank-pos { top: 8px; left: 8px; font-size: 12px; }
  .caption { display: none; }
  .vnc-frame { aspect-ratio: 4 / 3; margin: 12px -16px; border-radius: 0; border-left: 0; border-right: 0; }

  /* início, ranking e armazenamento */
  .new-analysis { padding: 16px; }
  .new-analysis .url-row { align-items: stretch; }
  .new-analysis-foot small { white-space: normal; }
  .new-analysis-foot { flex-wrap: wrap; }
  .section-head .head-tools { flex-wrap: wrap; }
  .section-head .head-tools input[type=search] { flex: 1 1 100%; min-width: 0; }
  .section-head .head-tools select { flex: 1 1 100%; }
  .page-grid { gap: 12px; }
  .page-card:hover { transform: none; box-shadow: var(--shadow); }
  .filters { gap: 8px; }
  .filters .sort { width: 100%; }
  .card-head .segmented { width: 100%; }
  .card-head .segmented a { flex: 1; text-align: center; }
  .table-cards .pos-cell { order: 1; flex: none; font-size: 15px; }
  .table-cards .pos-cell + .page-cell { flex: 1 1 calc(100% - 56px); }
  .rank-actions .icon-btn { width: 34px; height: 34px; }
  .meters { grid-template-columns: 1fr; }
  .repeated { flex-direction: column; align-items: stretch; }

  /* perfis */
  .profile-grid { grid-template-columns: 1fr; gap: 14px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { font-size: 12.5px; }
  .kv dd { margin-bottom: 10px; }
  .page-head h1 { font-size: 21px; }

  .login-card { padding: 28px 20px 22px; border-radius: 16px; }
}
@media (max-width: 380px) {
  .meta-grid { grid-template-columns: repeat(2, 1fr); }
  .rank-grid { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 3s !important; }
}

/* ============================================================ convites */
.check-grid { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px 6px; margin: 0 0 14px; min-width: 0; }
.check-grid legend { font-size: 13px; font-weight: 600; padding: 0 6px; color: var(--text-2); }
.check-grid label.check { display: inline-flex; margin: 4px 16px 6px 0; }
.new-analysis h1 { margin-bottom: 4px; }
.new-analysis textarea { margin: 12px 0 14px; }
.auto-card .card-head { align-items: flex-start; }
.auto-card .card-head p { margin: 6px 0 0; max-width: 640px; }
.auto-card.is-on { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.auto-card .summary { margin: 18px 0 0; }
.auto-card .flash { margin: 16px 0 0; }
.row-btns { white-space: nowrap; text-align: right; }
.row-btns form + form { margin-left: 6px; }
.post-cell { min-width: 240px; max-width: 420px; }
.post-cell a { color: var(--text); font-weight: 500; }
.live-round { margin-top: 16px; padding: 4px 16px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.live-round .actions { margin-top: 10px; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity li:last-child { border-bottom: 0; }
.activity strong { min-width: 52px; text-align: right; font-size: 17px; font-variant-numeric: tabular-nums; color: var(--primary); }
.activity div { min-width: 0; }
.activity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .auto-card .card-head { flex-direction: column; }
  .row-btns { text-align: left; }
}
