@font-face {
  font-family: 'Figtree';
  src: url('/fonts/figtree.woff2') format('woff2-variations'), url('/fonts/figtree.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: 'Bricolage';
  src: url('/fonts/bricolage.woff2') format('woff2');
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --bg: #F4F0E8;
  --bg-2: #ECE5D8;
  --surface: #FFFFFF;
  --surface-2: #FAF6EF;
  --ink: #102A2F;
  --ink-2: #4A6266;
  --ink-3: #7D9194;
  --line: #E4DCCD;
  --line-2: #D2C7B3;
  --accent: #FF6A3D;
  --accent-2: #F0542A;
  --accent-ink: #FFFFFF;
  --accent-soft: #FFE6DC;
  --sea: #188F85;
  --sea-2: #3CC5B9;
  --sea-soft: #D6EFEA;
  --deep: #0E3B43;
  --danger: #C23B28;
  --ok: #1B8A5A;
  --warn: #B87A0B;
  --sel: #FF6A3D;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(16, 42, 47, .06), 0 10px 28px -14px rgba(16, 42, 47, .22);
  --shadow-lg: 0 24px 60px -20px rgba(16, 42, 47, .35);
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Bricolage', 'Figtree', system-ui, sans-serif;
  --tile: 168px;
  --top: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1C20;
    --bg-2: #0E2327;
    --surface: #11272C;
    --surface-2: #142E34;
    --ink: #E7F0EE;
    --ink-2: #A2B8B5;
    --ink-3: #6D8987;
    --line: #1D3940;
    --line-2: #29484F;
    --accent: #FF7A50;
    --accent-2: #FF8F6A;
    --accent-soft: #3B231B;
    --sea: #3CC5B9;
    --sea-soft: #12383A;
    --danger: #F0705C;
    --ok: #46C48C;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -14px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1C20;
  --bg-2: #0E2327;
  --surface: #11272C;
  --surface-2: #142E34;
  --ink: #E7F0EE;
  --ink-2: #A2B8B5;
  --ink-3: #6D8987;
  --line: #1D3940;
  --line-2: #29484F;
  --accent: #FF7A50;
  --accent-2: #FF8F6A;
  --accent-soft: #3B231B;
  --sea: #3CC5B9;
  --sea-soft: #12383A;
  --danger: #F0705C;
  --ok: #46C48C;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sea); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(24px, 3vw, 32px); }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--sea); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

.i { display: inline-flex; flex: none; line-height: 0; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.fine { font-size: 12px; color: var(--ink-3); }
.err { color: var(--danger); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.linkish { background: none; border: 0; padding: 0; color: var(--sea); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------ partida */
.boot { display: grid; place-items: center; min-height: 100vh; }
.boot-mark img { animation: bob 2.4s ease-in-out infinite; }
.logo { display: inline-flex; line-height: 0; }
.logo svg { border-radius: 26%; }
.logo .logo-bg { fill: var(--deep); }

/* ------------------------------------------------------------ botões e campos */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 650; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px var(--accent); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--surface); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: transparent; }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.wide { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 0; background: transparent; color: var(--ink-2); position: relative; flex: none;
}
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.icon-btn.on { background: var(--sea-soft); color: var(--sea); }
.icon-btn.big { width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: var(--bg); }
.icon-btn.big:hover { background: var(--deep); color: #fff; }
.icon-btn:disabled { opacity: .4; pointer-events: none; }

.input, .select {
  min-height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); width: 100%;
}
.input:focus, .select:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sea) 22%, transparent); }
.select { width: auto; padding-right: 30px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 16px) 19px, calc(100% - 11px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); font-size: 13px; font-weight: 600; }
.chip.ok { background: var(--sea-soft); color: var(--sea); }
.chip.tiny { padding: 1px 8px; font-size: 11px; margin-left: 8px; vertical-align: 2px; background: var(--accent-soft); color: var(--accent-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h2 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--sea); display: inline-block; animation: spin .8s linear infinite; }
.bar { height: 6px; border-radius: 6px; background: var(--bg-2); overflow: hidden; margin: 6px 0 2px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sea), var(--sea-2)); border-radius: 6px; transition: width .4s ease; }

