/* ═══════════════════════════════════════════════════
   VARIÁVEIS & RESET
═══════════════════════════════════════════════════ */
:root {
  --bg:       #05080e;
  --bg2:      #080c15;
  --surface:  #0b1019;
  --surface2: #0f1624;
  --border:   #141e30;
  --border2:  #1a2840;
  --steel:    #5c80a8;
  --steel2:   #90b8dc;
  --accent:   #1a4a8a;
  --accent2:  #2860b0;
  --accent3:  #4a88d8;
  --chrome:   linear-gradient(135deg,#e8f6ff 0%,#8ab8de 28%,#4878b0 52%,#b8dcf8 74%,#70a8cc 100%);
  --text:     #b8d4ec;
  --muted:    #304860;
  --success:  #18805a;
  --danger:   #a82828;
  --glow:     rgba(42,96,176,0.35);
  --glass-bg: rgba(11,16,25,0.72);
  --glass-border: rgba(255,255,255,0.07);

  /* Tamanhos base — facilitam ajuste mobile */
  --radius:    14px;
  --radius-sm: 9px;
  --gap:       15px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Fundo animado multicamada */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 90% 50% at 15% 10%, rgba(30,80,144,.09) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 85% 85%, rgba(0,80,140,.06) 0%, transparent 50%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(20,60,120,.04) 0%, transparent 60%);
  animation: bgPulse 18s ease-in-out infinite alternate;
}
body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.5;
}
@keyframes bgPulse {
  0%   { opacity: 1; transform: scale(1); }
  50%  { opacity: 0.7; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(40,72,120,.5); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent2); }

/* ═══════════════════════════════════════════════════
   LOADER
═══════════════════════════════════════════════════ */
#loader {
  position: fixed; inset: 0; background: var(--bg); z-index: 1000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
}
.loader-brand { display: flex; align-items: center; gap: 11px; }
.loader-cloud {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 13px; font-weight: 700;
  color: rgba(188, 198, 210, 0.65); letter-spacing: 5px; text-transform: uppercase; margin-top: 2px;
}
/* ── Logo PNG ── */
.tf-logo { display: block; object-fit: contain; }
.topbar .tf-logo { height: 32px; width: auto; }
.loader-brand .tf-logo { height: 58px; width: auto; }
.auth-brand .tf-logo { height: 70px; width: auto; }
/* ── Dotted Spinner (Silver) ── */
.spinner-dotted {
  position: relative; width: 26px; height: 26px;
}
.s-dot {
  position: absolute; width: 2.2px; height: 6px;
  background: rgba(188, 198, 210, 0.85); /* Prata */
  border-radius: 1px; left: 50%; top: 0;
  transform-origin: 50% 13px;
  animation: s-fade 1s linear infinite;
}
.s-dot:nth-child(1)  { transform: rotate(0deg);   animation-delay: -1s; }
.s-dot:nth-child(2)  { transform: rotate(30deg);  animation-delay: -0.916s; }
.s-dot:nth-child(3)  { transform: rotate(60deg);  animation-delay: -0.833s; }
.s-dot:nth-child(4)  { transform: rotate(90deg);  animation-delay: -0.75s; }
.s-dot:nth-child(5)  { transform: rotate(120deg); animation-delay: -0.666s; }
.s-dot:nth-child(6)  { transform: rotate(150deg); animation-delay: -0.583s; }
.s-dot:nth-child(7)  { transform: rotate(180deg); animation-delay: -0.5s; }
.s-dot:nth-child(8)  { transform: rotate(210deg); animation-delay: -0.416s; }
.s-dot:nth-child(9)  { transform: rotate(240deg); animation-delay: -0.333s; }
.s-dot:nth-child(10) { transform: rotate(270deg); animation-delay: -0.25s; }
.s-dot:nth-child(11) { transform: rotate(300deg); animation-delay: -0.166s; }
.s-dot:nth-child(12) { transform: rotate(330deg); animation-delay: -0.083s; }

@keyframes s-fade { 
  0% { opacity: 1; } 
  100% { opacity: 0.15; } 
}

/* ═══════════════════════════════════════════════════
   AUTH — TELA DE LOGIN / SETUP
═══════════════════════════════════════════════════ */
#auth-screen {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background: var(--bg);
  overflow: hidden;
}
/* Vídeo de fundo da tela de login */
#auth-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0; pointer-events: none;
}
/* Overlay escuro sobre o vídeo */
#auth-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: rgba(6,9,15,.55); pointer-events: none;
}
.auth-card {
  width: 380px; max-width: calc(100vw - 24px);
  background: rgba(5, 8, 14, 0.88);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 24px; padding: 40px 32px;
  box-shadow:
    0 40px 100px rgba(0,0,0,.9),
    0 0 0 1px rgba(255,255,255,.04) inset,
    0 1px 0 rgba(255,255,255,.08) inset;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  animation: slideUp .5s cubic-bezier(0.34,1.2,0.64,1);
  position: relative; z-index: 2;
}
/* Inputs do auth — tom escuro combinando */
.auth-card .form-row input {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.1);
  color: #e8f4ff;
}
.auth-card .form-row input:focus { border-color: rgba(88,152,224,.6); }
.auth-card .form-row input::placeholder { color: rgba(100,136,168,.6); }
.auth-card label { color: rgba(100,136,168,.8); }
/* Logo no auth */
.auth-brand {
  text-align: center; margin-bottom: 30px;
}
.auth-brand-mark {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 4px;
}
/* "cloud" ao lado do logo — visível no fundo escuro */
.auth-brand-cloud {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 15px; font-weight: 700;
  color: rgba(188, 198, 210, 0.7); letter-spacing: 5px;
  text-transform: uppercase; margin-top: 3px;
}

/* ═══════════════════════════════════════════════════
   TOPBAR — minimalista: só logo + clock
═══════════════════════════════════════════════════ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: 60px;
  background: rgba(5,8,14,.92);
  backdrop-filter: blur(28px) saturate(1.4); -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  will-change: transform;
}
/* Logo na topbar */
.topbar-brand { display: flex; align-items: center; gap: 8px; flex: 1; }
.topbar-brand-cloud {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 11px; font-weight: 700;
  color: var(--steel); letter-spacing: 3px; text-transform: uppercase; margin-top: 1px;
}
/* Relógio */
.topbar-time {
  font-family: 'JetBrains Mono', monospace; font-size: 15px; color: var(--steel);
  background: rgba(255,255,255,.04); padding: 7px 14px;
  border-radius: 10px; border: 1px solid var(--glass-border);
  white-space: nowrap; flex-shrink: 0;
  letter-spacing: .5px;
  position: absolute; left: 50%; transform: translateX(-50%);
}
/* Saudação na topbar */
.topbar-greeting {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px; font-weight: 500;
  color: var(--steel);
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
  animation: fadeIn .3s ease;
}
.topbar-greeting span { color: var(--steel2); font-weight: 600; }
/* Botões de ícone na topbar (mantidos para compatibilidade, mas não usados na topbar) */
.btn-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.04); border: 1px solid var(--glass-border);
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .2s;
}
.btn-icon:hover { color: var(--steel2); border-color: var(--accent2); background: rgba(40,96,176,.15); }
.btn-icon svg {
  width: 14px; height: 14px; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}

