    /* Melhorias Mobile / Safari iOS */
    html, body {
      -webkit-text-size-adjust: 100%;
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation; /* Evita atrasos de clique e zoom acidental */
    }
    .pb-safe { padding-bottom: max(0.75rem, env(safe-area-inset-bottom)); }

    .animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .perspective-1000 { perspective: 1000px; }
    .preserve-3d { transform-style: preserve-3d; }
    .backface-hidden { backface-visibility: hidden; }
    .rotate-y-180 { transform: rotateY(180deg); }
    
    body.modal-open { overflow: hidden; }
    .word-token {
      cursor: pointer;
      padding: 0px 4px;
      border-radius: 4px;
      transition: background-color 0.2s;
    }
    .word-known {
      color: #4f46e5; background-color: #e0e7ff; font-weight: 500;
    }
    .word-known:hover { background-color: #c7d2fe; }
    .word-new:hover { background-color: #fef3c7; border-bottom: 2px solid #fcd34d;} 
    
    /* Palavras já vistas (Passivas no Banco) */
    .word-seen { color: #0d9488; background-color: #ccfbf1; font-weight: 500; transition: all 0.2s; }
    .word-seen:hover { background-color: #99f6e4; border-bottom: 2px solid #2dd4bf; }
    
    /* Palavras no Flashcard (Ativas) */
    .word-learning { color: #4f46e5; background-color: #e0e7ff; font-weight: 700; border-bottom: 2px dashed #818cf8; transition: all 0.2s; }
    .word-learning:hover { background-color: #c7d2fe; }
    
    /* Netflix Scroll Hide */
    .hide-scrollbar::-webkit-scrollbar { display: none; }
    .hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

    /* Torna a cor de seleção durante o arrastar igual ao tema do app */
    ::selection { background-color: #c7d2fe; color: #312e81; }

    /* Animação do Card Inferior (Bottom Sheet) */
    @keyframes slideUp {
      from { transform: translateY(100%); }
      to { transform: translateY(0); }
    }
    .animate-slide-up { animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

    /* --- HUB / NOVA NAVEGAÇÃO --- */
    .nav-link {
      padding: 0.5rem 0.8rem;
      border-radius: 0.8rem;
      font-size: 0.8125rem;
      font-weight: 700;
      color: #64748b;
      transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
    }
    .nav-link:hover { color: #4f46e5; background: #fff; }
    .nav-link.is-active { color: #4f46e5; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }

    .mobile-nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 0.35rem 0.9rem;
      border-radius: 0.8rem;
      color: #94a3b8;
      transition: color 0.2s, transform 0.15s;
    }
    .mobile-nav-item.is-active { color: #4f46e5; }
    .mobile-nav-item:active { transform: scale(0.95); }

    .stat-card {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 0.1rem;
      padding: 0.7rem;
      border-radius: 1.15rem;
      border: 1px solid #e2e8f0;
      background: #fff;
      transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
    }
    .stat-card:hover { box-shadow: 0 10px 25px -18px rgba(15, 23, 42, 0.5); border-color: #c7d2fe; }
    .stat-card:active { transform: scale(0.97); }
    .stat-card__icon {
      width: 1.9rem;
      height: 1.9rem;
      border-radius: 0.7rem;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 0.15rem;
    }
    .stat-card__value { font-size: 1.45rem; line-height: 1.1; font-weight: 900; color: #1e293b; }
    .stat-card__label {
      font-size: 0.58rem;
      font-weight: 800;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: #94a3b8;
    }
    .stat-card--indigo .stat-card__icon { background: #eef2ff; color: #4f46e5; }
    .stat-card--emerald .stat-card__icon { background: #ecfdf5; color: #059669; }
    .stat-card--amber .stat-card__icon { background: #fffbeb; color: #d97706; }

    .hub-tile {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      justify-content: flex-end;
      min-height: 7.6rem;
      padding: 1rem;
      border-radius: 1.5rem;
      text-align: left;
      overflow: hidden;
      box-shadow: 0 12px 30px -24px rgba(15, 23, 42, 0.6);
      transition: transform 0.18s ease, box-shadow 0.25s ease, border-color 0.2s;
    }
    .hub-tile::after {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 55%);
      pointer-events: none;
    }
    .hub-tile:hover { transform: translateY(-3px); box-shadow: 0 24px 45px -30px rgba(15, 23, 42, 0.55); }
    .hub-tile:active { transform: scale(0.98); }
    .hub-tile__icon {
      width: 2.55rem;
      height: 2.55rem;
      border-radius: 0.9rem;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(255, 255, 255, 0.16);
      margin-bottom: auto;
    }
    .hub-tile__title { font-size: 0.98rem; font-weight: 900; line-height: 1.15; margin-top: 0.7rem; }
    .hub-tile__desc { font-size: 0.68rem; font-weight: 600; opacity: 0.78; margin-top: 0.1rem; }
    .hub-tile__arrow { position: absolute; bottom: 1rem; right: 1rem; opacity: 0.6; }
    .hub-tile__badge {
      position: absolute;
      top: 0.8rem;
      right: 0.8rem;
      min-width: 1.5rem;
      height: 1.5rem;
      padding: 0 0.4rem;
      border-radius: 999px;
      background: #fff;
      color: #4f46e5;
      font-size: 0.7rem;
      font-weight: 900;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .hub-tile__badge--light { background: #eef2ff; color: #4338ca; }

    .vocab-tab {
      flex: 1;
      padding: 0.55rem 0.5rem;
      border-radius: 0.85rem;
      font-size: 0.8rem;
      font-weight: 800;
      color: #94a3b8;
      transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
    }
    .vocab-tab:hover { color: #4f46e5; }
    .vocab-tab.is-active { background: #4f46e5; color: #fff; box-shadow: 0 8px 18px -12px rgba(79, 70, 229, 0.9); }

    @media (min-width: 768px) {
      .stat-card { padding: 1rem; border-radius: 1.35rem; }
      .stat-card__value { font-size: 2rem; }
      .stat-card__label { font-size: 0.68rem; }
      .hub-tile { min-height: 10.5rem; padding: 1.25rem; border-radius: 1.75rem; }
      .hub-tile__icon { width: 3rem; height: 3rem; }
      .hub-tile__title { font-size: 1.18rem; }
      .hub-tile__desc { font-size: 0.8rem; }
    }

    /* --- SCRIPTORIUM / VOCATYPE --- */
    .sc-source {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0.15rem;
      padding: 0.7rem 0.5rem;
      border-radius: 1rem;
      border: 1px solid #e2e8f0;
      background: #fff;
      color: #94a3b8;
      font-size: 0.78rem;
      font-weight: 800;
    }
    .sc-source small {
      font-size: 0.5rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #cbd5e1;
      font-weight: 800;
    }
    .sc-source--active {
      border-color: #ddd6fe;
      background: #f5f3ff;
      color: #7c3aed;
      box-shadow: 0 10px 24px -20px rgba(124, 58, 237, 0.8);
    }

    .sc-target {
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
      line-height: 1.9;
      letter-spacing: 0.01em;
      word-break: break-word;
    }
    .sc-char { white-space: pre; transition: color 0.12s ease, background-color 0.12s ease; }
    .sc-char--pending { color: #64748b; }
    .sc-char--ok { color: #0d9488; font-weight: 700; }
    .sc-char--bad { color: #e11d48; background: #ffe4e6; border-radius: 4px; font-weight: 700; }
    .sc-char--punct { color: #94a3b8; }
    .sc-char--masked { color: #cbd5e1; }
    .sc-caret {
      display: inline-block;
      width: 2px;
      height: 1.2em;
      background: #4f46e5;
      margin: 0 1px;
      vertical-align: -0.15em;
      border-radius: 2px;
      animation: scBlink 1s steps(1) infinite;
    }
    @keyframes scBlink { 50% { opacity: 0; } }

    .sc-input {
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    }
    .sc-shake { animation: scShake 0.32s ease-in-out; }
    @keyframes scShake {
      0%, 100% { transform: translateX(0); }
      20% { transform: translateX(-6px); }
      40% { transform: translateX(6px); }
      60% { transform: translateX(-4px); }
      80% { transform: translateX(4px); }
    }
    .sc-target--success { animation: scSuccess 0.5s ease; }
    @keyframes scSuccess {
      0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35); }
      100% { box-shadow: 0 0 0 14px rgba(16, 185, 129, 0); }
    }

    #sc-player, #sc-player iframe { width: 100% !important; height: 100% !important; }