.switch { width: 52px; height: 30px; border-radius: 999px; border: 0; background: var(--line-2); position: relative; flex: none; transition: background .2s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch.on { background: var(--sea); }
.switch.on span { transform: translateX(22px); }
.toggle { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.toggle:checked { background: var(--sea); }
.toggle:checked::after { transform: translateX(18px); }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--sea); }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--bg-2); gap: 2px; flex-wrap: wrap; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 6px 12px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--sea); }
.seg-btns { display: inline-flex; gap: 2px; background: var(--bg-2); padding: 3px; border-radius: 12px; }
.seg-btns .icon-btn { width: 34px; height: 34px; }
.seg-btns .icon-btn.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ------------------------------------------------------------ cabeçalho */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.tabs { display: flex; gap: 4px; margin-left: 12px; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 650; }
.tab:hover { background: var(--bg-2); color: var(--ink); }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tab.active .i { color: var(--accent); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.conn-dot[data-state="connecting"], .conn-dot[data-state="waiting"] { background: var(--warn); animation: pulse 1.2s infinite; }
.conn-dot[data-state="closed"] { background: var(--danger); }
.badge { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; line-height: 1; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); padding: 0; overflow: hidden; background: var(--sea-soft); color: var(--sea); font-weight: 800; display: grid; place-items: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.bottom-tabs { display: none; }

.view { max-width: 1440px; margin: 0 auto; padding: 24px 20px 120px; outline: none; }
.page-head { margin-bottom: 20px; display: grid; gap: 6px; }

/* ------------------------------------------------------------ entrada */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 420px); gap: 48px; align-items: center; justify-content: center; padding: 40px 24px; background:
  radial-gradient(1200px 500px at 0% 100%, color-mix(in srgb, var(--sea-2) 16%, transparent), transparent 60%),
  radial-gradient(800px 400px at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), var(--bg); }
.login-card { display: grid; gap: 18px; }
.login-brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -.02em; }
.login-brand .logo { animation: bob 3.2s ease-in-out infinite; }
.login h1 { font-size: clamp(32px, 5vw, 50px); letter-spacing: -.03em; }
.login .lead { font-size: 18px; color: var(--ink-2); max-width: 46ch; }
.btn.google { min-height: 52px; font-size: 16px; background: var(--surface); border-color: var(--line-2); box-shadow: var(--shadow); justify-self: start; padding: 0 22px; }
.g-mark { display: inline-flex; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; max-width: 420px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.login .btn.ghost.wide { max-width: 420px; justify-self: start; width: auto; }
.dev-login { display: grid; gap: 6px; max-width: 420px; padding: 12px; border: 1px dashed var(--line-2); border-radius: 12px; }
.login-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.login-steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.login-steps p { color: var(--ink-2); font-size: 14px; }
.step-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--sea-soft); color: var(--sea); flex: none; }
.login-steps li:nth-child(3) .step-ico { background: var(--accent-soft); color: var(--accent-2); }

/* ------------------------------------------------------------ compartilhar (celular) */
.share-page { max-width: 760px; }
.hero { display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: center; overflow: hidden; position: relative; background:
  linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--sea-soft) 55%, var(--surface))); }