/* ── Botão Excluir Coleção — só visível com lápis ativo ── */
.coll-card .btn-ca.del { display: none !important; }
.coll-card.coll-editing .btn-ca.del { display: flex !important; }

/* ═══════════════════════════════════════════════════
   BOTTOM DOCK — barra flutuante estilo macOS/umbrelOS
═══════════════════════════════════════════════════ */
.bottom-dock {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;

  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;

  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(32px) saturate(1.6);
  -webkit-backdrop-filter: blur(32px) saturate(1.6);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 28px;
  box-shadow:
    0 24px 64px rgba(0,0,0,.7),
    0 0 0 1px rgba(255,255,255,.04) inset,
    0 1px 0 rgba(255,255,255,.08) inset;
  animation: dockEntry .6s cubic-bezier(0.34,1.56,0.64,1) both;
  animation-delay: .4s;
  opacity: 0;
  will-change: transform;
}
@keyframes dockEntry {
  from { opacity: 0; transform: translateX(-50%) translateY(30px) scale(.9); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* Separador vertical entre grupos */
.dock-sep {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,.12);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Botão do dock */
.dock-btn {
  position: relative;
  width: 66px; height: 66px;
  border-radius: 20px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.07);
  color: rgba(140,180,220,.65);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}
.dock-btn svg {
  width: 24px; height: 24px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
  transition: transform .22s cubic-bezier(0.34,1.56,0.64,1);
}
/* Hover real só para dispositivos com mouse */
@media (hover: hover) and (pointer: fine) {
  .dock-btn:hover {
    transform: translateY(-10px) scale(1.18);
    background: rgba(42,96,176,.28);
    border-color: rgba(72,136,216,.5);
    color: #90c8f0;
    box-shadow:
      0 12px 32px rgba(42,96,176,.4),
      0 0 0 1px rgba(72,136,216,.3) inset;
  }
  .dock-btn:hover svg { transform: scale(1.08); }
  .dock-btn:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
}
/* Active: breve feedback visual e reseta imediatamente */
.dock-btn:active {
  transform: translateY(-2px) scale(1.05) !important;
  background: rgba(42,96,176,.22) !important;
  border-color: rgba(72,136,216,.4) !important;
  transition-duration: .08s;
}
.dock-btn:focus:not(:focus-visible) { outline: none; box-shadow: none; }

/* Tooltip */
.dock-btn::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(8,12,20,.96);
  color: var(--steel2);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 11px; font-weight: 600;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all .18s cubic-bezier(.4,0,.2,1);
  letter-spacing: .4px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.dock-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Dot indicador embaixo do botão ativo */
.dock-btn::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent3);
  transition: transform .2s cubic-bezier(0.34,1.56,0.64,1);
}
.dock-btn.dock-active::before { transform: translateX(-50%) scale(1); }

.dock-btn.dock-active {
  background: rgba(26,74,138,.35);
  border-color: rgba(40,96,176,.6);
  color: var(--accent3);
  box-shadow: 0 0 16px rgba(42,96,176,.25) inset;
}

/* Dock danger (logout) */
.dock-btn.dock-danger:hover {
  background: rgba(140,30,30,.28);
  border-color: rgba(192,60,60,.5);
  color: #e08080;
  box-shadow: 0 12px 32px rgba(140,30,30,.3), 0 0 0 1px rgba(192,60,60,.2) inset;
}

/* ── Importar/Exportar no modal de settings ── */
.settings-io { display:flex; gap:10px; margin-top:4px; flex-wrap:wrap; }
.btn-io {
  flex:1; min-width:130px; padding:9px 14px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--steel2);
  font-size:13px; font-weight:600; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:6px;
  transition: all .2s;
}
.btn-io:hover { border-color: var(--accent2); color: var(--accent3); }
.btn-io svg { width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
#import-file-input { display:none; }
.io-status { font-size:12px; margin-top:8px; min-height:18px; text-align:left; }

/* Botão de modo edição — oculto na home, revela nas coleções */
#btn-edit-mode {
  width: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  margin-right: 0;
  transition: width .3s cubic-bezier(.34,1.3,.64,1),
              opacity .25s ease,
              padding .3s ease;
}
#btn-edit-mode.dock-revealed {
  width: 68px;
  padding: 0 8px;
  opacity: 1;
  pointer-events: all;
}
#btn-edit-mode.dock-active {
  background: rgba(26,74,138,.35);
  border-color: rgba(40,96,176,.6);
  color: var(--accent3);
}
#btn-edit-mode.edit-active {
  background: rgba(30,80,144,.25);
  border-color: var(--accent2);
  color: var(--accent3);
}

/* ═══════════════════════════════════════════════════
   CONTEÚDO PRINCIPAL
═══════════════════════════════════════════════════ */
#app-screen { display: none; min-height: 100vh; position: relative; z-index: 1; }

.main-content {
  padding-top: 84px;
  padding-bottom: 110px;
  padding-left: 16px;
  padding-right: 16px;
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Saudação dinâmica */
.dash-header { margin-bottom: 20px; text-align: center; }
.dash-greeting {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px; font-weight: 500;
  color: var(--steel); letter-spacing: .3px;
}
.dash-greeting span { color: var(--steel2); font-weight: 600; }

/* ═══════════════════════════════════════════════════
   GRID DE BLOCOS FIXOS
   Desktop: 3 colunas × 2 linhas
   Tablet:  2 colunas (≤1060px)
   Mobile:  1 coluna  (≤640px)
═══════════════════════════════════════════════════ */
.blocos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: var(--gap);
  width: 100%;
  min-width: 0;
}

/* Posições fixas — desktop */
#bloco-links { grid-column: 1; grid-row: 1; }
#bloco-clock { grid-column: 2; grid-row: 1; align-self: start; }
#bloco-tasks { grid-column: 3; grid-row: 1; align-self: start; }
#bloco-notes { grid-column: 1; grid-row: 2; }

@media (max-width: 1060px) {
  .blocos-grid { grid-template-columns: repeat(2, 1fr); }
  #bloco-links { grid-column: 1; grid-row: 1; }
  #bloco-clock { grid-column: 2; grid-row: 1; }
  #bloco-tasks { grid-column: 1; grid-row: 2; }
  #bloco-notes { grid-column: 2; grid-row: 2; }
}
@media (max-width: 640px) {
  .blocos-grid { grid-template-columns: 1fr; gap: 12px; }
  #bloco-clock { order: -1; }
  #bloco-links { order: 0; }
  #bloco-tasks { order: 1; }
  #bloco-notes { order: 2; }
  #bloco-links, #bloco-clock, #bloco-tasks, #bloco-notes {
    grid-column: 1 !important; grid-row: auto !important;
  }
}

/* ═══════════════════════════════════════════════════
   BLOCO BASE
═══════════════════════════════════════════════════ */
.bloco {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px 16px 15px;
  min-height: 240px;
  display: flex; flex-direction: column;
  transition: border-color .3s, box-shadow .3s, transform .2s;
  animation: slideUp .38s ease both;
  position: relative;
  overflow: hidden;
  min-width: 0;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
/* Linha de brilho no topo do bloco */
.bloco::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  pointer-events: none;
}
.bloco:hover {
  border-color: rgba(40,96,176,.4);
  box-shadow:
    0 8px 40px rgba(0,0,0,.4),
    0 0 0 1px rgba(40,96,176,.12) inset,
    0 0 40px rgba(42,96,176,.06);
  transform: translateY(-1px);
}