.hero-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero h1 { font-size: clamp(22px, 4.6vw, 28px); }
.hero-text { display: grid; gap: 8px; min-width: 0; }
.viewers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 4px; }
.hint { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.hint .i { margin-top: 2px; color: var(--sea); }
.scan-note { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--sea); font-weight: 600; }
.float-scene { position: relative; height: 120px; display: grid; place-items: center; }
.float-scene .boat { position: relative; z-index: 1; filter: grayscale(.4) opacity(.65); transition: filter .4s; }
.float-scene.afloat .boat { filter: none; animation: bob 3s ease-in-out infinite; }
.waves { position: absolute; left: -20px; right: -20px; bottom: 6px; height: 18px; background: repeat-x center/40px 18px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 18'%3E%3Cpath d='M0 9c5 0 5-5 10-5s5 5 10 5 5-5 10-5 5 5 10 5' fill='none' stroke='%233CC5B9' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E"); opacity: .7; }
.float-scene.afloat .waves { animation: drift 3.5s linear infinite; }

.sources { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.source, .received-list li { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.source.permission, .source.expired { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }
.source.error { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.source-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--sea-soft); color: var(--sea); flex: none; }
.source-text { display: grid; min-width: 0; flex: 1; }
.source-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.add-btn { display: grid; justify-items: start; gap: 2px; padding: 14px; border-radius: 14px; border: 1.5px dashed var(--line-2); background: transparent; text-align: left; transition: border-color .15s, background .15s, transform .1s; }
.add-btn .i { color: var(--accent); margin-bottom: 6px; }
.add-btn span { font-size: 13px; color: var(--ink-2); }
.add-btn:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.add-btn:active { transform: scale(.98); }
.tips { margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.tips summary { cursor: pointer; font-weight: 650; color: var(--ink); }
.tips ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.howto-steps { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.howto-steps b { color: var(--ink); }
.mini-transfers, .received-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mini-transfers li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-transfers li:last-child { border-bottom: 0; }
.mini-transfers .i { color: var(--sea); margin-top: 2px; }
.mt-text { display: grid; min-width: 0; flex: 1; }
.mt-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-transfers li.error .i { color: var(--danger); }

.night { position: fixed; inset: 0; z-index: 200; background: #000; color: #3c5b5e; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; cursor: pointer; }
.night-boat { animation: bob 4s ease-in-out infinite, nightdrift 60s ease-in-out infinite alternate; opacity: .55; }
.night-status { color: #5d8286; font-weight: 600; }
.night-hint { font-size: 13px; }

/* ------------------------------------------------------------ aparelhos */
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.device-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 6px; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; }
.device-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.dc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.dc-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-2); flex: none; }
.device-card.sharing .dc-ico { background: var(--sea-soft); color: var(--sea); }
.dc-status { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); display: inline-block; flex: none; }
.sharing .dot { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
.online .dot { background: var(--warn); }
.this-device { margin-top: 22px; display: flex; align-items: center; gap: 4px; }
.big-empty { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; max-width: 760px; }
.big-empty h2 { margin-bottom: 10px; font-size: 22px; }
.big-empty p { color: var(--ink-2); }
.empty-art { display: grid; place-items: center; }
.boat-art { width: 120px; height: 120px; border-radius: 30px; background: var(--sea-soft); color: var(--sea); }
.qr { background: #fff; padding: 10px; border-radius: 16px; line-height: 0; box-shadow: var(--shadow); border: 1px solid var(--line); }

/* ------------------------------------------------------------ navegar */
.browse-page { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; max-width: none; }
.side { position: sticky; top: calc(var(--top) + 20px); display: grid; gap: 18px; max-height: calc(100vh - var(--top) - 40px); overflow: auto; padding-bottom: 12px; scrollbar-width: thin; }
.side-switch { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: left; box-shadow: var(--shadow); }
.side-switch:hover { border-color: var(--line-2); }
.sd-text { display: grid; flex: 1; min-width: 0; }
.sd-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-text .small { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.side-device.sharing .dc-ico { background: var(--sea-soft); color: var(--sea); }
.kinds, .folders { display: grid; gap: 2px; }
.kind, .folder { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); font-weight: 600; text-align: left; }
.kind span, .folder span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kind small, .folder small { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kind:hover, .folder:hover { background: var(--bg-2); color: var(--ink); }
.kind.active, .folder.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.kind.active .i { color: var(--accent); }
.folders h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 0 10px 6px; font-family: var(--font); }
.folder { font-weight: 500; font-size: 14px; padding: 6px 10px; }
.side-actions { display: grid; gap: 6px; }

.toolbar { position: sticky; top: var(--top); z-index: 10; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.search-wrap { position: relative; flex: 1 1 240px; min-width: 180px; }
.search-wrap .i { position: absolute; left: 12px; top: 12px; color: var(--ink-3); pointer-events: none; }
.search { padding-left: 38px; }
.zoom { width: 110px; accent-color: var(--sea); }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); margin: 4px 0 10px; font-size: 14px; }
.banner .i { color: var(--warn); margin-top: 1px; }
.summary { margin: 4px 0 8px; min-height: 20px; }
.sentinel { height: 2px; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 48px 16px; color: var(--ink-2); text-align: center; }
.empty.card { justify-items: stretch; text-align: left; }

.group { margin-bottom: 18px; }
.group-head { display: flex; align-items: center; gap: 10px; padding: 8px 2px; position: sticky; top: calc(var(--top) + 58px); z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.group-head h3 { font-size: 15px; }
.group-check { width: 22px; height: 22px; border-radius: 50%; border: 1.8px solid var(--line-2); background: var(--surface); color: transparent; display: grid; place-items: center; padding: 0; opacity: .7; transition: all .15s; }
.group-head:hover .group-check, body.selecting .group-check { opacity: 1; }
.group.all-sel .group-check { background: var(--sel); border-color: var(--sel); color: #fff; opacity: 1; }

.results.grid .group-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr)); gap: 6px; }
.tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-2); cursor: pointer; user-select: none; -webkit-user-select: none; outline-offset: 2px; transition: transform .15s; -webkit-touch-callout: none; }
.t-media { position: absolute; inset: 0; display: grid; place-items: center; }
.t-media img { width: 100%; height: 100%; object-fit: cover; display: block; animation: fadein .35s ease; }
.t-ph { width: 100%; height: 100%; background: linear-gradient(110deg, var(--bg-2) 30%, color-mix(in srgb, var(--surface) 60%, var(--bg-2)) 50%, var(--bg-2) 70%); background-size: 300% 100%; animation: shimmer 1.6s linear infinite; }
.t-file { display: grid; justify-items: center; gap: 6px; color: var(--ink-3); }
.t-ext { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--ink-2); background: var(--surface); padding: 2px 6px; border-radius: 6px; }
.k-audio .t-file { color: var(--accent); }
.k-doc .t-file { color: var(--sea); }
.t-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 12px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.62)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .15s; }
.tile:not(.has-thumb) .t-name { opacity: 1; color: var(--ink); background: none; text-align: center; padding: 6px 8px; }
.tile:hover .t-name, .tile:focus-visible .t-name { opacity: 1; }
.t-badge { position: absolute; right: 6px; top: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: 700; }
.t-badge:empty { display: none; }
.t-check { position: absolute; left: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); background: rgba(0,0,0,.22); color: transparent; display: grid; place-items: center; padding: 0; opacity: 0; transition: opacity .12s, background .12s; }
.tile:not(.has-thumb) .t-check { border-color: var(--line-2); background: var(--surface); }
.tile:hover .t-check, body.selecting .t-check, .tile:focus-visible .t-check { opacity: 1; }
.tile.sel { transform: scale(.92); border-radius: 14px; box-shadow: 0 0 0 3px var(--sel); }
.tile.sel .t-check, .row-item.sel .t-check { opacity: 1; background: var(--sel); border-color: var(--sel); color: #fff; }

.results.list .group-items { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row-item { display: grid; grid-template-columns: 26px 44px minmax(0, 1fr) 60px 90px 150px 38px; gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: var(--surface-2); }
.row-item.sel { background: color-mix(in srgb, var(--sel) 10%, var(--surface)); }
.row-item.playing .r-name { color: var(--accent-2); }
.row-item .t-check { position: static; opacity: .5; border-color: var(--line-2); background: var(--surface); width: 22px; height: 22px; }
.row-item:hover .t-check { opacity: 1; }
.row-item .t-media { position: relative; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--bg-2); }
.r-text { display: grid; min-width: 0; }
.r-name, .r-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-name { font-weight: 600; }
.r-size { text-align: right; font-variant-numeric: tabular-nums; }
.r-dur { text-align: right; font-variant-numeric: tabular-nums; }

.selbar { position: fixed; left: 50%; bottom: calc(20px + var(--safe-b)); transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 8px; border-radius: 18px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); max-width: calc(100vw - 24px); animation: rise .2s ease; }
.selbar .icon-btn { color: var(--bg); }
.selbar .icon-btn:hover { background: color-mix(in srgb, var(--bg) 14%, transparent); }
.sel-text { display: grid; line-height: 1.2; padding-right: 6px; }
.sel-text .muted { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.sel-actions { display: flex; gap: 8px; align-items: center; }
.selbar .btn:not(.primary) { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 30%, transparent); }
body.has-player .selbar { bottom: calc(96px + var(--safe-b)); }