/* Header do bloco */
.bloco-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 14px; gap: 8px; flex-shrink: 0;
}
.bloco-title {
  display: flex; align-items: center;
  gap: 8px; flex: 1; min-width: 0;
}
.bloco-icon {
  width: 27px; height: 27px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.bloco-name {
  font-weight: 600; font-size: 15px; letter-spacing: .3px; color: var(--steel2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bloco-actions { display: flex; gap: 4px; flex-shrink: 0; }
.bloco-body { flex: 1; display: flex; flex-direction: column; }

/* ═══════════════════════════════════════════════════
   BLOCO: RELÓGIO
═══════════════════════════════════════════════════ */
.clock-display {
  text-align: center; padding: 14px 0 8px;
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.clock-time {
  font-family: 'Bebas Neue', sans-serif; font-size: 76px;
  letter-spacing: 4px; line-height: 1;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.clock-date {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; color: var(--steel); margin-top: 10px; letter-spacing: .3px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   BLOCO: LINKS RÁPIDOS
═══════════════════════════════════════════════════ */
.links-list { list-style:none; display:flex; flex-direction:column; gap:4px; flex:1; }
.links-list.hidden .link-row { display:none; }

/* ── Cada row: [handle] + [<a>] + [✕] ── */
.link-row {
  list-style:none;
  display:flex; align-items:stretch; min-width:0;
  border-radius:10px; overflow:hidden;
}
/* Feedback visual de drag-over */
.link-row.drag-over { outline:2px solid var(--accent2); outline-offset:-1px; }
.link-row.dragging  { opacity:.3; }

/* Handle ⠿ — invisível até modo edição */
.link-handle {
  width:0; overflow:hidden; display:flex; align-items:center; justify-content:center;
  color:var(--muted); font-size:15px; cursor:grab;
  background: rgba(255,255,255,.04);
  transition:width .18s; flex-shrink:0;
  touch-action:none; user-select:none;
}
.links-editing .link-handle { width:28px; }
.links-editing .link-handle:active { cursor:grabbing; }

/* O link */
.link-item {
  flex:1; display:flex; align-items:center; gap:9px;
  padding:9px 12px; min-width:0;
  background: rgba(255,255,255,.04);
  text-decoration:none; color:var(--text);
  border:1px solid rgba(255,255,255,.06); border-radius:10px;
  transition:border-color .14s, background .14s;
}
/* Em modo edição: <a> perde border-radius direito para colar com ✕ */
.links-editing .link-row .link-item {
  border-radius:0; border-right:none;
}
.link-row:first-child .link-item { border-radius:10px 10px 10px 10px; }
.links-editing .link-row:first-child .link-item { border-radius:0; }
.link-item:hover { border-color: rgba(40,96,176,.35); background: rgba(20,50,100,.2); }

.link-favicon {
  width:26px; height:26px; border-radius:6px;
  background:rgba(255,255,255,.04); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center;
  font-size:14px; flex-shrink:0;
}
.link-label {
  font-family:system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size:15px; font-weight:500;
  color:var(--text); flex:1;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.link-item:hover .link-label { color:var(--steel2); }

/* Botão ✕ — fora do <a>, oculto até modo edição */
.link-del {
  flex-shrink:0; width:0; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  background: rgba(255,255,255,.04); border:1px solid transparent; border-left:none;
  border-radius:0 10px 10px 0;
  color:var(--muted); font-size:14px; cursor:pointer;
  transition:width .18s, background .14s, color .14s;
}
.links-editing .link-del { width:36px; }
@media (max-width:640px) { .links-editing .link-del { width:44px; font-size:16px; } }
.link-del:hover { background:rgba(184,48,48,.2); color:#e07070; }

.links-empty { color:var(--muted); font-size:12px; padding:12px 4px; text-align:center; }

/* Botões no header do widget links */
.links-actions { display:flex; align-items:center; gap:2px; }
.btn-lnk {
  width:32px; height:32px; border-radius:7px;
  background:none; border:none; cursor:pointer;
  color:var(--muted); display:flex; align-items:center; justify-content:center;
  transition:color .15s, background .15s; flex-shrink:0;
}
.btn-lnk:hover { color:var(--steel2); background:var(--surface2); }
.btn-lnk.active { color:var(--accent3); background:rgba(30,80,144,.2); }
.btn-lnk svg { width:15px; height:15px; stroke:currentColor; fill:none;
  stroke-width:2; stroke-linecap:round; stroke-linejoin:round; pointer-events:none; }
.lnk-sep { width:1px; height:14px; background:var(--border); margin:0 2px; flex-shrink:0; }

/* ═══════════════════════════════════════════════════
   BLOCO: NOTAS
═══════════════════════════════════════════════════ */
.notes-area {
  width: 100%; flex: 1; min-height: 130px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px; color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 16px;
  padding: 11px; resize: none; outline: none; line-height: 1.7;
  transition: border-color .2s, background .2s;
}
.notes-area:focus { border-color: rgba(40,96,176,.5); background: rgba(255,255,255,.06); }
.notes-footer { display: flex; justify-content: flex-end; margin-top: 6px; flex-shrink: 0; }
.notes-saved { font-size: 11px; color: var(--muted); }

/* ═══════════════════════════════════════════════════
   BLOCO: TAREFAS
═══════════════════════════════════════════════════ */
.todo-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.todo-item {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 14px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.05);
  border-radius: 9px; font-size: 15px;
  min-width: 0; overflow: hidden;
  transition: border-color .15s;
}
.todo-item:hover { border-color: rgba(40,96,176,.2); }
@media (max-width: 640px) { .todo-item { padding: 11px 12px; font-size: 14px; } }
.todo-check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.18); cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
@media (max-width: 640px) { .todo-check { width: 22px; height: 22px; } }
.todo-check.done { background: var(--success); border-color: var(--success); }
.todo-check.done::after { content: '✓'; font-size: 10px; color: white; }
.todo-text { font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; flex: 1; transition: color .2s; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-text.done { text-decoration: line-through; color: var(--muted); }
.todo-del {
  color: var(--muted); cursor: pointer; font-size: 11px;
  opacity: 0; transition: opacity .2s; flex-shrink: 0; padding: 2px 5px;
}
.todo-item:hover .todo-del { opacity: 1; }
.todo-add { display: flex; gap: 6px; margin-top: 10px; flex-shrink: 0; }
.todo-add input {
  flex: 1; padding: 9px 12px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px; color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 16px;
  outline: none; min-width: 0; transition: border-color .2s;
}
.todo-add input:focus { border-color: rgba(40,96,176,.5); }
.todo-empty { color: var(--muted); font-size: 12px; padding: 8px 4px; }

/* Card "+ Nova Coleção" — mesmo tamanho dos coll-cards (grid stretch) */
.add-coll-card {
  background:var(--surface); border:2px dashed var(--border);
  border-radius:var(--radius); padding:28px 16px; cursor:pointer;
  display:none; flex-direction:column; align-items:center; gap:8px;
  color:var(--muted); transition:border-color .2s, color .2s;
  justify-content:center; animation:slideUp .35s ease both;
}
/* Só aparece no modo edição */
.coll-edit-on .add-coll-card { display:flex; }
.add-coll-card:hover { border-color:var(--accent2); color:var(--steel); }
.add-coll-card .plus { font-size:24px; line-height:1; }

/* ═══════════════════════════════════════════════════
   FORMULÁRIOS — CAMPOS COMPARTILHADOS
═══════════════════════════════════════════════════ */
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block; font-size: 11px; color: var(--steel);
  margin-bottom: 5px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase;
}
.form-row input {
  width: 100%; padding: 11px 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px; color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 16px;
  outline: none; transition: border-color .2s, background .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}
.form-row input:focus {
  border-color: rgba(40,96,176,.6);
  background: rgba(255,255,255,.07);
  box-shadow: 0 0 0 3px rgba(40,96,176,.1);
}

/* ═══════════════════════════════════════════════════
   BOTÕES
═══════════════════════════════════════════════════ */
.btn-primary {
  width: 100%; padding: 16px; margin-top: 8px;
  background: linear-gradient(135deg, rgba(26,74,138,.95), rgba(40,96,176,.95));
  border: 1px solid rgba(60,120,200,.4);
  border-radius: 13px; color: white;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 17px; font-weight: 600;
  cursor: pointer; transition: all .25s; letter-spacing: .4px;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 4px 20px rgba(26,74,138,.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(26,74,138,.55);
  border-color: rgba(80,140,220,.5);
}
.btn-primary:active { transform: none; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-small {
  padding: 9px 14px; background: var(--accent); border: none;
  border-radius: 8px; color: white; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity .2s; flex-shrink: 0;
  min-width: 40px; min-height: 40px; /* toque mínimo */
}
.btn-small:hover { opacity: .85; }
.btn-cancel {
  width: 100%; padding: 11px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px; color: var(--muted);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 14px;
  cursor: pointer; transition: all .2s;
}
.btn-cancel:hover { color: var(--text); background: rgba(255,255,255,.07); }

/* ═══════════════════════════════════════════════════
   AVISOS DE AUTH
═══════════════════════════════════════════════════ */
.auth-error {
  background: rgba(184,48,48,.1); border: 1px solid rgba(184,48,48,.25);
  color: #c07070; padding: 10px 14px; border-radius: 8px;
  font-size: 13px; margin-top: 10px; display: none;
}
.auth-success {
  background: rgba(30,138,96,.1); border: 1px solid rgba(30,138,96,.25);
  color: #50a878; padding: 10px 14px; border-radius: 8px;
  font-size: 13px; margin-top: 10px; display: none;
}

/* ═══════════════════════════════════════════════════
   MODAIS
═══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 200;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 16px;
  animation: fadeIn .18s ease;
}
.modal-overlay.open { display: flex; }
.modal {
  background: rgba(10,15,24,0.90);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 20px; padding: 26px; width: 440px;
  max-width: calc(100vw - 32px);
  animation: slideUp .22s cubic-bezier(0.34,1.3,0.64,1);
  max-height: 90vh; overflow-y: auto;
  box-shadow:
    0 32px 80px rgba(0,0,0,.8),
    0 0 0 1px rgba(255,255,255,.04) inset,
    0 1px 0 rgba(255,255,255,.08) inset;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.modal h2 {
  font-family: 'Bebas Neue', sans-serif; font-size: 19px; letter-spacing: 2px;
  margin-bottom: 18px; color: var(--steel2);
}
.modal-options {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px;
}
/* No mobile, 2 colunas no grid de opções */
@media (max-width: 440px) {
  .modal-options { grid-template-columns: repeat(2, 1fr); }
}
.modal-option {
  padding: 14px 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 11px; cursor: pointer; text-align: center;
  transition: all .2s; font-size: 12px; font-weight: 500;
  min-height: 70px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.modal-option:hover {
  border-color: rgba(40,96,176,.55);
  background: rgba(26,74,138,.2);
  color: var(--steel2);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,.3);
}
.modal-option .opt-icon { font-size: 20px; display: block; margin-bottom: 5px; }
.modal-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.section-divider { border: none; border-top: 1px solid rgba(255,255,255,.06); margin: 20px 0; }
.modal-section-title {
  font-size: 11px; color: var(--muted); font-weight: 600;
  letter-spacing: .8px; text-transform: uppercase; margin-bottom: 12px;
}

/* Avatar de perfil */
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin: 0 auto 10px; color: white; font-weight: 700;
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 1px;
}

/* ═══════════════════════════════════════════════════
   COLEÇÕES — PÁGINA
═══════════════════════════════════════════════════ */
#btn-apps.active { background:rgba(30,80,144,.22); color:var(--accent3); }

/* ── Cabeçalho compartilhado: Apps, Links, Drive ──
   Ambos usam position:relative + título absoluto
   para garantir alinhamento idêntico entre telas.
─────────────────────────────────────────────────── */

/* Apps page — mesmo padrão do colls-header */
#apps-page { padding: 0 8px; }
.apps-header {
  display:flex; align-items:center; justify-content:center;
  height: 64px;
  margin-bottom: 32px;
  position: relative;
}
.apps-title {
  font-family:'Bebas Neue',sans-serif; font-size:36px; letter-spacing:4px;
  background:var(--chrome); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
  position:absolute; left:50%; top:50%; transform:translate(-50%, -40%);
  pointer-events:none; white-space:nowrap;
}

/* Cabeçalho das sub-páginas (Links, Drive) — idêntico aos Apps */
.colls-header {
  display:flex; align-items:center; justify-content:space-between;
  height: 64px;
  margin-bottom: 32px;
  position: relative;
  flex-shrink: 0;
}
.colls-title {
  font-family:'Bebas Neue',sans-serif; font-size:36px; letter-spacing:4px;
  background:var(--chrome); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
  position:absolute; left:50%; top:50%; transform:translate(-50%, -40%);
  pointer-events:none; white-space:nowrap;
}

/* Botão ← Apps (voltar) */
.links-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
  color: var(--steel);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; letter-spacing: .3px;
  transition: background .18s, border-color .18s, color .18s;
  flex-shrink: 0; z-index: 1;
}
.links-back-btn:hover {
  background: rgba(30,80,144,.18);
  border-color: rgba(40,96,176,.45);
  color: var(--accent3);
}
.links-back-btn svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

.btn-new-coll {
  display:flex; align-items:center; gap:7px;
  padding:9px 16px; border-radius:9px;
  background:rgba(30,80,144,.15); border:1px solid var(--accent2);
  color:var(--accent3); font-size:12px; font-weight:600; cursor:pointer;
  font-family:system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; transition:background .18s; letter-spacing:.3px;
  flex-shrink: 0; z-index: 1;
}
.btn-new-coll:hover { background:rgba(30,80,144,.28); }
.btn-new-coll svg { width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:2.5;
  stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }

/* Grid — align-items:stretch faz add-coll-card ter a mesma altura dos cards */
.collections-grid {
  display:grid; grid-template-columns:repeat(3,1fr);
  gap:var(--gap); align-items:stretch; width:100%; min-width:0;
}
@media (max-width:1060px) { .collections-grid { grid-template-columns:repeat(2,1fr); } }
@media (max-width:640px)  { .collections-grid { grid-template-columns:1fr; gap:12px; } }

/* ── Card de coleção ── */
.coll-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); overflow: hidden; min-width: 0;
  transition: border-color .28s, box-shadow .28s, transform .2s;
  animation: slideUp .35s ease both;
  display: flex; flex-direction: column;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.coll-card:hover {
  border-color: rgba(40,96,176,.38);
  box-shadow: 0 8px 32px rgba(0,0,0,.35), 0 0 20px rgba(42,96,176,.06);
  transform: translateY(-1px);
}
.coll-edit-on .coll-card { cursor:grab; }
.coll-edit-on .coll-card:active { cursor:grabbing; }

/* Faixa colorida no topo do card */
.coll-card-stripe {
  height:3px; background:linear-gradient(90deg, var(--accent2), var(--accent3));
  flex-shrink:0;
}

/* Header do card */
.coll-hdr {
  display:flex; align-items:center; padding:14px 14px 10px;
  gap:8px; flex-shrink:0;
}
.coll-hdr-left {
  display:flex; align-items:center; gap:9px; flex:1; min-width:0;
}
.coll-icon {
  width:32px; height:32px; border-radius:8px;
  background:rgba(190,150,60,.12); border:1px solid rgba(190,150,60,.18);
  display:flex; align-items:center; justify-content:center;
  font-size:15px; flex-shrink:0;
}
.coll-name {
  font-family:system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size:13px; font-weight:600;
  color:var(--steel2); flex:1; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  cursor:text; padding:3px 6px; border-radius:5px;
  transition:background .14s, color .14s; border:1px solid transparent;
}
.coll-name:hover { background:var(--surface2); color:var(--text); }
.coll-name:focus { outline:none; background:var(--surface2);
  border-color:var(--accent2); color:var(--text); white-space:normal; }

/* Botões header */
.coll-hdr-btns { display:flex; align-items:center; gap:2px; flex-shrink:0; }
.btn-ca {
  width:30px; height:30px; border-radius:7px;
  background:none; border:none; cursor:pointer;
  color:var(--muted); display:flex; align-items:center; justify-content:center;
  transition:color .15s, background .15s; flex-shrink:0;
}
.btn-ca:hover { color:var(--steel2); background:var(--surface2); }
.btn-ca.active { color:var(--accent3); background:rgba(30,80,144,.2); }
.btn-ca.del:hover { color:#e07070; background:rgba(184,48,48,.12); }
.btn-ca svg { width:14px; height:14px; stroke:currentColor; fill:none;
  stroke-width:2; stroke-linecap:round; stroke-linejoin:round; pointer-events:none; }

/* Linha divisória sutil */
.coll-divider { height:1px; background:var(--border); margin:0 14px; flex-shrink:0; }

/* Corpo com links */
.coll-body { padding:10px 14px 14px; display:flex; flex-direction:column; flex:1; }

/* Lista de links — mesmas classes .link-row, .link-item etc */
.coll-links {
  list-style:none; display:flex; flex-direction:column; gap:4px;
  flex:1; margin-bottom:10px;
  /* Lista colapsável */
  overflow:hidden; transition:max-height .3s ease, opacity .3s ease;
  max-height:2000px; opacity:1;
}
.coll-links.hidden { max-height:0; opacity:0; margin-bottom:0; }

/* Handle/Del controlados por .coll-editing no card */
.coll-card .link-handle { width:0; transition:width .18s; }
.coll-card.coll-editing .link-handle { width:28px; }
.coll-card .link-del    { width:0; transition:width .18s; }
.coll-card.coll-editing .link-del { width:36px; }
@media (max-width:640px) { .coll-card.coll-editing .link-del { width:44px; } }

.coll-empty {
  color:var(--muted); font-size:12px; padding:16px 4px;
  text-align:center; list-style:none;
}

/* Contador de links ocultos */
.coll-count {
  font-size:11px; color:var(--muted); text-align:center;
  padding:4px 0 2px; cursor:pointer;
  transition:color .15s;
}
.coll-count:hover { color:var(--steel); }

/* Botão + Adicionar link no rodapé */
.btn-coll-add {
  display:flex; align-items:center; justify-content:center; gap:6px;
  width:100%; padding:9px 12px; border-radius:9px; margin-top:2px;
  background:transparent; border:1px dashed var(--border2);
  color:var(--muted); font-size:12px; font-weight:500; cursor:pointer;
  transition:border-color .15s, color .15s, background .15s;
  font-family:system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; flex-shrink:0;
}
.btn-coll-add:hover { border-color:var(--accent2); color:var(--steel); background:rgba(30,80,144,.05); }
.btn-coll-add svg { width:13px; height:13px; stroke:currentColor; fill:none;
  stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; pointer-events:none; }
/* ── Drag de coleções ── */
.coll-card.coll-dragging  { opacity:.3; transform:scale(.98); transition:opacity .15s, transform .15s; }
.coll-card.coll-drag-over { border-color:var(--accent2); box-shadow:0 0 0 2px rgba(64,128,192,.22); }

/* Indicador de modo edição de coleções */
#coll-edit-banner {
  display:flex; align-items:center; gap:10px;
  border-radius:10px; margin-bottom:0;
  background:rgba(30,80,144,.12);
  color:var(--accent3); font-size:12px; font-weight:600; letter-spacing:.4px;
  font-family:system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  max-height:0; overflow:hidden; opacity:0;
  transition:max-height .28s ease, opacity .22s ease, margin .28s ease, padding .2s ease;
  pointer-events:none;
}
#coll-edit-banner.visible {
  max-height:60px; opacity:1; pointer-events:auto; margin-bottom:18px;
  padding:10px 16px; border:1px solid rgba(48,112,184,.35);
}
#coll-edit-banner svg { width:14px; height:14px; stroke:currentColor; fill:none;
  stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0;
  animation:bannerPulse 2s ease-in-out infinite; }
@keyframes bannerPulse {
  0%,100% { opacity:1; } 50% { opacity:.45; }
}
/* Cards ficam com borda tracejada animada no modo edição de coleções */
.coll-edit-on .coll-card {
  border-color:rgba(48,112,184,.45);
  box-shadow:0 0 0 1px rgba(48,112,184,.12);
}

/* ═══════════════════════════════════════════════════
   APPS — página lançador de atalhos
═══════════════════════════════════════════════════ */
#apps-page {
  display:none; padding:84px 18px 90px;
  max-width:1320px; margin:0 auto; width:100%; box-sizing:border-box;
}
#apps-page.visible { display:block; }

.apps-header {
  display:flex; align-items:center; justify-content:center;
  height: 64px;
  margin-bottom: 32px;
  position: relative;
}
.apps-title {
  font-family:'Bebas Neue',sans-serif; font-size:36px; letter-spacing:4px;
  background:var(--chrome); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
  position:absolute; left:50%; top:50%; transform:translate(-50%, -40%);
}

/* Grid de tiles estilo atalhos */
.apps-grid {
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap:16px;
  align-items:start;
}
@media (max-width:640px) {
  .apps-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap:12px; }
}

/* Cada tile */
.app-tile {
  display:flex; flex-direction:column; align-items:center; gap:10px;
  padding:20px 10px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  cursor:pointer; user-select:none;
  transition: border-color .22s, box-shadow .22s, transform .18s, background .18s;
  animation: slideUp .35s ease both;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  position:relative; overflow:hidden;
}
.app-tile::before {
  content:'';
  position:absolute; top:0; left:10%; right:10%; height:1px;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.12),transparent);
  pointer-events:none;
}
@media (hover:hover) and (pointer:fine) {
  .app-tile:hover {
    border-color: rgba(40,96,176,.5);
    box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 0 24px rgba(42,96,176,.1);
    transform: translateY(-4px) scale(1.03);
    background: rgba(20,40,80,.35);
  }
}
.app-tile:active {
  transform: scale(.96) !important;
  transition-duration: .08s;
}