.dropzone { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: color-mix(in srgb, var(--deep) 70%, transparent); color: #fff; pointer-events: none; }
.dropzone > div { display: grid; justify-items: center; gap: 12px; padding: 40px 56px; border: 3px dashed rgba(255,255,255,.7); border-radius: 28px; font-size: 20px; }

.job-card { position: fixed; left: 20px; bottom: calc(20px + var(--safe-b)); z-index: 45; width: min(380px, calc(100vw - 40px)); display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.job-card > .i { color: var(--sea); margin-top: 2px; }
body.has-player .job-card { bottom: calc(96px + var(--safe-b)); }

/* ------------------------------------------------------------ visualizador */
body.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(6, 14, 16, .96); color: #fff; display: grid; grid-template-rows: auto 1fr; outline: none; animation: fadein .15s ease; }
.lb-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: linear-gradient(rgba(0,0,0,.4), transparent); z-index: 2; }
.lb-top .icon-btn { color: #fff; }
.lb-top .icon-btn:hover { background: rgba(255,255,255,.12); }
.lb-top .icon-btn.on { background: var(--sel); color: #fff; }
.lb-title { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.lb-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-title .muted { color: rgba(255,255,255,.65); }
.lb-actions { display: flex; align-items: center; gap: 6px; }
.lb-count { font-size: 13px; color: rgba(255,255,255,.65); margin-right: 6px; font-variant-numeric: tabular-nums; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 8px 64px 24px; overflow: hidden; }
.lb-img { max-width: 100%; max-height: calc(100vh - 100px); object-fit: contain; background-size: contain; background-position: center; background-repeat: no-repeat; border-radius: 4px; }
.lb-img.loading { min-width: min(70vw, 800px); min-height: min(60vh, 600px); filter: blur(.5px); }
.lb-video { max-width: 100%; max-height: calc(100vh - 100px); border-radius: 8px; background: #000; }
.lb-frame { width: min(1100px, 100%); height: calc(100vh - 110px); border: 0; border-radius: 8px; background: #fff; }
.lb-audio { display: grid; justify-items: center; gap: 20px; }
.lb-audio img { width: min(360px, 70vw); border-radius: 16px; box-shadow: var(--shadow-lg); }
.lb-audio-ico { width: 240px; height: 240px; border-radius: 24px; background: rgba(255,255,255,.06); display: grid; place-items: center; color: var(--accent); }
.lb-audio audio { width: min(420px, 80vw); }
.lb-fallback { display: grid; justify-items: center; gap: 16px; text-align: center; color: rgba(255,255,255,.8); max-width: 420px; }
.lb-fallback img { max-height: 50vh; border-radius: 12px; }
.ext-big { width: 160px; height: 160px; border-radius: 24px; background: rgba(255,255,255,.08); display: grid; place-items: center; font-size: 32px; font-weight: 800; letter-spacing: .05em; }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); z-index: 3; width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center; }
.lb-nav:hover { background: rgba(255,255,255,.22); }
.lb-nav.prev { left: 12px; }
.lb-nav.next { right: 12px; }
.lb-info { position: fixed; right: 0; top: 60px; bottom: 0; width: min(340px, 90vw); z-index: 4; padding: 20px; background: rgba(16, 30, 34, .96); border-left: 1px solid rgba(255,255,255,.08); display: grid; align-content: start; gap: 12px; overflow: auto; }
.lb-row { display: grid; gap: 2px; word-break: break-word; }
.lb-row .muted { color: rgba(255,255,255,.55); }

/* ------------------------------------------------------------ tocador */
.player { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 50; display: grid; grid-template-columns: 52px minmax(0, 1.2fr) auto minmax(0, 1.4fr) auto; gap: 14px; align-items: center; padding: 10px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); max-width: 1180px; margin: 0 auto; animation: rise .2s ease; }
.pl-cover { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.pl-cover img { width: 100%; height: 100%; object-fit: cover; }
.pl-info { display: grid; min-width: 0; line-height: 1.25; }
.pl-title, .pl-artist { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-controls { display: flex; align-items: center; gap: 6px; }
.pl-progress { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pl-seek { flex: 1; accent-color: var(--accent); min-width: 60px; }
.pl-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-extra { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.pl-vol { width: 80px; accent-color: var(--sea); }
body.has-player .view { padding-bottom: 180px; }

/* ------------------------------------------------------------ atividade */
.transfer-list { list-style: none; margin: 0; padding: 0; display: grid; }
.transfer { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.transfer:last-child { border-bottom: 0; }
.tr-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--sea-soft); color: var(--sea); flex: none; }
.transfer.error .tr-ico, .transfer.canceled .tr-ico { background: var(--bg-2); color: var(--ink-3); }
.tr-text { display: grid; min-width: 0; flex: 1; }
.tr-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-list.compact .transfer { padding: 8px 2px; }
.hist-day + .hist-day { margin-top: 16px; }
.hist-day h3 { font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-family: var(--font); }
.activity-page, .settings-page { max-width: 760px; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 80; width: min(420px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 18px; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; transform: translateX(100%); transition: transform .2s ease; }
.drawer.in { transform: none; }
.drawer .transfer-list { overflow: auto; align-content: start; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.scrim { position: fixed; inset: 0; z-index: 79; background: rgba(6, 14, 16, .35); animation: fadein .2s; }

/* ------------------------------------------------------------ ajustes */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row > div:first-child { display: grid; min-width: 0; }
.set-list { list-style: none; margin: 0; padding: 0; }
.set-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-list li:last-child { border-bottom: 0; }
.set-list li > div { display: grid; flex: 1; min-width: 0; }
.set-list .i { color: var(--ink-2); }
.acct { display: flex !important; align-items: center; gap: 12px; }
.acct img { width: 44px; height: 44px; border-radius: 50%; }
.acct > div { display: grid; }
.about { text-align: center; }

/* ------------------------------------------------------------ pareamento */
.pair-grid { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.pair-qr { min-width: 220px; min-height: 220px; display: grid; place-items: center; }
.pair-steps { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.pair-code { font-family: var(--display); font-size: 44px; font-weight: 800; letter-spacing: .08em; color: var(--ink); font-variant-numeric: tabular-nums; }
.pair-entry { display: grid; gap: 14px; }
.code-input { font-size: 30px; text-align: center; letter-spacing: .2em; font-weight: 800; min-height: 64px; font-variant-numeric: tabular-nums; }
.scan-box { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 1; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.approve { display: grid; gap: 14px; }
.approve-who { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--bg-2); }
.approve-who > div { display: grid; }

/* ------------------------------------------------------------ janelas, menus e avisos */
dialog.sheet { border: 0; padding: 0; background: transparent; max-width: min(560px, calc(100vw - 24px)); width: 100%; color: var(--ink); opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .18s, transform .18s; }
dialog.sheet.wide { max-width: min(720px, calc(100vw - 24px)); }
dialog.sheet.in { opacity: 1; transform: none; }
dialog.sheet::backdrop { background: rgba(6, 14, 16, .45); backdrop-filter: blur(3px); }
.sheet-card { background: var(--surface); border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 22px; display: grid; gap: 16px; max-height: calc(100dvh - 40px); overflow: auto; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet-head h2 { font-size: 21px; }
.sheet-body { display: grid; gap: 12px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.menu-pop { position: fixed; z-index: 150; min-width: 220px; max-width: 320px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: grid; animation: fadein .12s; }
.menu-item { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px; border: 0; background: transparent; text-align: left; font-weight: 600; }
.menu-item small { grid-column: 2; color: var(--ink-3); font-weight: 500; font-size: 12px; }
.menu-item:hover:not(:disabled) { background: var(--bg-2); }
.menu-item:disabled { opacity: .7; cursor: default; font-weight: 500; }
.menu-item.danger { color: var(--danger); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }

.toasts { position: fixed; z-index: 300; left: 50%; top: calc(var(--top) + 10px); transform: translateX(-50%); display: grid; gap: 8px; width: min(520px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s; font-weight: 550; font-size: 14px; }
.toast.in { opacity: 1; transform: none; }
.toast.error { background: var(--danger); color: #fff; }
.toast-text { flex: 1; }
.toast-action { border: 0; background: color-mix(in srgb, var(--bg) 18%, transparent); color: inherit; padding: 6px 12px; border-radius: 9px; font-weight: 750; }
.toast-x { border: 0; background: transparent; color: inherit; opacity: .7; padding: 4px; line-height: 0; border-radius: 8px; }

/* ------------------------------------------------------------ animações */
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes drift { from { background-position-x: 0; } to { background-position-x: 40px; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes fadein { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }
.player { animation-name: fadein; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes nightdrift { from { transform: translate(-20px, -30px); } to { transform: translate(20px, 30px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ------------------------------------------------------------ telas menores */
@media (max-width: 1100px) {
  .player { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .pl-progress { grid-column: 1 / -1; grid-row: 2; }
  .pl-extra { display: none; }
  .row-item { grid-template-columns: 26px 44px minmax(0, 1fr) 54px 80px 38px; }
  .r-date { display: none; }
}

@media (max-width: 900px) {
  .browse-page { grid-template-columns: 1fr; gap: 10px; }
  .side { position: static; max-height: none; overflow: visible; gap: 10px; }
  .kinds { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .kinds::-webkit-scrollbar { display: none; }
  .kind { flex: none; background: var(--surface); border: 1px solid var(--line); padding: 7px 12px; }
  .folders, .side-actions .muted { display: none; }
  .side-actions { display: block; }
  .side-actions .btn.wide { width: auto; }
  .login { grid-template-columns: 1fr; gap: 28px; }
  .group-head { top: calc(var(--top) + 112px); }
}

@media (max-width: 700px) {
  :root { --top: 56px; }
  .top { padding: 0 12px; gap: 8px; }
  .tabs, .install-btn, .conn-text { display: none; }
  .brand span { font-size: 18px; }
  .bottom-tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    padding: 6px 6px calc(6px + var(--safe-b)); gap: 2px;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .btab { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px; text-decoration: none; color: var(--ink-3); font-size: 11.5px; font-weight: 700; }
  .btab.active { color: var(--ink); background: var(--bg-2); }
  .btab.active .i { color: var(--accent); }
  .view { padding: 14px 12px calc(110px + var(--safe-b)); }
  .card { padding: 16px; border-radius: 18px; }
  .hero { grid-template-columns: 1fr; text-align: left; gap: 6px; }
  .float-scene { height: 96px; }
  .selbar { bottom: calc(76px + var(--safe-b)); left: 12px; right: 12px; transform: none; flex-wrap: wrap; justify-content: space-between; animation: fadein .2s; }
  .selbar .btn span { display: none; }
  .sel-actions { margin-left: auto; }
  body.has-player .selbar { bottom: calc(170px + var(--safe-b)); }
  .player { bottom: calc(72px + var(--safe-b)); left: 8px; right: 8px; gap: 10px; padding: 8px 10px; }
  .job-card { bottom: calc(80px + var(--safe-b)); left: 12px; }
  .toolbar { top: var(--top); gap: 6px; }
  .toolbar .btn span, .zoom { display: none; }
  .search-wrap { flex-basis: 100%; }
  .group-head { top: calc(var(--top) + 106px); }
  .results.grid .group-items { grid-template-columns: repeat(auto-fill, minmax(min(var(--tile), 31vw), 1fr)); gap: 3px; }
  .tile { border-radius: 6px; }
  .row-item { grid-template-columns: 24px 40px minmax(0, 1fr) 70px 34px; gap: 10px; padding: 8px; }
  .r-dur { display: none; }
  .big-empty { grid-template-columns: 1fr; justify-items: start; }
  .pair-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .pair-steps { text-align: left; }
  .lb-stage { padding: 0 0 12px; }
  .lb-nav { display: none; }
  .lb-top .btn span { display: none; }
  .lb-count { display: none; }
  dialog.sheet { margin: auto 0 0; max-width: 100vw; transform: translateY(30px); }
  dialog.sheet .sheet-card { border-radius: 24px 24px 0 0; padding-bottom: calc(22px + var(--safe-b)); }
  .toasts { top: auto; bottom: calc(84px + var(--safe-b)); }
  .device-grid { grid-template-columns: 1fr; }
  .login h1 { font-size: 34px; }
  .login { padding: 28px 18px; }
}