/* Ícone do tile */
.app-tile-icon {
  width:52px; height:52px; border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  font-size:24px; flex-shrink:0;
  background: rgba(30,80,144,.18);
  border: 1px solid rgba(40,96,176,.25);
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  transition: box-shadow .22s;
}
.app-tile:hover .app-tile-icon {
  box-shadow: 0 6px 24px rgba(42,96,176,.3);
}

/* Label do tile */
.app-tile-label {
  font-family:system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size:12px; font-weight:600;
  color: var(--steel2); letter-spacing:.3px;
  text-align:center; line-height:1.3;
}

/* ═══════════════════════════════════════════════════
   LINKS — página (ex-Coleções), com header de retorno
═══════════════════════════════════════════════════ */
#links-page {
  display:none; padding:84px 18px 90px;
  max-width:1320px; margin:0 auto; width:100%; box-sizing:border-box;
}
#links-page.visible { display:block; }

/* Botão voltar para Apps - Visual Premium */
.links-back-btn {
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 18px 10px 14px; border-radius:12px;
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--steel); 
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer; letter-spacing: .4px;
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1); 
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1), inset 0 1px 1px rgba(255,255,255,0.05);
}
.links-back-btn:hover { 
  background: rgba(40,96,176,.18); 
  border-color: var(--accent2); 
  color: var(--steel2);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2), 0 0 0 1px rgba(40,96,176,0.2);
}
.links-back-btn:active {
  transform: translateY(0);
  background: rgba(40,96,176,.25);
}
.links-back-btn svg { width:14px; height:14px; stroke:currentColor; fill:none;
  stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }

/* ═══════════════════════════════════════════════════
   VAULT — modal de acesso emergencial
   Sem nenhuma pista no HTML que existe
═══════════════════════════════════════════════════ */
#modal-vault .modal {
  border-color: rgba(140,40,40,.4);
  background: #0b0d12;
}
#modal-vault .modal h2 {
  color: #b06060;
  letter-spacing: 3px;
}
.vault-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
}
.vault-header-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: rgba(140,40,40,.2); border: 1px solid rgba(140,40,40,.35);
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.vault-title-wrap { flex: 1; }
.vault-title-wrap h2 { margin-bottom: 2px; }
.vault-subtitle {
  font-size: 11px; color: var(--muted); letter-spacing: .5px;
  font-family: 'JetBrains Mono', monospace;
}
/* Temporizador de auto-fechamento */
.vault-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: rgba(140,40,40,.7);
  text-align: right; margin-bottom: 14px; letter-spacing: 1px;
}
.vault-timer.warning { color: #c06060; }
/* Lista de itens */
.vault-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; max-height: 340px; overflow-y: auto; }
.vault-item {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px; padding: 10px 12px;
  transition: border-color .15s;
}
.vault-item:hover { border-color: rgba(140,40,40,.3); }
.vault-item-icon {
  width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0;
  background: rgba(140,40,40,.15); border: 1px solid rgba(140,40,40,.2);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.vault-item-body { flex: 1; min-width: 0; }
.vault-item-label {
  font-size: 13px; font-weight: 600; color: #c0a0a0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vault-item-url {
  font-size: 11px; color: var(--muted); font-family: 'JetBrains Mono', monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px;
}
.vault-item-note {
  font-size: 11px; color: rgba(160,120,120,.8); margin-top: 3px;
  white-space: pre-wrap; word-break: break-word;
}
.vault-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.btn-vault-open {
  padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 600;
  background: rgba(30,60,100,.3); border: 1px solid rgba(60,100,150,.3);
  color: var(--steel); cursor: pointer; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  transition: all .15s; white-space: nowrap;
}
.btn-vault-open:hover { background: rgba(30,60,100,.5); color: var(--steel2); }
.btn-vault-del {
  width: 28px; height: 28px; border-radius: 6px; font-size: 13px;
  background: none; border: 1px solid transparent; color: var(--muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.btn-vault-del:hover { background: rgba(140,40,40,.2); color: #c07070; border-color: rgba(140,40,40,.3); }
/* Formulário de adicionar item */
.vault-add-form {
  background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px; padding: 14px; display: none; flex-direction: column; gap: 8px;
  margin-bottom: 12px;
}
.vault-add-form.open { display: flex; }
.vault-add-form .form-row { margin-bottom: 0; }
.vault-add-form .form-row label { color: rgba(160,120,120,.8); font-size: 11px; }
.vault-add-form input, .vault-add-form textarea {
  background: rgba(0,0,0,.3); border-color: rgba(140,40,40,.25); color: #c0a0a0;
}
.vault-add-form input:focus, .vault-add-form textarea:focus {
  border-color: rgba(140,40,40,.6);
}
.vault-add-form textarea {
  width: 100%; background: rgba(0,0,0,.3); border: 1px solid rgba(140,40,40,.25);
  border-radius: 8px; color: #c0a0a0; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 13px;
  padding: 9px 12px; resize: none; outline: none; min-height: 60px; line-height: 1.5;
  transition: border-color .15s;
}
.vault-add-form textarea:focus { border-color: rgba(140,40,40,.6); }
.vault-add-btns { display: flex; gap: 7px; }
.btn-vault-confirm {
  flex: 1; padding: 10px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: rgba(140,40,40,.25); border: 1px solid rgba(140,40,40,.4);
  color: #c08080; cursor: pointer; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; transition: all .15s;
}
.btn-vault-confirm:hover { background: rgba(140,40,40,.4); color: #e0a0a0; }
.btn-vault-cancel-add {
  padding: 10px 16px; border-radius: 8px; font-size: 13px;
  background: none; border: 1px solid rgba(255,255,255,.07);
  color: var(--muted); cursor: pointer; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; transition: all .15s;
}
.btn-vault-cancel-add:hover { color: var(--text); }
/* Botão abrir form */
.btn-vault-add {
  width: 100%; padding: 10px; border-radius: 9px; font-size: 12px; font-weight: 500;
  background: transparent; border: 1px dashed rgba(140,40,40,.3);
  color: rgba(140,40,40,.6); cursor: pointer; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  transition: all .15s; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-vault-add:hover { border-color: rgba(140,40,40,.6); color: #b06060; }
.vault-empty {
  text-align: center; padding: 24px; color: var(--muted); font-size: 12px;
}

/* ═══════════════════════════════════════════════════
   ANIMAÇÕES
═══════════════════════════════════════════════════ */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(42,96,176,0); }
  50%      { box-shadow: 0 0 20px 4px rgba(42,96,176,.15); }
}
/* Transição suave entre páginas */
.main-content, #apps-page, #links-page {
  animation: fadeIn .22s ease both;
}
#auth-screen { transition: opacity .4s, transform .4s; }
#auth-screen.hide { opacity: 0; transform: scale(.97); pointer-events: none; }
#app-screen { animation: fadeIn .35s ease; }

/* Stagger blocos fixos */
#bloco-links { animation-delay: .04s; }
#bloco-clock { animation-delay: .09s; }
#bloco-tasks { animation-delay: .14s; }
#bloco-notes { animation-delay: .19s; }

/* Stagger collection cards */
.coll-card:nth-child(1) { animation-delay: .04s; }
.coll-card:nth-child(2) { animation-delay: .09s; }
.coll-card:nth-child(3) { animation-delay: .14s; }
.coll-card:nth-child(4) { animation-delay: .19s; }
.coll-card:nth-child(5) { animation-delay: .24s; }
.coll-card:nth-child(6) { animation-delay: .29s; }

/* ═══════════════════════════════════════════════════
   DRIVE - Definido ANTES do Mobile para evitar override
═══════════════════════════════════════════════════ */
#drive-page {
  display:none; padding:84px 18px 100px;
  max-width:1320px; margin:0 auto; width:100%; box-sizing:border-box;
  animation: fadeIn .25s ease;
}

.btn-drive-action {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  background: rgba(26,74,138,.18);
  border: 1px solid rgba(40,96,176,.35);
  border-radius: var(--radius-sm);
  color: var(--steel2);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.btn-drive-action:hover { border-color: var(--accent2); background: rgba(26,74,138,.3); color: #fff; }

/* Breadcrumb */
.drive-breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  margin: 12px 0 8px;
}
.drive-crumb {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 13px; padding: 3px 6px;
  border-radius: 5px; transition: color .15s, background .15s;
}
.drive-crumb:hover { color: var(--steel2); background: var(--surface2); }
.drive-crumb-root { color: var(--steel); }
.drive-crumb-sep { color: var(--muted); font-size: 12px; user-select: none; }
.drive-crumb-cur { color: var(--steel2); font-weight: 600; cursor: default; }

/* Quota */
.drive-quota-wrap {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.drive-quota-bar {
  flex: 1; height: 4px;
  background: var(--surface2); border-radius: 2px; overflow: hidden;
}
.drive-quota-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  transition: width .5s ease;
}
.drive-quota-label {
  font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0;
}

/* Drop zone */
.drive-drop-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px;
  text-align: center;
  color: var(--muted); font-size: 13px;
  cursor: default; transition: border-color .2s, background .2s;
  margin-bottom: 16px;
}
.drive-drop-zone.drag-active {
  border-color: var(--accent2);
  background: rgba(26,74,138,.08);
}
.drive-upload-link {
  background: none; border: none; color: var(--accent3);
  font-family: inherit; font-size: inherit; cursor: pointer;
  text-decoration: underline; padding: 0;
}
.drive-upload-link:hover { color: var(--steel2); }
.drive-drop-hint { font-size: 11px; color: var(--border2); }

/* Upload progress */
.drive-uploads { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.drive-up-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border-radius: 9px; padding: 9px 13px;
  font-size: 12px; color: var(--steel);
}
.drive-up-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-up-bar-wrap { width: 100px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.drive-up-bar { height: 100%; background: var(--accent3); transition: width .1s; }
.drive-up-status { width: 60px; text-align: right; flex-shrink: 0; }
.drive-up-status.ok   { color: var(--success); }
.drive-up-status.err  { color: var(--danger);  }

/* File grid */
.drive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

/* File/folder card */
.drive-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 10px 10px;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; cursor: pointer;
  transition: border-color .18s, background .18s, transform .15s;
  position: relative; overflow: hidden; min-width: 0;
  animation: slideUp .25s ease;
}
.drive-card:hover {
  border-color: rgba(40,96,176,.4);
  background: rgba(15,22,36,.9);
  transform: translateY(-2px);
}
.drive-card-icon { font-size: 32px; line-height: 1; }
.drive-card-name {
  font-size: 11px; color: var(--text); text-align: center;
  width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drive-card-meta { font-size: 10px; color: var(--muted); }
.drive-card-actions {
  position: absolute; top: 6px; right: 6px;
  display: flex; gap: 3px; opacity: 0; transition: opacity .15s;
}
.drive-card:hover .drive-card-actions { opacity: 1; }
.btn-drive-card {
  width: 22px; height: 22px; border-radius: 5px;
  background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.1);
  color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
}
.btn-drive-card:hover { color: var(--steel2); border-color: var(--accent2); }
.btn-drive-card svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.btn-drive-card.del:hover { color: #e07070; border-color: rgba(192,60,60,.5); }

.drive-empty {
  grid-column: 1 / -1;
  text-align: center; color: var(--muted); font-size: 13px; padding: 32px 0;
}

/* ═══════════════════════════════════════════════════
   MOBILE — AJUSTES FINOS (320px – 480px)
═══════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Topbar mais compacta */
  .topbar { padding: 0 14px; height: 50px; gap: 8px; }
  .topbar-time { font-size: 11px; padding: 3px 8px; }

  /* Dock mobile — menor */
  .bottom-dock { bottom: 14px; gap: 2px; padding: 6px 8px; border-radius: 18px; }
  .dock-btn { width: 38px; height: 38px; border-radius: 11px; }
  .dock-btn svg { width: 15px; height: 15px; }
  .dock-btn::after { display: none; } /* sem tooltip no mobile */
  /* Edit button revelado no mobile — mesma altura/largura dos demais */
  #btn-edit-mode.dock-revealed { width: 38px; padding: 0; }

  /* Auth card mais espaçado */
  .auth-card { padding: 30px 20px; border-radius: 18px; }

  /* Conteúdo principal */
  .main-content {
    padding-top: 64px;
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: 80px;
  }
  #apps-page, #links-page, #drive-page { padding: 64px 12px 80px; }

  /* Saudação */
  .dash-greeting { font-size: 14px; margin-bottom: 16px; }

  /* Blocos com padding mais generoso no mobile */
  .bloco { padding: 16px 14px 13px; min-height: 220px; }

  /* Relógio maior para ler de longe */
  .clock-time { font-size: 66px; }
  .clock-date { font-size: 13px; }

  /* Notas com fonte maior */
  .notes-area { font-size: 15px; min-height: 110px; }

  /* Modal: alinhar ao topo em mobile para não cortar conteúdo longo */
  .modal-overlay { align-items: flex-start; padding: 10px 10px 20px; }
  .modal { padding: 18px 15px; border-radius: 16px; width: 100%; max-width: 100%; max-height: calc(100dvh - 30px); }
  .modal h2 { font-size: 17px; margin-bottom: 12px; }

  /* Configurações: compactar form-rows */
  #modal-settings .form-row { margin-bottom: 10px; }
  #modal-settings .form-row label { font-size: 11px; }
  #modal-settings .form-row input { padding: 8px 11px; font-size: 14px; }
  #modal-settings .profile-avatar { width: 44px; height: 44px; font-size: 18px; margin-bottom: 8px; }
  #modal-settings hr { margin: 14px 0; }

  /* IO buttons em coluna no mobile */
  .settings-io { flex-direction: column; gap: 8px; }
  .btn-io { min-width: 0; }
  /* Drive Specific Mobile */
  .drive-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  #drive-page { padding-left: 12px; padding-right: 12px; }
}

/* Telas muito pequenas — 320px */
@media (max-width: 340px) {
  .topbar-brand-cloud { display: none; }
  .topbar-time { font-size: 10px; padding: 3px 7px; }
  .clock-time { font-size: 58px; }
  .bloco { padding: 13px 11px 10px; }
}

/* ═══════════════════════════════════════════════════
   MOBILE — Ajustes de dock e fluidez
═══════════════════════════════════════════════════ */
@media (pointer: coarse) {
  .bottom-dock {
    gap: 6px; padding: 8px 12px; bottom: 20px;
  }
  .dock-btn {
    width: 48px; height: 48px; border-radius: 14px;
  }
  .dock-btn svg { width: 18px; height: 18px; }
  .dock-sep { height: 28px; margin: 0 3px; }
  #btn-edit-mode.dock-revealed { width: 48px; padding: 0; }

  .topbar {
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  }
  .bottom-dock {
    backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  }

  .coll-links, .bloco-notes-content, .modal-sheet, #drive-list, .main-content {
    -webkit-overflow-scrolling: touch;
  }

  .dock-btn:active {
    transform: scale(0.92) !important;
    transition-duration: .07s !important;
  }
  .dock-btn::after { display: none; }
}
