:root {
      --bg-canvas: #0F1117;
      --bg-surface: #18181B;
      --bg-sidebar: #141416;
      --bg-subtle: #1E1E22;
      --bg-hover: #26262B;
      --bg-active: #2D2D33;
      
      --border-hairline: rgba(255, 255, 255, 0.05);
      --border-subtle: rgba(255, 255, 255, 0.08);
      --border-focus: #F59E0B;
      
      --text-primary: #FFFFFF;
      --text-secondary: #A1A1AA;
      --text-tertiary: #71717A;
      --text-muted: #52525B;
      
      --brand-blue: #3B82F6;
      --brand-blue-soft: rgba(59, 130, 246, 0.15);
      --brand-blue-hover: #D97706;
      --brand-amber: #FF9F0A;
      --brand-amber-soft: rgba(255, 159, 10, 0.15);
      
      --state-danger: #EF4444;
      --state-danger-soft: rgba(239, 68, 68, 0.15);
      --state-warning: #F59E0B;
      --state-warning-soft: rgba(245, 158, 11, 0.15);
      --state-success: #10B981;
      --state-success-soft: rgba(16, 185, 129, 0.15);
      
      --radius-sm: 6px;
      --radius-md: 10px;
      --radius-lg: 14px;
      --radius-full: 9999px;
      
      --font-ui: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
      --font-mono: "JetBrains Mono", Menlo, monospace;
      
      --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
      --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
      --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.60);

      /* DEFAULT ACCENT TOKENS (OLED ELECTRIC BLUE) */
      --brand-accent: #0066FF;
      --brand-accent-hover: #0052CC;
      --brand-accent-text: #FFFFFF;
      --brand-accent-shadow: rgba(0, 102, 255, 0.35);
      --segment-active-bg: #1A2333;
      --segment-active-border: rgba(0, 102, 255, 0.6);
      --segment-active-text: #FFFFFF;
    }

    /* THEME PC: OBSIDIAN (PURE OLED DARK WITH ELECTRIC BLUE ACCENT) */
    [data-theme="obsidian"], body[data-theme="obsidian"] {
      --bg-canvas: #08080C;
      --bg-surface: #101016;
      --bg-sidebar: #0C0C10;
      --bg-subtle: #161620;
      --bg-hover: #1E1E2C;
      --bg-active: #27273A;
      --border-hairline: rgba(255, 255, 255, 0.06);
      --border-subtle: rgba(255, 255, 255, 0.12);
      --text-primary: #FFFFFF;
      --text-secondary: #94A3B8;
      --text-tertiary: #64748B;
      --brand-blue: #0066FF;
      --brand-blue-hover: #0052CC;
      --brand-blue-soft: rgba(0, 102, 255, 0.15);

      /* TOKENS MÀU OBSIDIAN (CHUẨN OLED ELECTRIC BLUE) */
      --brand-accent: #0066FF;
      --brand-accent-hover: #0052CC;
      --brand-accent-text: #FFFFFF;
      --brand-accent-shadow: rgba(0, 102, 255, 0.35);
      --segment-active-bg: #1A2333;
      --segment-active-border: rgba(0, 102, 255, 0.6);
      --segment-active-text: #FFFFFF;
    }

    /* THEME PC: TITANIUM (SLATE COOL DARK) */
    [data-theme="titanium"], body[data-theme="titanium"] {
      --bg-canvas: #0F172A;
      --bg-surface: #1E293B;
      --bg-sidebar: #141E33;
      --bg-subtle: #27354E;
      --bg-hover: #334464;
      --bg-active: #3E537B;
      --border-hairline: rgba(148, 163, 184, 0.12);
      --border-subtle: rgba(148, 163, 184, 0.22);
      --text-primary: #F8FAFC;
      --text-secondary: #CBD5E1;
      --text-tertiary: #94A3B8;
      --brand-blue: #38BDF8;
      --brand-blue-hover: #0EA5E9;
      --brand-blue-soft: rgba(56, 189, 248, 0.16);

      /* TOKENS MÀU TITANIUM */
      --brand-accent: #38BDF8;
      --brand-accent-hover: #0EA5E9;
      --brand-accent-text: #0F172A;
      --brand-accent-shadow: rgba(56, 189, 248, 0.35);
      --segment-active-bg: #27354E;
      --segment-active-border: rgba(56, 189, 248, 0.5);
      --segment-active-text: #F8FAFC;
    }

    /* THEME PC: WARM AMBER (ESPRESSO COMFORT) */
    [data-theme="warm"], body[data-theme="warm"] {
      --bg-canvas: #1C1917;
      --bg-surface: #292524;
      --bg-sidebar: #221E1C;
      --bg-subtle: #38332F;
      --bg-hover: #463E38;
      --bg-active: #574D45;
      --border-hairline: rgba(245, 158, 11, 0.12);
      --border-subtle: rgba(245, 158, 11, 0.22);
      --text-primary: #FEF3C7;
      --text-secondary: #FDE68A;
      --text-tertiary: #D97706;
      --brand-blue: #F59E0B;
      --brand-blue-hover: #D97706;
      --brand-blue-soft: rgba(245, 158, 11, 0.18);

      /* TOKENS MÀU WARM AMBER (ĐỒNG BỘ TOÀN DIỆN CHO NÚT BẤM) */
      --brand-accent: #F59E0B;
      --brand-accent-hover: #D97706;
      --brand-accent-text: #1C1917;
      --brand-accent-shadow: rgba(245, 158, 11, 0.38);
      --border-focus: #F59E0B;
      --segment-active-bg: #3E3228;
      --segment-active-border: #F59E0B;
      --segment-active-text: #FEF3C7;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-font-smoothing: antialiased;
    }

    body {
      font-family: var(--font-ui);
      background-color: var(--bg-canvas);
      color: var(--text-primary);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      overflow-x: hidden;
      line-height: 1.55;
      font-size: 15px;
    }

    
    /* ==========================================================================
       DESIGN 3 TOPBAR & DESIGN 1 CONTENT SEARCH (ISOLATED WORKSPACES)
       ========================================================================== */
    .top-nav {
      min-height: 60px;
      height: calc(60px + env(safe-area-inset-top, 0px));
      padding-top: env(safe-area-inset-top, 0px);
      box-sizing: border-box;
      background: #111114;
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-bottom: 1px solid rgba(255, 255, 255, 0.09);
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      padding-left: max(24px, env(safe-area-inset-left));
      padding-right: max(24px, env(safe-area-inset-right));
      position: sticky;
      top: 0;
      z-index: 40;
    }

    .nav-left {
      display: flex;
      align-items: center;
      justify-self: start;
    }

    .menu-stagger-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 34px;
      height: 34px;
      background-color: transparent;
      border: none;
      cursor: pointer;
      padding: 0;
      color: #94A3B8;
      border-radius: 6px;
      transition: all 0.15s ease;
      flex-shrink: 0;
    }

    .menu-stagger-btn:hover {
      background-color: rgba(255, 255, 255, 0.08);
      color: #FFFFFF;
    }

    .menu-stagger-btn:focus,
    .menu-stagger-btn:focus-visible {
      outline: none !important;
      box-shadow: none !important;
    }

    .nav-center {
      display: flex;
      align-items: center;
      justify-content: center;
      justify-self: center;
    }

    .nav-tools {
      display: flex;
      align-items: center;
      justify-self: end;
    }

    /* DESIGN 3: USER BLOCK */
    .user-menu-wrapper {
      position: relative;
      display: inline-block;
    }

    .d3-user-block {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 5px 12px 5px 5px;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.10);
      cursor: pointer;
      transition: all 0.15s ease;
      user-select: none;
    }

    .d3-user-block:hover {
      background: rgba(255, 255, 255, 0.08);
      border-color: rgba(255, 255, 255, 0.18);
      transform: translateY(-1px);
    }

    .d3-user-avatar {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: var(--brand-accent, #F59E0B);
      color: var(--brand-accent-text, #FFFFFF);
      font-size: 0.72rem;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 2px solid rgba(255, 255, 255, 0.22);
      letter-spacing: 0.02em;
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
      box-shadow: 0 1px 4px var(--brand-accent-shadow, rgba(0, 0, 0, 0.3));
      flex-shrink: 0;
      transition: background 0.25s ease;
    }

    .d3-user-avatar.large {
      width: 40px;
      height: 40px;
      font-size: 1rem;
    }

    .d3-user-avatar.xlarge {
      width: 56px;
      height: 56px;
      font-size: 1.35rem;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    .user-name-label {
      font-size: 0.86rem;
      font-weight: 600;
      color: #FFFFFF;
      max-width: 120px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .user-chevron-icon {
      color: #64748B;
      transition: transform 0.2s ease;
    }

    .user-menu-wrapper.active .user-chevron-icon {
      transform: rotate(180deg);
    }

    /* USER DROPDOWN PANEL */
    .user-dropdown-panel {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      width: 270px;
      background: #18181B;
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 14px;
      box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.04);
      padding: 12px;
      display: none;
      flex-direction: column;
      z-index: 100;
      animation: dropdownFadeIn 0.15s ease-out forwards;
    }

    .user-dropdown-panel.open {
      display: flex !important;
    }

    @keyframes dropdownFadeIn {
      from { opacity: 0; transform: translateY(-4px) scale(0.98); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .user-dropdown-header {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 4px 4px 8px;
    }

    .user-info-text {
      min-width: 0;
      flex: 1;
    }

    .user-dropdown-name {
      font-size: 0.95rem;
      font-weight: 700;
      color: #FFFFFF;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .user-dropdown-badge {
      font-size: 0.74rem;
      color: #10B981;
      font-weight: 600;
      margin-top: 2px;
    }

    .user-dropdown-divider {
      height: 1px;
      background: rgba(255, 255, 255, 0.08);
      margin: 8px 0;
    }

    .user-dropdown-section-title {
      font-size: 0.68rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: rgba(255, 255, 255, 0.45);
      padding: 4px 6px;
    }

    .user-list-scroll {
      max-height: 180px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .user-item-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 6px 8px;
      border-radius: 8px;
      cursor: pointer;
      transition: background 0.12s ease;
    }

    .user-item-row:hover {
      background: rgba(255, 255, 255, 0.06);
    }

    .user-item-row.active { background: rgba(245, 158, 11, 0.15); }

    .user-item-left {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      flex: 1;
    }

    .user-item-name {
      font-size: 0.85rem;
      font-weight: 500;
      color: #E2E8F0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .user-item-row.active .user-item-name {
      font-weight: 700;
      color: var(--brand-accent, #F59E0B);
    }

    .user-delete-btn {
      background: none;
      border: none;
      color: rgba(255, 255, 255, 0.35);
      cursor: pointer;
      padding: 2px;
      border-radius: 4px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: color 0.12s ease;
    }

    .user-delete-btn:hover {
      color: #EF4444;
    }

    .user-dropdown-actions {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .user-dropdown-action-btn {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      padding: 8px 10px;
      border-radius: 8px;
      border: none;
      background: transparent;
      color: #94A3B8;
      font-size: 0.82rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.12s ease;
    }

    .user-dropdown-action-btn:hover {
      background: rgba(255, 255, 255, 0.07);
      color: #FFFFFF;
    }

    /* DESIGN 1: CONTENT SEARCH BOX DOWN BELOW */
    .content-toolbar-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      flex-shrink: 1;
    }

    .content-search-box {
      position: relative;
      width: 240px;
      flex-shrink: 0;
    }

    .content-search-box svg {
      position: absolute;
      left: 11px;
      top: 11px;
      color: #64748B;
      pointer-events: none;
    }

    .content-search-box input {
      width: 100%;
      height: 38px;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.10);
      border-radius: 8px;
      padding: 0 14px 0 34px;
      font-size: 0.85rem;
      color: #FFFFFF;
      outline: none;
      transition: all 0.15s ease;
    }

    .content-search-box input:focus {
      background: rgba(255, 255, 255, 0.07);
      border-color: var(--brand-accent, #F59E0B);
      box-shadow: 0 0 0 2px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
    }

    .content-search-box input::placeholder {
      color: #64748B;
    }

    .color-dot {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      border: 2px solid transparent;
      cursor: pointer;
      transition: transform 0.15s ease, border-color 0.15s ease;
    }

    .color-dot:hover {
      transform: scale(1.1);
    }

    .color-dot.active {
      border-color: #FFFFFF;
      box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
    }

    /* BRAND LOGO */
    .brand {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      text-decoration: none !important;
      color: #FFFFFF !important;
    }

    .brand-mark {
      width: 28px;
      height: 28px;
      border-radius: 8px;
      background: var(--brand-accent, #F59E0B);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      box-shadow: 0 2px 8px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
      transition: background 0.25s ease, box-shadow 0.25s ease;
    }

    .brand-title {
      font-size: 1.15rem;
      font-weight: 800;
      color: #FFFFFF !important;
      letter-spacing: -0.025em;
      line-height: 1;
      text-decoration: none !important;
    }

    /* MAIN APP SHELL LAYOUT */
    .app-shell {
      display: flex !important;
      flex-direction: row !important;
      flex: 1;
      height: calc(100vh - 60px);
      overflow: hidden;
      position: relative;
      width: 100%;
    }

    /* LEFT SIDEBAR */
    .sidebar {
      width: 295px;
      min-width: 295px;
      background-color: var(--bg-sidebar);
      border-right: 1px solid var(--border-subtle);
      display: flex;
      flex-direction: column;
      padding: 20px 14px;
      overflow-y: auto;
      user-select: none;
      flex-shrink: 0;
      transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
      white-space: nowrap;
    }

    /* Khi Sidebar bị ẩn hoàn toàn */
    .app-shell.sidebar-collapsed .sidebar {
      width: 0 !important;
      min-width: 0 !important;
      padding: 0 !important;
      border-right-color: transparent !important;
      opacity: 0 !important;
      pointer-events: none !important;
      overflow: hidden !important;
    }

    .sidebar-section-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 6px 10px 8px;
    }

    .sidebar-label {
      font-size: 0.78rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--text-tertiary);
    }

    .menu-stagger-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 34px;
      height: 34px;
      background-color: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 9px;
      cursor: pointer;
      padding: 0;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
      flex-shrink: 0;
    }

    .menu-stagger-btn:focus,
    .menu-stagger-btn:focus-visible {
      outline: none !important;
      border-color: rgba(245, 158, 11, 0.6) !important;
      box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3) !important;
    }

    .menu-stagger-btn:hover {
      background-color: #2a2a2e;
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    }

    .menu-stagger-btn:active {
      transform: scale(0.95);
    }

    .btn-add-collection-icon {
      background: none;
      border: none;
      outline: none;
      color: var(--text-tertiary);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
      border-radius: 6px;
      transition: all 0.15s ease;
    }

    .btn-add-collection-icon:hover {
      color: #FFFFFF;
      background: rgba(255, 255, 255, 0.09);
    }

    .btn-add-collection-icon:focus,
    .btn-add-collection-icon:focus-visible,
    .btn-add-collection-icon:active {
      outline: none !important;
      border: none !important;
      box-shadow: none !important;
    }

    #tongQuanMenuList {
      display: flex !important;
    }

    .sidebar-menu {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 2px;
      margin-bottom: 20px;
    }

    .sidebar-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 9px 12px;
      border-radius: var(--radius-md);
      color: var(--text-secondary);
      font-size: 0.95rem;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.12s ease;
    }

    .sidebar-item:hover {
      background-color: var(--bg-hover);
      color: var(--text-primary);
    }

    .sidebar-item.active {
      background-color: var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
      color: var(--brand-accent, #F59E0B);
      font-weight: 600;
    }

    .sidebar-item.active .sidebar-item-icon {
      color: var(--brand-accent, var(--brand-blue));
    }

    .sidebar-item-left {
      display: flex;
      align-items: center;
      gap: 10px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .sidebar-item-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--text-tertiary);
      flex-shrink: 0;
    }

    .sidebar-badge {
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--text-tertiary);
      background-color: var(--bg-subtle);
      padding: 3px 9px;
      border-radius: var(--radius-full);
      font-family: var(--font-mono);
    }

    .sidebar-item.active .sidebar-badge {
      background-color: var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
      color: var(--brand-accent, var(--brand-blue));
    }

    /* MAIN WORKSPACE */
    .workspace {
      flex: 1;
      padding: 28px 36px 80px;
      overflow-y: auto;
      overflow-x: hidden;
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }

    /* ==========================================================================
       FULL SCREEN EXPANDED FOCUS MODE (WHEN SIDEBAR / TỔNG QUAN IS COLLAPSED)
       ========================================================================== */
    .workspace {
      transition: padding 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .pip-island,
    .content-card {
      transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1), padding 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .word-row,
    .word-title,
    .word-meaning,
    .pip-title,
    .content-title {
      transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* EXPANDED DASHBOARD CONTAINER WITH PROPORTIONED MARGINS */
    .app-shell.sidebar-collapsed .workspace {
      width: 100%;
      padding: 36px 64px 90px;
    }

    .app-shell.sidebar-collapsed .pip-island, .app-shell.sidebar-collapsed .content-card {
      max-width: 1220px;
    }

    /* CARD 1: EXPANDED STATS & METRICS */
    .app-shell.sidebar-collapsed .analytics-bar {
      padding: 22px 30px;
      margin-bottom: 24px;
    }

    .app-shell.sidebar-collapsed .analytics-title-group span {
      font-size: 1.05rem;
    }

    .app-shell.sidebar-collapsed .stat-val {
      font-size: 1.55rem;
    }

    .app-shell.sidebar-collapsed .stat-label {
      font-size: 0.82rem;
    }

    .app-shell.sidebar-collapsed .stat-pill {
      padding: 12px 18px;
    }

    /* CARD 2: EXPANDED PIP HERO ISLAND */
    .app-shell.sidebar-collapsed .pip-island {
      padding: 24px 32px;
      margin-bottom: 24px;
    }

    .app-shell.sidebar-collapsed .pip-title {
      font-size: 1.38rem;
    }

    .app-shell.sidebar-collapsed .btn-start {
      height: 46px;
      font-size: 1.02rem;
      padding: 0 26px;
      border-radius: 11px;
    }

    .app-shell.sidebar-collapsed .control-label {
      font-size: 0.90rem;
    }

    .app-shell.sidebar-collapsed .segment-btn {
      font-size: 0.88rem;
      padding: 7px 16px;
    }

    /* CARD 3: EXPANDED HỘP TỪ VỰNG */
    .app-shell.sidebar-collapsed .content-card {
      padding: 26px 32px;
    }

    .app-shell.sidebar-collapsed .content-title {
      font-size: 1.68rem;
    }

    .app-shell.sidebar-collapsed .content-subtitle {
      font-size: 0.94rem;
      padding: 4px 14px;
    }

    .app-shell.sidebar-collapsed .btn-add-word-inline {
      height: 40px;
      font-size: 0.92rem;
      padding: 0 20px;
    }

    .app-shell.sidebar-collapsed .word-row {
      padding: 16px 24px;
      margin-bottom: 10px;
      border-radius: 12px;
      gap: 20px;
    }

    .app-shell.sidebar-collapsed .things-checkbox {
      width: 23px;
      height: 23px;
    }

    .app-shell.sidebar-collapsed .things-checkbox svg {
      width: 12px;
      height: 12px;
    }

    .app-shell.sidebar-collapsed .word-title {
      font-size: 1.28rem;
      min-width: 160px;
    }

    .app-shell.sidebar-collapsed .word-ipa {
      font-size: 0.92rem;
      padding: 4px 10px;
    }

    .app-shell.sidebar-collapsed .word-meaning {
      font-size: 1.10rem;
    }

    .app-shell.sidebar-collapsed .icon-action-btn {
      width: 36px;
      height: 36px;
    }

    .app-shell.sidebar-collapsed .icon-action-btn svg {
      width: 18px;
      height: 18px;
    }

    
    /* EQUAL SYNCHRONIZED WIDTHS FOR STREAK TRACKER, PIP HERO & WORD BOX (1:1 RATIO) */
    .streak-full-card,
    .pip-island,
    .content-card {
      background-color: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-lg);
      padding: 22px 28px;
      margin-bottom: 22px;
      box-shadow: var(--shadow-sm);
      width: 100%;
      max-width: 1100px;
      box-sizing: border-box;
      transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1), padding 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .app-shell.sidebar-collapsed .streak-full-card,
    .app-shell.sidebar-collapsed .pip-island,
    .app-shell.sidebar-collapsed .content-card {
      max-width: 1240px;
      padding: 26px 32px;
    }

    /* KHỐI GIỮ CHUỖI (STREAK TRACKER) TỈ LỆ 1:1 - ZERO AI EMOJI */
    .streak-full-card {
      display: grid;
      grid-template-columns: 320px 1fr;
      gap: 24px;
      align-items: center;
    }

    @media (max-width: 900px) {
      .streak-full-card {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 16px 18px !important;
      }
    }

    /* Cột trái: Vòng tiến độ + Thông số ngày */
    .streak-left-col {
      display: flex;
      align-items: center;
      gap: 18px;
      border-right: 1px solid rgba(255, 255, 255, 0.08);
      padding-right: 24px;
    }

    @media (max-width: 900px) {
      .streak-left-col {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding-right: 0;
        padding-bottom: 16px;
      }
    }

    .streak-ring-box {
      position: relative;
      width: 64px;
      height: 64px;
      flex-shrink: 0;
    }

    .streak-ring-svg {
      width: 64px;
      height: 64px;
      transform: rotate(-90deg);
    }

    .ring-bg {
      fill: none;
      stroke: rgba(255, 255, 255, 0.06);
      stroke-width: 5;
    }

    .ring-fill {
      fill: none;
      stroke: var(--brand-accent, #F59E0B);
      stroke-width: 5;
      stroke-dasharray: 100;
      stroke-dashoffset: 15; /* 85% */
      stroke-linecap: round;
      transition: stroke-dashoffset 0.6s ease;
    }

    .ring-center-value {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-size: 0.88rem;
      font-weight: 800;
      font-family: var(--font-mono, monospace);
      color: #FFFFFF;
      letter-spacing: -0.02em;
    }

    .streak-info-meta {
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;
    }

    .streak-main-title {
      font-size: 1.15rem;
      font-weight: 800;
      color: #FFFFFF;
      letter-spacing: -0.015em;
      white-space: nowrap;
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: nowrap;
    }

    .streak-pill-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 2px 9px;
      border-radius: var(--radius-full);
      background: var(--brand-accent-shadow, rgba(0, 102, 255, 0.16));
      border: 1px solid var(--brand-accent, #0066FF);
      color: var(--brand-accent, #0066FF);
      font-size: 0.72rem;
      font-weight: 800;
      font-family: var(--font-mono, monospace);
      letter-spacing: 0.02em;
      white-space: nowrap;
      box-shadow: 0 0 10px var(--brand-accent-shadow, rgba(0, 102, 255, 0.25));
      transition: all 0.25s ease;
    }

    .sidebar-visitor-badge {
      margin: 16px 14px 10px;
      padding: 8px 12px;
      border-radius: var(--radius-sm);
      background: var(--bg-subtle);
      border: 1px solid var(--border-hairline);
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.76rem;
      color: var(--text-tertiary);
      font-weight: 600;
      white-space: nowrap;
    }

    .streak-sub-desc {
      font-size: 0.8rem;
      color: var(--text-secondary);
      white-space: nowrap;
    }

    /* Cột phải: 7 Cột Tuần đứng trải đều đối xứng */
    .streak-right-col {
      display: flex;
      flex-direction: column;
      gap: 10px;
      width: 100%;
    }

    .streak-bars-row {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      height: 64px;
      gap: 12px;
      padding-top: 0;
    }

    @media (max-width: 900px) {
      .streak-bars-row {
        gap: 6px !important;
        justify-content: space-between !important;
        width: 100% !important;
      }
      .bar-item {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: 44px !important;
      }
      .bar-track {
        max-width: 100% !important;
        width: 100% !important;
      }
    }

    .bar-item {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      height: 100%;
      justify-content: flex-end;
      cursor: pointer;
    }

    .bar-track {
      width: 100%;
      max-width: 34px;
      height: 42px;
      background: rgba(255, 255, 255, 0.04);
      border-radius: 4px;
      display: flex;
      align-items: flex-end;
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, 0.03);
    }

    .bar-item:hover .bar-track {
      border-color: rgba(255, 255, 255, 0.15);
    }

    .bar-fill {
      width: 100%;
      background: var(--brand-accent, #F59E0B);
      border-radius: 4px;
      transition: height 0.3s ease;
    }

    .bar-fill.active-today {
      background: var(--brand-accent, #F59E0B);
      box-shadow: 0 0 10px var(--brand-accent-shadow, rgba(56, 189, 248, 0.45));
    }

    .bar-day-name {
      font-size: 0.74rem;
      font-weight: 600;
      color: var(--text-tertiary);
      text-transform: uppercase;
    }

    .bar-day-name.today-text {
      color: var(--brand-accent, #F59E0B);
      font-weight: 700;
    }

    /* MODAL THÊM TỪ VỰNG THỦ CÔNG TINH TẾ (ZERO TABS, ZERO ANKI) */
    .modal-backdrop-custom {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(4, 6, 10, 0.85);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 10005 !important;
      padding: 16px;
    }

    .modal-backdrop-custom.open,
    .modal-backdrop-custom.active {
      display: flex;
    }

    .modal-card-custom {
      width: 100%;
      max-width: 520px;
      background: #0E131F;
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 16px;
      box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
      overflow: hidden;
      animation: modalSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes modalSlideUp {
      from { transform: translateY(12px) scale(0.98); opacity: 0; }
      to { transform: translateY(0) scale(1); opacity: 1; }
    }

    .modal-custom-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 20px 24px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(255, 255, 255, 0.015);
    }

    .modal-custom-title-wrap {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .modal-icon-badge {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      background: rgba(245, 158, 11, 0.12);
      border: 1px solid rgba(245, 158, 11, 0.3);
      color: var(--brand-accent, #F59E0B);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .modal-custom-title {
      font-size: 1.15rem;
      font-weight: 700;
      color: #FFFFFF;
      letter-spacing: -0.015em;
      white-space: nowrap;
    }

    .modal-custom-sub {
      font-size: 0.78rem;
      color: var(--text-secondary);
      margin-top: 1px;
      white-space: nowrap;
    }

    .btn-modal-close-custom {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(255, 255, 255, 0.03);
      color: #94A3B8;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.12s ease;
    }

    .btn-modal-close-custom:hover {
      background: rgba(255, 255, 255, 0.1);
      color: #FFFFFF;
    }

    .modal-custom-body {
      padding: 22px 24px;
      display: flex;
      flex-direction: column;
      gap: 16px;
      max-height: calc(85vh - 140px);
      max-height: calc(85dvh - 140px);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }

    .form-group-custom {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .form-label-custom {
      font-size: 0.82rem;
      font-weight: 600;
      color: #CBD5E1;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .form-label-custom .req {
      color: #F87171;
    }

    .form-input-custom {
      height: 40px;
      width: 100%;
      background: rgba(7, 9, 14, 0.7);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      padding: 0 14px;
      color: #FFFFFF;
      font-size: 0.88rem;
      font-family: var(--font-sans);
      outline: none;
      transition: border-color 0.15s ease, box-shadow 0.15s ease;
      box-sizing: border-box;
    }

    .form-input-custom:focus {
      border-color: var(--brand-accent, #F59E0B);
      box-shadow: 0 0 0 3px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
    }

    .form-input-custom::placeholder {
      color: #64748B;
      font-size: 0.82rem;
    }

    .input-row-duo {
      display: grid;
      grid-template-columns: 1.6fr 1.2fr;
      gap: 12px;
    }

    .modal-custom-footer {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      padding: 16px 24px;
      background: rgba(0, 0, 0, 0.25);
      border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    
    /* EMOJI CHOICE BUTTONS */
    
    /* BALANCED EMOJI PICKER GRID (10 COLUMNS IN ONE ROW) */
    .emoji-picker-grid {
      display: grid !important;
      grid-template-columns: repeat(10, 1fr) !important;
      gap: 6px !important;
      margin-top: 6px !important;
      width: 100% !important;
    }

    .emoji-choice-btn {
      width: 100% !important;
      height: 38px !important;
      font-size: 1.18rem !important;
      border-radius: var(--radius-sm) !important;
      border: 1px solid rgba(255, 255, 255, 0.1) !important;
      background: rgba(255, 255, 255, 0.03) !important;
      cursor: pointer !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      transition: all 0.15s ease !important;
      padding: 0 !important;
    }

    .emoji-choice-btn:hover {
      background: rgba(255, 255, 255, 0.09) !important;
      border-color: rgba(255, 255, 255, 0.22) !important;
      transform: translateY(-1px);
    }

    .emoji-choice-btn.active {
      border-color: var(--brand-blue) !important;
      background: rgba(245, 158, 11, 0.2) !important;
      box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.45) !important;
    }

    /* DRAG & DROP ZONE IN CREATE COLLECTION MODAL */
    .col-file-drop {
      border: 1px dashed rgba(255, 255, 255, 0.2) !important;
      border-radius: var(--radius-md) !important;
      padding: 16px 14px !important;
      text-align: center !important;
      cursor: pointer !important;
      background: rgba(255, 255, 255, 0.02) !important;
      transition: all 0.18s ease !important;
    }

    .col-file-drop:hover,
    .col-file-drop.drag-over {
      border-color: var(--brand-blue) !important;
      background: rgba(245, 158, 11, 0.08) !important;
      box-shadow: 0 0 16px rgba(245, 158, 11, 0.18) !important;
    }

    .emoji-choice-btn {
      width: 38px;
      height: 38px;
      font-size: 1.25rem;
      border-radius: var(--radius-sm);
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(255, 255, 255, 0.03);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s ease;
    }
    .emoji-choice-btn:hover {
      background: rgba(255, 255, 255, 0.08);
      border-color: rgba(255, 255, 255, 0.16);
      transform: translateY(-1px);
    }
    .emoji-choice-btn.active {
      border-color: #F59E0B;
      background: rgba(245, 158, 11, 0.18);
      box-shadow: 0 0 0 1px var(--brand-accent, #F59E0B);
    }

    /* MULTI-TAB ADD & IMPORT MODAL */
    .modal-panel-wide {
      max-width: 680px;
      width: 92%;
      max-height: 85vh;
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding: 0;
      border-radius: 18px;
    }

    .modal-tab-header {
      padding: 20px 24px 14px;
      border-bottom: 1px solid var(--border-subtle);
      background: var(--bg-surface);
    }

    .modal-title-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 14px;
    }

    .modal-title-text {
      font-size: 1.15rem;
      font-weight: 800;
      color: #FFFFFF;
      letter-spacing: -0.015em;
    }

    .btn-modal-close {
      background: transparent;
      border: none;
      color: var(--text-tertiary);
      font-size: 1.2rem;
      cursor: pointer;
      padding: 4px;
      border-radius: 6px;
      line-height: 1;
      transition: color 0.15s ease;
    }
    .btn-modal-close:hover {
      color: #FFFFFF;
      background: rgba(255, 255, 255, 0.08);
    }

    .modal-tab-bar {
      display: flex;
      gap: 6px;
      background: rgba(255, 255, 255, 0.04);
      padding: 4px;
      border-radius: var(--radius-md);
      border: 1px solid rgba(255, 255, 255, 0.06);
    }

    .modal-tab-btn {
      flex: 1;
      padding: 8px 12px;
      font-size: 0.84rem;
      font-weight: 600;
      border: none;
      background: transparent;
      color: var(--text-secondary);
      border-radius: var(--radius-sm);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      transition: all 0.15s ease;
    }

    .modal-tab-btn.active {
      background: var(--brand-accent, #F59E0B);
      color: var(--brand-accent-text, #FFFFFF);
      box-shadow: 0 2px 8px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
    }

    .modal-tab-btn:hover:not(.active) {
      color: #FFFFFF;
      background: rgba(255, 255, 255, 0.06);
    }

    .modal-tab-body {
      padding: 22px 24px;
      overflow-y: auto;
      flex: 1;
    }

    /* DRAG & DROP FILE ZONE */
    .file-drop-zone {
      border: 2px dashed rgba(255, 255, 255, 0.14);
      border-radius: var(--radius-lg);
      padding: 34px 20px;
      text-align: center;
      cursor: pointer;
      background: rgba(255, 255, 255, 0.015);
      transition: all 0.2s ease;
      margin-bottom: 18px;
    }

    .file-drop-zone:hover,
    .file-drop-zone.drag-over {
      border-color: var(--brand-accent, #F59E0B);
      background: var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
    }

    .file-drop-icon {
      width: 48px;
      height: 48px;
      border-radius: 14px;
      background: var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
      color: var(--brand-accent, #F59E0B);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 12px;
    }

    .file-drop-title {
      font-size: 0.98rem;
      font-weight: 700;
      color: #FFFFFF;
      margin-bottom: 4px;
    }

    .file-drop-subtitle {
      font-size: 0.82rem;
      color: var(--text-secondary);
      line-height: 1.4;
    }

    .file-drop-badge {
      display: inline-block;
      margin-top: 10px;
      padding: 3px 10px;
      border-radius: 9999px;
      background: rgba(255, 255, 255, 0.06);
      font-size: 0.74rem;
      font-weight: 600;
      color: #94A3B8;
    }

    /* MODAL TEMPLATE PACKS GRID */
    .modal-packs-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .modal-pack-item {
      background: rgba(255, 255, 255, 0.025);
      border: 1px solid rgba(255, 255, 255, 0.06);
      border-radius: var(--radius-md);
      padding: 14px 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      transition: all 0.15s ease;
    }

    .modal-pack-item:hover {
      background: rgba(255, 255, 255, 0.045);
      border-color: rgba(255, 255, 255, 0.12);
    }

    .modal-pack-info {
      flex: 1;
    }

    .modal-pack-title-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 4px;
    }

    .modal-pack-title {
      font-size: 0.95rem;
      font-weight: 700;
      color: #FFFFFF;
    }

    .modal-pack-badge {
      font-size: 0.72rem;
      font-weight: 700;
      padding: 2px 7px;
      border-radius: 9999px;
      background: rgba(245, 158, 11, 0.15);
      color: var(--brand-accent, #F59E0B);
    }

    .modal-pack-desc {
      font-size: 0.80rem;
      color: var(--text-secondary);
      line-height: 1.35;
    }

    .btn-import-pack-sm {
      padding: 8px 16px;
      font-size: 0.82rem;
      font-weight: 700;
      border-radius: var(--radius-sm);
      background: var(--brand-accent, #F59E0B);
      color: var(--brand-accent-text, #FFFFFF);
      border: none;
      cursor: pointer;
      flex-shrink: 0;
      transition: background 0.15s ease;
    }
    .btn-import-pack-sm:hover {
      background: var(--brand-accent-hover, #D97706);
    }

    /* IN-PAGE FLOATING CARD (FALLBACK & ALWAYS-ON COMPANION) */
    
    /* ==========================================================================
       SUPER APP-LIKE IN-PAGE FLOATING FLASHCARD (3D FLIP & MINI PILL MODE)
       ========================================================================== */
    /* POPUP FLASHCARD TRUNG TÂM (CENTER LEARNING POPUP) */
    .inpage-floating-card {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 90%;
      max-width: 360px;
      background: #141418;
      backdrop-filter: blur(28px);
      -webkit-backdrop-filter: blur(28px);
      border: 1.5px solid rgba(245, 158, 11, 0.45);
      border-radius: 20px;
      padding: 16px 18px;
      box-shadow: 0 24px 70px rgba(0, 0, 0, 0.88), 0 0 0 100vmax rgba(0, 0, 0, 0.65);
      z-index: 99999;
      display: none;
      flex-direction: column;
      gap: 12px;
      animation: popupCenterIn 0.26s cubic-bezier(0.16, 1, 0.3, 1);
      user-select: none;
      touch-action: none;
      transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes popupCenterIn {
      from { opacity: 0; transform: translate(-50%, -46%) scale(0.94); }
      to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    }

    .inpage-float-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: grab;
      padding-bottom: 2px;
    }

    .inpage-float-header:active {
      cursor: grabbing;
    }

    .inpage-float-badge {
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--brand-accent, #F59E0B);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .inpage-counter-chip {
      font-size: 0.7rem;
      font-weight: 600;
      color: var(--text-tertiary);
      background: rgba(255, 255, 255, 0.06);
      padding: 1px 7px;
      border-radius: 10px;
    }

    .inpage-btn-icon {
      background: none;
      border: none;
      color: var(--text-tertiary);
      font-size: 0.85rem;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      height: 24px;
      border-radius: 4px;
      transition: all 0.12s ease;
    }

    .inpage-btn-icon:hover {
      color: #FFFFFF;
      background: rgba(255, 255, 255, 0.1);
    }

    /* 3D PERSPECTIVE FLIP SCENE */
    .inpage-3d-scene {
      perspective: 800px;
      width: 100%;
      height: 128px;
      cursor: pointer;
    }

    .inpage-3d-card {
      width: 100%;
      height: 100%;
      position: relative;
      transform-style: preserve-3d;
      transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .inpage-3d-card.flipped {
      transform: rotateY(180deg);
    }

    .inpage-face {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
      border-radius: 12px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 10px 14px;
      text-align: center;
      box-sizing: border-box;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.06);
      transition: background 0.15s ease, border-color 0.15s ease;
    }

    .inpage-face:hover {
      background: rgba(255, 255, 255, 0.05);
      border-color: rgba(255, 255, 255, 0.12);
    }

    .inpage-face-back {
      transform: rotateY(180deg);
      background: rgba(245, 158, 11, 0.07);
      border-color: rgba(245, 158, 11, 0.22);
    }

    .inpage-word-title {
      font-size: 1rem;
      font-weight: 700;
      color: #FFFFFF;
      letter-spacing: -0.015em;
      margin-bottom: 2px;
      text-align: center;
      text-wrap: balance;
      transition: font-size 0.15s ease;
    }

    .inpage-word-title.word-long {
      font-size: 0.85rem;
    }

    .inpage-ipa-tag {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 0.7rem;
      color: #93C5FD;
      background: rgba(245, 158, 11, 0.15);
      padding: 1px 6px;
      border-radius: 4px;
      display: inline-block;
      margin-bottom: 3px;
      text-align: center;
    }

    .inpage-flip-hint {
      display: none;
    }

    .inpage-word-meaning {
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--brand-accent, #F59E0B);
      line-height: 1.25;
      margin-bottom: 4px;
      text-align: center;
      text-wrap: balance;
    }

    .inpage-example-box {
      font-size: 0.74rem;
      line-height: 1.35;
      color: var(--text-secondary);
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .inpage-ex-en {
      font-style: italic;
      color: #E2E8F0;
      margin-bottom: 2px;
    }

    .inpage-ex-vi {
      color: var(--text-tertiary);
      font-size: 0.7rem;
    }

    /* MICRO EMOJI BUTTONS DOCK (NO BULKY TEXT!) */
    .inpage-float-dock {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding-top: 2px;
    }

    .inpage-dock-btn {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: #FFFFFF;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 0.95rem;
      cursor: pointer;
      transition: all 0.15s ease;
      padding: 0;
      flex-shrink: 0;
    }

    .inpage-dock-btn:hover {
      background: rgba(255, 255, 255, 0.16);
      border-color: rgba(255, 255, 255, 0.28);
      transform: scale(1.08);
    }

    .inpage-dock-btn:active {
      transform: scale(0.94);
    }

    .inpage-dock-btn-success {
      background: rgba(16, 185, 129, 0.18);
      border-color: rgba(16, 185, 129, 0.4);
    }

    .inpage-dock-btn-success:hover {
      background: #10B981;
      border-color: #10B981;
    }

    /* MINI FLOATING PILL MODE (PHƯƠNG ÁN 4: VIÊN NHỘNG SIÊU GỌN) */
    .inpage-floating-card.pill-mode {
      width: auto !important;
      min-width: 250px !important;
      max-width: 380px !important;
      height: 40px !important;
      padding: 4px 10px !important;
      border-radius: 9999px !important;
      flex-direction: row !important;
      align-items: center !important;
      justify-content: space-between !important;
      gap: 8px !important;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(245, 158, 11, 0.35) !important;
      cursor: grab;
    }

    .inpage-floating-card.pill-mode:active {
      cursor: grabbing;
    }

    .inpage-floating-card.pill-mode .inpage-float-header,
    .inpage-floating-card.pill-mode .inpage-3d-scene {
      display: none !important;
    }

    .inpage-floating-card.pill-mode .inpage-pill-content {
      display: flex !important;
      align-items: center !important;
      gap: 6px !important;
      font-size: 0.84rem !important;
      cursor: pointer !important;
      overflow: hidden !important;
      white-space: nowrap !important;
      text-overflow: ellipsis !important;
      flex: 1 !important;
      padding-left: 4px !important;
    }

    .inpage-floating-card.pill-mode .pill-word {
      font-weight: 700 !important;
      color: #FFFFFF !important;
    }

    .inpage-floating-card.pill-mode .pill-arrow {
      color: var(--brand-blue) !important;
      font-size: 0.72rem !important;
    }

    .inpage-floating-card.pill-mode .pill-meaning {
      color: #93C5FD !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
    }

    .inpage-floating-card.pill-mode .inpage-float-dock {
      padding-top: 0 !important;
      gap: 4px !important;
    }

    .inpage-floating-card.pill-mode .inpage-dock-btn {
      width: 28px !important;
      height: 28px !important;
      font-size: 0.8rem !important;
    }

    .inpage-floating-card.pill-mode .inpage-btn-expand {
      display: inline-flex !important;
    }


    @keyframes floatPopIn {
      from { opacity: 0; transform: scale(0.92) translateY(12px); }
      to { opacity: 1; transform: scale(1) translateY(0); }
    }

    .inpage-float-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
      padding-bottom: 8px;
    }

    .inpage-float-title {
      font-size: 0.76rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--brand-accent, #F59E0B);
      display: flex;
      align-items: center;
      gap: 6px;
    }




    /* PIP CONTROL ISLAND (NO SUBTEXT) */
    .pip-island {
      background-color: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-lg);
      padding: 20px 26px;
      margin-bottom: 22px;
      box-shadow: var(--shadow-sm);
      width: 100%;
      max-width: 1100px;
      box-sizing: border-box;
    }

    .pip-island-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 14px;
    }

    .pip-status-group {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-shrink: 0;
    }

    .pip-beacon {
      width: 10px;
      height: 10px;
      border-radius: var(--radius-full);
      background-color: var(--brand-accent, #F59E0B);
      box-shadow: 0 0 10px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
      transition: background-color 0.25s ease, box-shadow 0.25s ease;
      display: inline-block;
      flex-shrink: 0;
    }

    .pip-beacon.running {
      background-color: #10B981 !important;
      box-shadow: 0 0 14px rgba(16, 185, 129, 0.9) !important;
      animation: pulseBeaconGreen 1.5s infinite ease-in-out;
    }

    @keyframes pulseBeaconGreen {
      0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
      }
      50% {
        opacity: 0.75;
        transform: scale(1.3);
        box-shadow: 0 0 18px rgba(16, 185, 129, 0.95);
      }
    }

    .pip-title-container {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .pip-title {
      font-size: 1.15rem;
      font-weight: 700;
      letter-spacing: -0.01em;
      color: var(--text-primary);
      line-height: 1.25;
      display: flex;
      align-items: baseline;
      gap: 6px;
    }

    .pip-title-sub {
      font-size: 0.78rem;
      font-weight: 500;
      color: #94A3B8;
      letter-spacing: 0;
    }

    .accent-selector-group {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }

    .segment-btn.disabled-accent {
      opacity: 0.55 !important;
      cursor: not-allowed !important;
      position: relative;
    }

    .badge-accent-tag {
      font-size: 0.62rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      padding: 1px 5px;
      border-radius: 4px;
      background: rgba(255, 255, 255, 0.12);
      color: rgba(255, 255, 255, 0.7);
      margin-left: 4px;
      vertical-align: middle;
    }

    .btn-start {
      height: 38px;
      padding: 0 20px;
      font-size: 0.86rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      border-radius: var(--radius-full);
      border: none;
      background: var(--brand-accent, #F59E0B);
      color: var(--brand-accent-text, #FFFFFF);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      transition: all 0.15s ease;
      box-shadow: 0 2px 10px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
      flex-shrink: 0;
    }

    .btn-start:hover {
      background: var(--brand-accent-hover, var(--brand-blue-hover));
      transform: translateY(-1px);
    }

    .btn-start.running {
      background: #EF4444 !important;
      color: #FFFFFF !important;
      box-shadow: 0 2px 12px rgba(239, 68, 68, 0.5) !important;
      border-color: #EF4444 !important;
    }

    .pip-toolbar {
      display: flex;
      align-items: center;
      padding-top: 14px;
      border-top: 1px solid var(--border-hairline);
    }

    .pip-controls-row {
      display: flex !important;
      flex-wrap: nowrap !important;
      align-items: center;
      gap: 8px;
      width: 100%;
      overflow-x: auto;
      scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
      padding-bottom: 2px;
    }
    .pip-controls-row::-webkit-scrollbar {
      display: none;
    }

    .pip-control-group {
      display: inline-flex;
      align-items: center;
      flex-shrink: 0 !important;
      white-space: nowrap;
      gap: 5px;
    }

    .badge-sample-library {
      background: var(--brand-accent-shadow, rgba(245, 158, 11, 0.35)) !important;
      color: var(--brand-accent, #F59E0B) !important;
      font-weight: 700;
    }

    .segment-btn.disabled-picker-item,
    .segment-btn[disabled] {
      opacity: 0.38 !important;
      cursor: not-allowed !important;
      pointer-events: none !important;
      filter: grayscale(0.5);
    }

    .control-label {
      font-size: 0.79rem;
      color: var(--text-secondary);
      font-weight: 600;
      white-space: nowrap;
      margin-right: 2px;
    }

    .segmented-picker {
      display: inline-flex;
      background-color: var(--bg-subtle);
      padding: 2px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border-hairline);
      white-space: nowrap;
    }

    .segment-btn {
      padding: 5px 9px;
      border-radius: 6px;
      border: none;
      background: transparent;
      color: var(--text-secondary);
      font-size: 0.79rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.12s ease;
      font-family: var(--font-ui);
      white-space: nowrap;
    }

    .segment-btn.active {
      background-color: var(--segment-active-bg, #2D2D33);
      border: 1px solid var(--segment-active-border, transparent);
      color: var(--segment-active-text, #FFFFFF);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
    }

    .toggle-switch-wrapper {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      user-select: none;
    }

    .toggle-switch {
      width: 32px;
      height: 18px;
      border-radius: 9999px;
      background-color: rgba(0, 0, 0, 0.16);
      position: relative;
      transition: background-color 0.15s ease;
    }

    .toggle-switch::after {
      content: "";
      position: absolute;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: #FFFFFF;
      top: 2px;
      left: 2px;
      transition: transform 0.15s ease;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    }

    .toggle-switch.checked {
      background-color: var(--brand-blue);
    }

    .toggle-switch.checked::after {
      transform: translateX(14px);
    }

    /* CONTENT CARD (VOCABULARY LIST & LIBRARY VIEW) */
    .content-card {
      background-color: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-lg);
      padding: 22px 28px;
      box-shadow: var(--shadow-sm);
      width: 100%;
      max-width: 1100px;
      box-sizing: border-box;
    }

    .content-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border-subtle);
      gap: 16px;
    }

    .content-title-group {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-shrink: 0;
      min-width: 0;
    }

    .content-title {
      font-size: 1.45rem;
      font-weight: 800;
      letter-spacing: -0.02em;
      white-space: nowrap;
      line-height: 1.25;
      margin: 0;
    }

    .content-subtitle {
      font-size: 0.86rem;
      color: var(--text-tertiary);
      font-weight: 600;
      background: var(--bg-subtle);
      padding: 3px 10px;
      border-radius: var(--radius-full);
      border: 1px solid var(--border-hairline);
    }

    .btn-add-word-inline {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      height: 36px;
      padding: 0 16px;
      background-color: var(--brand-accent, #F59E0B);
      color: var(--brand-accent-text, #FFFFFF);
      border: none;
      border-radius: var(--radius-sm);
      font-size: 0.88rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.12s ease;
      box-shadow: 0 2px 8px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
    }

    .btn-add-word-inline:hover {
      background-color: var(--brand-accent-hover, #D97706);
      border-color: var(--brand-accent-hover, #D97706);
      color: var(--brand-accent-text, #FFFFFF);
    }

    /* PURE ORIGINAL INLINE WORD ROW */
    .word-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      width: 100%;
    }

    .word-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 13px 18px;
      background-color: rgba(255, 255, 255, 0.02);
      border: 1px solid rgba(255, 255, 255, 0.04);
      border-radius: var(--radius-md);
      transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
      width: 100%;
      box-sizing: border-box;
    }

    .word-row:hover {
      background-color: rgba(255, 255, 255, 0.045);
      border-color: rgba(255, 255, 255, 0.08);
      transform: translateY(-1px);
    }

    .word-row:hover {
      background-color: var(--bg-hover);
    }

    .word-left {
      display: flex;
      align-items: center;
      gap: 12px;
      flex: 1;
      overflow: hidden;
    }

    .things-checkbox {
      width: 17px;
      height: 17px;
      border-radius: 50%;
      border: 1.5px solid var(--text-tertiary);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.15s ease;
      flex-shrink: 0;
      background: transparent;
    }

    .things-checkbox:hover {
      border-color: var(--brand-blue);
    }

    .word-row.completed .things-checkbox {
      background-color: var(--brand-blue);
      border-color: var(--brand-blue);
    }

    .things-checkbox svg {
      width: 10px;
      height: 10px;
      stroke: #FFFFFF;
      stroke-width: 2.5;
      fill: none;
      display: none;
    }

    .word-row.completed .things-checkbox svg {
      display: block;
    }

    .word-details {
      display: flex;
      align-items: baseline;
      gap: 14px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      flex: 1;
    }

    .word-title {
      font-size: 1.15rem;
      font-weight: 700;
      letter-spacing: -0.01em;
      color: #FFFFFF;
      min-width: 130px;
    }

    .word-row.completed .word-title {
      font-size: 1.15rem;
      font-weight: 700;
      letter-spacing: -0.01em;
      color: #FFFFFF;
      min-width: 130px;
    }

    .word-ipa {
      font-family: var(--font-mono);
      font-size: 0.84rem;
      color: var(--text-tertiary);
      background: var(--bg-subtle);
      padding: 3px 8px;
      border-radius: 5px;
    }

    .word-meaning {
      font-size: 0.98rem;
      color: #E4E4E7;
      font-weight: 400;
      flex: 1;
    }

    .word-row.completed .word-meaning {
      font-size: 0.98rem;
      color: #E4E4E7;
      font-weight: 400;
      flex: 1;
    }

    .word-actions {
      display: flex;
      align-items: center;
      gap: 4px;
      opacity: 0.35;
      transition: opacity 0.12s ease;
    }

    .word-row:hover .word-actions {
      opacity: 1;
    }

    .icon-action-btn {
      width: 32px;
      height: 32px;
      border-radius: var(--radius-sm);
      border: none;
      background: transparent;
      color: var(--text-tertiary);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: all 0.12s ease;
    }

    .icon-action-btn:hover {
      background: var(--bg-subtle);
      color: var(--text-primary);
    }

    .icon-action-btn.star.active {
      color: #F59E0B;
    }

    .icon-action-btn:hover.icon-action-btn:last-child {
      color: var(--state-danger);
    }

    /* STARTER PACKS LIBRARY VIEW GRID */
    .library-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 16px;
      margin-top: 14px;
    }

    .pack-card {
      background: var(--bg-subtle);
      border: 1px solid var(--border-hairline);
      border-radius: var(--radius-md);
      padding: 16px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 12px;
      transition: all 0.15s ease;
    }

    .pack-card:hover {
      border-color: var(--brand-blue);
      box-shadow: var(--shadow-sm);
      background: #222227;
    }

    .pack-card-top {
      display: flex;
      align-items: flex-start;
      gap: 12px;
    }

    .pack-icon-box {
      width: 36px;
      height: 36px;
      border-radius: var(--radius-sm);
      background: #18181B;
      border: 1px solid var(--border-subtle);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--brand-blue);
      flex-shrink: 0;
    }

    .pack-info h3 {
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 2px;
    }

    .pack-info p {
      font-size: 0.78rem;
      color: var(--text-secondary);
      line-height: 1.4;
    }

    .pack-card-bottom {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-top: 10px;
      border-top: 1px dashed var(--border-subtle);
    }

    .btn-load-pack {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      height: 36px;
      padding: 0 16px;
      background-color: var(--brand-blue);
      color: #FFFFFF;
      border: none;
      border-radius: var(--radius-sm);
      font-size: 0.88rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.12s ease;
    }

    .btn-load-pack:hover {
      background: var(--brand-blue-hover);
    }

    /* MODALS */
    .modal-backdrop {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background-color: rgba(0, 0, 0, 0.65);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      z-index: 10005 !important;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .modal-backdrop.open,
    .modal-backdrop.active {
      display: flex !important;
      display: flex;
    }

    .modal-panel {
      background-color: #18181B; border: 1px solid rgba(255, 255, 255, 0.12);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-lg);
      width: 100%;
      max-width: 480px;
      max-height: 85vh;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding: 24px;
      box-shadow: var(--shadow-lg);
    }

    .modal-title {
      font-size: 1.15rem;
      font-weight: 800;
      color: var(--text-primary);
      margin-bottom: 16px;
    }

    .form-group {
      margin-bottom: 14px;
    }

    .form-label {
      display: block;
      font-size: 0.76rem;
      font-weight: 600;
      color: var(--text-secondary);
      margin-bottom: 6px;
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }

    .form-input {
      width: 100%;
      height: 38px;
      padding: 0 12px;
      font-size: 0.88rem;
      font-family: var(--font-ui);
      background-color: var(--bg-subtle);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-sm);
      color: var(--text-primary);
      outline: none;
    }

    .form-input:focus {
      background: #222226;
      border-color: var(--brand-blue);
      box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
    }

    .modal-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      margin-top: 20px;
    }

    .btn-cancel {
      height: 36px;
      padding: 0 14px;
      font-size: 0.82rem;
      font-weight: 600;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border-subtle);
      background: transparent;
      color: var(--text-secondary);
      cursor: pointer;
    }

    .btn-submit {
      height: 36px;
      padding: 0 18px;
      font-size: 0.82rem;
      font-weight: 700;
      border-radius: var(--radius-sm);
      border: none;
      background: var(--brand-accent, #F59E0B);
      color: var(--brand-accent-text, #FFFFFF);
      cursor: pointer;
    }

    .btn-primary-action {
      height: 38px;
      padding: 0 22px;
      font-size: 0.88rem;
      font-weight: 600;
      border-radius: var(--radius-sm, 8px);
      border: none;
      background: var(--brand-accent, #F59E0B);
      color: var(--brand-accent-text, #FFFFFF) !important;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 10px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
      transition: background 0.15s ease, transform 0.1s ease;
      white-space: nowrap;
    }

    .btn-primary-action:hover {
      background: var(--brand-accent-hover, #D97706);
    }
      background: #0052CC;
      transform: translateY(-1px);
    }

    .btn-primary-action:active {
      transform: translateY(0);
    }

    .btn-auto-enrich {
      height: 28px;
      padding: 0 10px;
      font-size: 0.72rem;
      font-weight: 600;
      border-radius: var(--radius-full);
      border: 1px solid var(--brand-blue);
      background: rgba(245, 158, 11, 0.08);
      color: var(--brand-blue);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      float: right;
    }

    /* TOAST */
    .toast-container {
      position: fixed;
      bottom: 24px;
      right: 24px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      z-index: 200;
      pointer-events: none;
    }

    .toast-msg.toast-danger {
      background: #EF4444 !important;
      color: #FFFFFF !important;
      border: 1px solid #DC2626 !important;
      box-shadow: 0 4px 16px rgba(239, 68, 68, 0.45) !important;
    }

    .toast-msg {
      background: #191E24;
      color: #FFFFFF;
      padding: 10px 16px;
      border-radius: var(--radius-md);
      font-size: 0.82rem;
      font-weight: 600;
      box-shadow: var(--shadow-md);
      animation: toastSlideIn 0.2s ease;
    }

    @keyframes toastSlideIn {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }
  
    /* BATCH 30 STAGE SYSTEM (ZERO EMOJI, APPLE DARK CRAFT) */
    .btn-batch-toggle {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      height: 36px;
      padding: 0 14px;
      background: var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
      color: var(--brand-accent, #F59E0B);
      border: 1px solid var(--segment-active-border, rgba(245, 158, 11, 0.30));
      border-radius: var(--radius-sm);
      font-size: 0.88rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
      font-family: var(--font-ui);
    }

    .btn-batch-toggle:hover {
      background: var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
      border-color: var(--brand-accent, #F59E0B);
      color: var(--brand-accent-text, #FFFFFF);
      transform: translateY(-1px);
    }

    .btn-batch-toggle.active {
      background: var(--brand-accent, #F59E0B);
      color: var(--brand-accent-text, #FFFFFF);
      border-color: var(--brand-accent, #F59E0B);
      box-shadow: 0 2px 10px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
    }

    .batch-toolbar-panel {
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      padding: 16px 20px;
      margin-bottom: 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      box-shadow: var(--shadow-sm);
    }

    .batch-pills-row {
      display: flex;
      align-items: center;
      gap: 8px;
      overflow-x: auto;
      padding-bottom: 4px;
      scrollbar-width: none;
    }

    .batch-pills-row::-webkit-scrollbar {
      display: none;
    }

    .batch-pill-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      height: 30px;
      padding: 0 12px;
      background: var(--bg-subtle);
      border: 1px solid var(--border-hairline);
      border-radius: var(--radius-sm);
      color: var(--text-secondary);
      font-size: 0.82rem;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.12s ease;
      font-family: var(--font-ui);
    }

    .batch-pill-btn:hover {
      background: var(--bg-hover);
      color: var(--text-primary);
      border-color: var(--border-subtle);
    }

    .batch-pill-btn.active {
      background: var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
      border-color: var(--brand-accent, #F59E0B);
      color: var(--brand-accent, #F59E0B);
      font-weight: 700;
    }

    .batch-pill-btn.completed {
      border-color: rgba(16, 185, 129, 0.40);
      color: #34D399;
    }

    .batch-status-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
      padding-top: 4px;
    }

    .batch-info-text {
      display: flex;
      align-items: baseline;
      gap: 10px;
      font-size: 0.86rem;
      color: var(--text-secondary);
    }

    .batch-info-text b {
      color: #FFFFFF;
      font-weight: 700;
    }

    .batch-info-tag {
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--brand-blue);
      background: var(--brand-blue-soft);
      padding: 2px 7px;
      border-radius: var(--radius-full);
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .batch-action-btns {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .btn-batch-action {
      height: 30px;
      padding: 0 12px;
      background: var(--bg-subtle);
      border: 1px solid var(--border-hairline);
      color: var(--text-primary);
      border-radius: var(--radius-sm);
      font-size: 0.80rem;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.12s ease;
    }

    .btn-batch-action:hover {
      background: var(--bg-hover);
      border-color: var(--border-subtle);
      transform: translateY(-1px);
    }

    .btn-batch-launch-pip {
      background: var(--brand-accent, #F59E0B);
      color: var(--brand-accent-text, #FFFFFF);
      border-color: var(--brand-accent, #F59E0B);
    }

    .btn-batch-launch-pip:hover {
      background: var(--brand-accent-hover, #D97706);
      box-shadow: 0 2px 8px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
    }

    .batch-progress-track {
      width: 100%;
      height: 4px;
      background: rgba(255, 255, 255, 0.06);
      border-radius: 9999px;
      overflow: hidden;
      margin-top: 2px;
    }

    .batch-progress-fill {
      height: 100%;
      background: linear-gradient(90deg, #F59E0B 0%, #FBBF24 100%);
      border-radius: 9999px;
      transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* INPAGE COMPACT SIDE BUTTONS & DOCK */
    .inpage-card-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 4px;
      width: 100%;
      position: relative;
    }

    .inpage-nav-side-btn {
      width: 18px;
      height: 34px;
      border-radius: 4px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(255, 255, 255, 0.03);
      color: #94A3B8;
      font-size: 1.15rem;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: all 0.12s ease;
      flex-shrink: 0;
      user-select: none;
      line-height: 1;
      opacity: 0.5;
    }

    .inpage-nav-side-btn:hover {
      background: rgba(245, 158, 11, 0.25);
      border-color: #F59E0B;
      color: #FFFFFF;
      opacity: 1;
    }

    .inpage-nav-side-btn:active {
      transform: scale(0.95);
    }

    .inpage-dock-btn {
      height: 23px !important;
      padding: 0 14px !important;
      font-size: 0.72rem !important;
      font-weight: 600 !important;
      border-radius: 9999px !important;
      border: 1px solid rgba(255, 255, 255, 0.12) !important;
      background: rgba(255, 255, 255, 0.08) !important;
      color: #E2E8F0 !important;
      cursor: pointer !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      transition: all 0.12s ease !important;
      white-space: nowrap !important;
    }

    .inpage-dock-btn:hover {
      background: rgba(255, 255, 255, 0.18) !important;
      color: #FFFFFF !important;
    }

    .inpage-dock-btn-primary {
      background: var(--brand-accent, #F59E0B) !important;
      border-color: var(--brand-accent, #F59E0B) !important;
      color: var(--brand-accent-text, #FFFFFF) !important;
      font-weight: 700 !important;
      box-shadow: 0 2px 6px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35)) !important;
    }

    .inpage-dock-btn-primary:hover {
      background: var(--brand-accent-hover, #D97706) !important;
    }

    /* ==========================================================================
       AUTHENTICATION & DUOLINGO FREEMIUM FLOW (SINGLE CONTAINER LOCKING)
       ========================================================================== */
    .header-auth-container {
      display: inline-flex;
      align-items: center;
      position: relative;
    }

    /* Khóa cứng tuyệt đối: Khi logged-in, nút đăng nhập biến mất hoàn toàn 100% */
    .header-auth-container[data-auth-state="logged-in"] .btn-header-login {
      display: none !important;
      visibility: hidden !important;
      pointer-events: none !important;
    }
    .header-auth-container[data-auth-state="logged-in"] .user-menu-wrapper {
      display: inline-block !important;
      visibility: visible !important;
    }

    /* Khóa cứng tuyệt đối: Khi guest, hồ sơ user ẩn hoàn toàn */
    .header-auth-container[data-auth-state="guest"] .btn-header-login {
      display: inline-flex !important;
      visibility: visible !important;
    }
    .header-auth-container[data-auth-state="guest"] .user-menu-wrapper {
      display: none !important;
      visibility: hidden !important;
      pointer-events: none !important;
    }

    .btn-header-login {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      height: 34px;
      padding: 0 16px;
      border-radius: 9999px;
      background: var(--brand-accent, #F59E0B);
      color: var(--brand-accent-text, #FFFFFF);
      font-size: 0.85rem;
      font-weight: 600;
      border: 1px solid var(--brand-accent, #F59E0B);
      cursor: pointer;
      transition: all 0.15s ease;
      box-shadow: 0 2px 8px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
      user-select: none;
    }
    .btn-header-login:hover {
      background: var(--brand-accent-hover, #D97706);
      border-color: var(--brand-accent-hover, #D97706);
      transform: translateY(-1px);
      box-shadow: 0 4px 12px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
    }

    .auth-panel {
      max-width: 400px !important;
      width: 92% !important;
      background: #18181B !important;
      border: 1px solid rgba(255, 255, 255, 0.12) !important;
      border-radius: 18px !important;
      padding: 28px !important;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8) !important;
      display: flex;
      flex-direction: column;
      position: relative;
    }

    .auth-header {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      margin-bottom: 20px;
      position: relative;
    }

    .auth-brand-logo {
      width: 42px;
      height: 42px;
      border-radius: 10px;
      background: var(--brand-accent, #F59E0B);
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 12px;
      box-shadow: 0 4px 16px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
    }

    .auth-title {
      font-size: 1.22rem;
      font-weight: 700;
      color: #FFFFFF;
      letter-spacing: -0.015em;
      margin-bottom: 4px;
    }

    .auth-subtitle {
      font-size: 0.82rem;
      color: #94A3B8;
      line-height: 1.4;
    }

    .btn-google-sign-in {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      width: 100%;
      height: 42px;
      border-radius: 10px;
      background: #FFFFFF;
      color: #1F2937;
      border: 1px solid rgba(255, 255, 255, 0.15);
      font-size: 0.90rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s ease;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
      user-select: none;
    }
    .btn-google-sign-in:hover {
      background: #F3F4F6;
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }

    .auth-divider {
      display: flex;
      align-items: center;
      text-align: center;
      margin: 18px 0;
      color: #64748B;
      font-size: 0.74rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .auth-divider::before, .auth-divider::after {
      content: '';
      flex: 1;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .auth-divider span {
      padding: 0 10px;
    }

    .auth-tabs {
      display: flex;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 8px;
      padding: 3px;
      margin-bottom: 16px;
    }

    .auth-tab-btn {
      flex: 1;
      height: 32px;
      border: none;
      background: transparent;
      color: #94A3B8;
      font-size: 0.82rem;
      font-weight: 600;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.12s ease;
    }
    .auth-tab-btn.active {
      background: #27272A;
      color: #FFFFFF;
      box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    }

    .btn-auth-submit {
      width: 100%;
      height: 40px;
      border-radius: 10px;
      background: var(--brand-accent, #F59E0B);
      color: var(--brand-accent-text, #FFFFFF);
      font-size: 0.90rem;
      font-weight: 700;
      border: none;
      cursor: pointer;
      margin-top: 10px;
      transition: all 0.15s ease;
      box-shadow: 0 2px 8px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
    }
    .btn-auth-submit:hover {
      background: var(--brand-accent-hover, #D97706);
      transform: translateY(-1px);
    }

    .auth-footer-guest {
      text-align: center;
      margin-top: 16px;
    }

    .btn-guest-continue {
      background: none;
      border: none;
      color: #64748B;
      font-size: 0.8rem;
      cursor: pointer;
      transition: color 0.12s ease;
      text-decoration: underline;
    }
    .btn-guest-continue:hover {
      color: #94A3B8;
    }

    .user-dropdown-action-btn.text-danger {
      color: #EF4444;
    }
    .user-dropdown-action-btn.text-danger:hover {
      background: rgba(239, 68, 68, 0.12);
      color: #F87171;
    }

    /* GOOGLE ACCOUNT CHOOSER MODAL (OFFICIAL GOOGLE OAUTH DIALOG STYLE) */
    .google-chooser-panel {
      max-width: 440px !important;
      width: 92% !important;
      background: #FFFFFF !important;
      color: #1F2937 !important;
      border-radius: 24px !important;
      padding: 32px 28px !important;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5) !important;
      display: flex;
      flex-direction: column;
      position: relative;
    }

    .google-chooser-header {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      margin-bottom: 20px;
    }

    .google-chooser-title {
      font-size: 1.35rem;
      font-weight: 500;
      color: #1F2937;
      margin-top: 10px;
      margin-bottom: 4px;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    }

    .google-chooser-subtitle {
      font-size: 0.88rem;
      color: #5F6368;
    }

    .google-account-list {
      display: flex;
      flex-direction: column;
      border: 1px solid #DADCE0;
      border-radius: 12px;
      overflow: hidden;
      margin-bottom: 16px;
    }

    .google-account-item {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 12px 16px;
      cursor: pointer;
      transition: background 0.15s ease;
      border-bottom: 1px solid #F1F3F4;
    }
    .google-account-item:last-child {
      border-bottom: none;
    }
    .google-account-item:hover {
      background: #F8F9FA;
    }

    .google-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: #1A73E8;
      color: #FFFFFF;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.85rem;
      font-weight: 600;
      flex-shrink: 0;
    }

    .google-account-info {
      flex: 1;
      min-width: 0;
    }

    .google-account-name {
      font-size: 0.90rem;
      font-weight: 600;
      color: #202124;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .google-account-email {
      font-size: 0.80rem;
      color: #5F6368;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .google-custom-box {
      background: #F8F9FA;
      border-radius: 12px;
      padding: 16px;
      margin-bottom: 16px;
      border: 1px dashed #DADCE0;
    }

    .google-input {
      width: 100%;
      height: 36px;
      border: 1px solid #DADCE0;
      border-radius: 6px;
      padding: 0 10px;
      font-size: 0.85rem;
      color: #202124;
      background: #FFFFFF;
      margin-bottom: 8px;
      outline: none;
    }
    .google-input:focus {
      border-color: #1A73E8;
    }

    .btn-google-custom-submit {
      width: 100%;
      height: 36px;
      background: #1A73E8;
      color: #FFFFFF;
      border: none;
      border-radius: 6px;
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.15s ease;
    }
    .btn-google-custom-submit:hover {
      background: #155724;
      background: #1558D6;
    }

    .google-client-id-accordion {
      font-size: 0.78rem;
      color: #5F6368;
      border-top: 1px solid #E8EAED;
      padding-top: 12px;
    }

    /* ==========================================================================
       MACOS & RETINA DISPLAY REFINEMENTS (APPLE HIG)
       ========================================================================== */
    @media screen and (-webkit-min-device-pixel-ratio: 2), screen and (min-resolution: 192dpi) {
      body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
      }
    }

    /* macOS Slim Floating Scrollbars */
    ::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }
    ::-webkit-scrollbar-track {
      background: transparent;
    }
    ::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.16);
      border-radius: 9999px;
    }
    ::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.32);
    }

    /* Touch Tap Direct Response */
    button:active, .sidebar-item:active, .color-dot:active {
      transform: scale(0.97);
      transition: transform 0.08s ease-out;
    }

    /* ==========================================================================
       LAPTOP RESPONSIVE (1025px - 1366px)
       ========================================================================== */
    @media (min-width: 1025px) and (max-width: 1366px) {
      .sidebar {
        width: 250px;
        min-width: 250px;
        padding: 16px 10px;
      }
      .workspace {
        padding: 20px 24px 80px;
        min-width: 0;
      }
      .pip-island,
      .content-card {
        padding: 18px 22px;
      }
    }

    /* ==========================================================================
       TABLET RESPONSIVE (769px - 1024px)
       ========================================================================== */
    @media (max-width: 1024px) {
      .sidebar {
        width: 240px;
        min-width: 240px;
        padding: 16px 10px;
      }
      .workspace {
        padding: 24px 20px 80px;
      }
      .analytics-bar {
        gap: 12px;
        padding: 16px 20px;
      }
      .stat-val {
        font-size: 1.35rem;
      }
      .word-title {
        min-width: 110px;
      }
    }

    /* Default Theme & Scope Selector Visibility: Desktop Shows PC Themes & Scope, Hides Mobile */
    .desktop-theme-group {
      display: flex !important;
    }
    .desktop-scope-group {
      display: inline-flex !important;
    }
    .mobile-theme-group {
      display: none !important;
    }

    /* Mobile Bottom Bar: Mặc định ẩn hoàn toàn trên máy tính / màn hình lớn (> 768px) */
    .mobile-bottom-bar {
      display: none !important;
    }

    /* ==========================================================================
       MOBILE SMARTPHONE RESPONSIVE (<= 768px)
       ========================================================================== */
    @media (max-width: 768px) {
      /* CỐ ĐỊNH 1 MÀU DUY NHẤT CHO MOBILE: TÍM HOÀNG GIA APPLE (#8B5CF6 & #A78BFA) */
      /* NỀN XÁM TITAN SLATE CAO CẤP (#0F121C) - LOẠI BỎ HOÀN TOÀN NỀN ĐEN TUYỀN CHỐNG MỎI MẮT */
      :root, body, [data-theme], [data-mobile-theme] {
        --brand-accent: #8B5CF6 !important;
        --brand-accent-hover: #7C3AED !important;
        --brand-accent-text: #FFFFFF !important;
        --brand-accent-shadow: rgba(139, 92, 246, 0.35) !important;
        --brand-blue: #8B5CF6 !important;
        --brand-blue-hover: #7C3AED !important;
        --brand-blue-soft: rgba(139, 92, 246, 0.16) !important;
        --border-focus: #8B5CF6 !important;
        --bg-canvas: #0F121C !important;
        --bg-surface: #171B26 !important;
        --bg-sidebar: #131622 !important;
        --bg-subtle: #1C2130 !important;
        --bg-hover: #23293D !important;
        --border-hairline: rgba(255, 255, 255, 0.08) !important;
      }

      /* Trên Mobile: Ẩn Theme PC, Hiển thị Kiểu Hiển Thị Mobile, Ẩn Bộ từ khó/thuộc */
      .desktop-theme-group {
        display: none !important;
      }
      .mobile-theme-group {
        display: flex !important;
      }
      .desktop-scope-group {
        display: none !important;
      }

      body {
        background-color: #0F121C !important;
        padding-bottom: env(safe-area-inset-bottom);
        overflow-x: hidden;
      }

      /* Compact Top Navigation with Safe Area (Notch & Dynamic Island) */
      .top-nav {
        padding-top: max(10px, env(safe-area-inset-top));
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
        padding-bottom: 8px;
        height: calc(56px + env(safe-area-inset-top));
        min-height: calc(56px + env(safe-area-inset-top));
        box-sizing: border-box;
      }
      .brand-title {
        font-size: 1.05rem;
      }
      .menu-stagger-btn {
        width: 44px;
        height: 44px; /* Apple minimum 44px touch target */
      }
      .btn-header-login {
        height: 36px;
        padding: 0 14px;
        font-size: 0.84rem;
      }

      /* Sidebar Off-Canvas Slide Drawer */
      .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        width: 82% !important;
        max-width: 320px !important;
        z-index: 10001 !important;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.9) !important;
        background-color: #141416 !important;
        border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding-top: max(20px, env(safe-area-inset-top)) !important;
        padding-bottom: calc(84px + env(safe-area-inset-bottom, 16px)) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: flex !important;
        flex-direction: column !important;
      }

      .sidebar.mobile-open {
        transform: translateX(0) !important;
      }

      /* Backdrop for Mobile Drawer */
      .sidebar-drawer-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.72);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        z-index: 10000;
      }
      .sidebar-drawer-backdrop.active {
        display: block;
      }

      /* App Shell & Workspace Full Width */
      .app-shell {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        min-height: calc(100vh - 56px);
        overflow: visible !important;
        width: 100% !important;
      }

      /* App Shell & Workspace Tràn Viền Liền Mạch (Edge-to-Edge) */
      .app-shell {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        min-height: calc(100vh - 56px);
        overflow: visible !important;
        width: 100% !important;
      }

      .workspace {
        width: 100% !important;
        padding: 0 0 calc(76px + env(safe-area-inset-bottom)) !important;
        overflow: visible !important;
        box-sizing: border-box !important;
      }

      /* Analytics Bar 2x2 Grid Tràn Viền */
      .analytics-bar {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 12px max(16px, env(safe-area-inset-left)) !important;
        border-radius: 0 !important;
        border: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
        margin-bottom: 0 !important;
        background: rgba(255, 255, 255, 0.02) !important;
        width: 100% !important;
        box-sizing: border-box !important;
      }
      .stat-pill {
        padding: 10px 12px !important;
      }
      .stat-val {
        font-size: 1.35rem !important;
      }
      .stat-label {
        font-size: 0.72rem !important;
      }

      /* Streak Card Tràn Viền Liền Mạch (Flat Edge-to-Edge Strip) */
      .streak-full-card {
        padding: 12px max(16px, env(safe-area-inset-left)) !important;
        border-radius: 0 !important;
        border: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
        background: rgba(255, 255, 255, 0.02) !important;
        margin-bottom: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
      }

      /* PiP Island Tràn Viền Liền Mạch (Compact Ambient Dock) */
      .pip-island {
        padding: 12px max(16px, env(safe-area-inset-left)) !important;
        border-radius: 0 !important;
        border: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        margin-bottom: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
      }
      .pip-island-header {
        flex-wrap: wrap !important;
        gap: 8px !important;
        margin-bottom: 8px !important;
      }
      .pip-title-container {
        display: flex;
        flex-direction: column;
        gap: 1px;
      }
      .pip-title {
        font-size: 0.98rem !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
      }
      .pip-title-sub {
        font-size: 0.72rem !important;
      }
      .pip-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
      }
      .pip-controls-row {
        justify-content: space-between !important;
        width: 100% !important;
      }
      .btn-start {
        width: 100% !important;
        justify-content: center !important;
        height: 44px !important;
        min-height: 44px !important;
        font-size: 0.92rem !important;
        border-radius: 12px !important;
        margin-top: 2px !important;
        touch-action: manipulation !important;
      }

      /* Content Card Tràn Viền Liền Mạch (Flat List Surface) */
      .content-card {
        padding: 14px max(16px, env(safe-area-inset-left)) 24px !important;
        border-radius: 0 !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        margin-bottom: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        min-height: calc(100vh - 220px) !important;
      }
      .content-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding-bottom: 8px !important;
        margin-bottom: 4px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
      }
      .content-title-group {
        width: 100% !important;
        justify-content: space-between !important;
      }
      .content-title {
        font-size: 1.25rem !important;
        white-space: normal !important;
        word-break: break-word !important;
      }
      .content-toolbar-actions {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
      }
      .content-search-box {
        width: 100% !important;
      }
      .btn-batch-toggle {
        width: 100% !important;
        justify-content: center !important;
        height: 42px !important;
        touch-action: manipulation !important;
      }
      .btn-add-word-inline {
        width: 100% !important;
        justify-content: center !important;
        height: 44px !important;
        touch-action: manipulation !important;
      }

      /* BỎ HOÀN TOÀN TỪ KHÓ (STAR) VÀ ĐÃ THUỘC (CHECKBOX) TRÊN ĐIỆN THOẠI */
      .things-checkbox {
        display: none !important;
      }
      .icon-action-btn.star {
        display: none !important;
      }

      /* Word Row Mobile Tràn Viền Phẳng (Flat Edge-to-Edge List Item) */
      .word-row {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 11px 0 !important;
        gap: 10px !important;
        border-radius: 0 !important;
        border: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
        background: transparent !important;
        box-shadow: none !important;
        width: 100% !important;
        box-sizing: border-box !important;
      }
      .word-left {
        width: auto !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
      }
      .word-details {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
        width: 100% !important;
        min-width: 0 !important;
      }
      .word-title {
        font-size: 1.05rem !important;
        font-weight: 700 !important;
        color: #FFFFFF !important;
        min-width: 0 !important;
        line-height: 1.25 !important;
      }
      .word-ipa {
        font-size: 0.78rem !important;
        padding: 1px 6px !important;
        border-radius: 4px !important;
      }
      .word-meaning {
        width: 100% !important;
        padding-left: 0 !important;
        font-size: 0.88rem !important;
        line-height: 1.4 !important;
        color: #94A3B8 !important;
      }
      .word-actions {
        opacity: 1 !important; /* Luôn hiển thị trên màn hình cảm ứng */
        gap: 6px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
      }
      /* Vùng chạm phím bấm (Touch Target): Tối thiểu 48x48px cho Loa âm thanh */
      .icon-action-btn {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        touch-action: manipulation !important;
      }

      /* Vùng chạm tối thiểu 48px & Khoảng cách an toàn giữa 2 nút Khó và Thuộc */
      .inpage-dock-btn {
        min-height: 48px !important;
        height: 48px !important;
        font-size: 0.95rem !important;
        font-weight: 700 !important;
        border-radius: 12px !important;
        touch-action: manipulation !important;
      }
      .inpage-float-dock {
        gap: 20px !important;
        padding: 14px 18px !important;
      }

      /* Ngăn chặn iOS Safari tự phóng to khi bấm vào ô nhập liệu & Chống trễ chạm */
      button, a, input, select, textarea {
        touch-action: manipulation;
      }
      input, select, textarea {
        font-size: 16px !important;
      }

      /* Modals Full Width Mobile Friendly & Auto-Scroll (không bị bàn phím ảo che mất nút Lưu) */
      .modal-card-custom,
      .modal-panel,
      .modal-panel-wide {
        width: 95% !important;
        max-width: 460px !important;
        max-height: 85vh !important;
        max-height: 85dvh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 20px 16px !important;
        border-radius: 18px !important;
        margin: auto !important;
      }

      .inpage-floating-card {
        display: none !important;
      }

      /* Mobile Bottom Navigation Bar: Hiển thị thanh đáy cố định trên điện thoại (<= 768px) */
      .mobile-bottom-bar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        height: calc(56px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: rgba(15, 23, 42, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 9999;
        align-items: center;
        justify-content: space-around;
        box-sizing: border-box;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
      }

      .mobile-nav-btn {
        display: flex;
        flex: 1 1 50% !important;
        width: 50% !important;
        max-width: 50% !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: transparent;
        border: none;
        color: #94A3B8;
        font-size: 11px;
        font-weight: 500;
        padding: 6px 0;
        cursor: pointer;
        min-height: 48px;
        touch-action: manipulation;
        transition: color 0.15s ease, transform 0.15s ease;
        user-select: none;
        -webkit-user-select: none;
      }

      .mobile-nav-btn.active,
      .mobile-nav-btn:hover {
        color: var(--brand-accent, #F59E0B);
      }

      .mobile-nav-btn:active {
        transform: scale(0.95);
      }

      .mobile-nav-btn svg {
        flex-shrink: 0;
      }

      body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
      }
    }



  
    .user-dropdown-action-btn.text-primary { color: #F59E0B; }
    .user-dropdown-action-btn.text-primary:hover { background: rgba(245, 158, 11, 0.15); color: #FBBF24; }
    @media (max-width: 640px) {
      .user-name-label {
        display: none !important;
      }
      .d3-user-block {
        padding: 4px 6px 4px 4px !important;
        gap: 4px !important;
      }
    }

/* ==========================================================================
   ANDROID PWA & INSTALL PROMPT STYLES
   ========================================================================== */

.sidebar-pwa-dock {
  margin-top: auto;
  padding: 16px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.sidebar-pwa-dock .sidebar-visitor-badge {
  margin: 8px 0 0 0 !important;
}

.btn-sidebar-pwa-install {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  color: #FFFFFF;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn-sidebar-pwa-install:hover {
  background: #F59E0B;
  border-color: #F59E0B;
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.45);
  transform: translateY(-1px);
}

.btn-sidebar-pwa-install:active {
  transform: translateY(0);
}

.btn-sidebar-pwa-install.installed {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #10B981;
  cursor: default;
}

.btn-sidebar-pwa-install.installed:hover {
  transform: none;
  box-shadow: none;
}

/* Modal Overlay & Card */
.pwa-android-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: pwaFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-android-modal-card {
  width: 100%;
  max-width: 440px;
  background: #121216;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  animation: pwaSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pwa-modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-modal-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #F8FAFC;
  white-space: nowrap;
}

.pwa-modal-subtitle {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: #94A3B8;
  line-height: 1.35;
}

.pwa-modal-close-btn {
  background: transparent;
  border: none;
  color: #64748B;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pwa-modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #F8FAFC;
}

.pwa-modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pwa-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pwa-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  color: var(--brand-accent, #F59E0B);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.76rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.pwa-step-content {
  flex: 1;
}

.pwa-step-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #E2E8F0;
  margin-bottom: 2px;
  white-space: nowrap;
}

.pwa-step-desc {
  font-size: 0.8rem;
  color: #94A3B8;
  line-height: 1.45;
}

.pwa-step-desc strong {
  color: #F1F5F9;
}

.pwa-step-icon-inline {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 2px;
  color: #94A3B8;
}

.pwa-modal-footer {
  padding: 14px 20px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: flex-end;
}

.pwa-modal-confirm-btn {
  height: 38px;
  padding: 0 20px;
  border-radius: 8px;
  background: var(--brand-accent, #F59E0B);
  border: 1px solid var(--brand-accent, #F59E0B);
  color: var(--brand-accent-text, #FFFFFF);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pwa-modal-confirm-btn:hover {
  background: var(--brand-accent-hover, #D97706);
  border-color: var(--brand-accent-hover, #D97706);
  box-shadow: 0 2px 10px var(--brand-accent-shadow, rgba(245, 158, 11, 0.35));
}

@keyframes pwaFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pwaSlideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   ZERO-SLOP ERGONOMICS & TYPOGRAPHY STANDARDS (HIG-01, TYPO-01, PTR-01, NET-01)
   ========================================================================== */

/* 1. Anti-Text Drop & Button Storm Click Guard */
.btn-start,
.btn-header-login,
.sidebar-badge,
.stat-pill,
.brand-title,
.user-name-label,
.tab-btn,
.btn-primary,
.btn-auth-submit {
  white-space: nowrap !important;
}

button:disabled,
button.is-loading {
  pointer-events: none !important;
  opacity: 0.72;
  cursor: not-allowed !important;
}

/* 2. Apple HIG 44px Minimum Touch Hitbox on Mobile */
@media (max-width: 768px) {
  .brand {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  .btn-add-collection-icon {
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .btn-sidebar-pwa-install {
    min-height: 44px !important;
  }

  #searchInput,
  input.search-input {
    min-height: 44px !important;
  }

  .icon-action-btn,
  .segment-btn,
  .btn-modal-close-custom,
  .btn-header-login,
  .sidebar-item,
  .btn-cancel,
  .modal-custom-footer button,
  .menu-stagger-btn {
    min-height: 44px !important;
    min-width: 44px !important;
  }

  .things-checkbox {
    display: none !important;
  }

  .batch-pill-btn {
    min-height: 40px !important;
  }

  .btn-batch-toggle {
    min-height: 44px !important;
    padding: 0 16px !important;
  }
}

/* 2.1 Non-blocking modal backdrops */
.modal-backdrop,
.modal-backdrop-custom,
.pwa-android-modal-overlay {
  pointer-events: none !important;
}

.modal-panel,
.modal-card-custom,
.pwa-android-modal-card {
  pointer-events: auto !important;
}

/* 3. Pointer Events & Visiblity Guard for Collapsed Sidebar (Desktop Only) */
@media (min-width: 769px) {
  .app-shell.sidebar-collapsed .sidebar {
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* 4. Offline Network Banner */
.offline-network-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #B91C1C;
  color: #FFFFFF;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  padding: 6px 12px;
  z-index: 9999;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease;
}

.offline-network-banner.show {
  display: block;
}

/* 5. LIVE VISITOR BADGE (Zero AI Slop - Professional Vector) */
.header-visitor-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
  white-space: nowrap !important;
  transition: all 0.2s ease;
}

.header-visitor-badge:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
}

/* 6. DEEP MOBILE SCREEN (< 480px) ADVANCED OPTIMIZATION */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .top-nav {
    display: grid !important;
    grid-template-columns: 44px 1fr auto !important;
    align-items: center !important;
    padding-left: max(12px, env(safe-area-inset-left)) !important;
    padding-right: max(12px, env(safe-area-inset-right)) !important;
    gap: 8px !important;
  }
  .nav-left {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }
  .nav-center {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }
  .nav-tools {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
  }
  .user-menu-wrapper {
    flex-shrink: 0 !important;
  }
}

@media (max-width: 480px) {
  .top-nav {
    padding-left: 10px !important;
    padding-right: 10px !important;
    min-height: 54px !important;
    height: calc(54px + env(safe-area-inset-top, 0px)) !important;
  }
  .nav-center .brand-title {
    font-size: 1rem !important;
  }
  .header-visitor-badge {
    padding: 3px 6px !important;
    font-size: 0.68rem !important;
    gap: 4px !important;
    max-width: 105px !important;
    overflow: hidden !important;
  }
  #visitorCountText {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .pip-control-panel {
    padding: 10px 12px !important;
  }
  .control-group-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .control-group-row > div {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }
  .segmented-picker {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
  }
  .segment-btn {
    white-space: nowrap !important;
    padding: 8px 12px !important;
    font-size: 0.78rem !important;
    min-height: 44px !important;
    min-width: 44px !important;
  }
  .content-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .content-toolbar-actions {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
  .content-search-box {
    width: 100% !important;
  }
  .menu-stagger-btn,
  .btn-header-login,
  .d3-user-block {
    min-height: 44px !important;
    min-width: 44px !important;
  }
}

/* 7. APPLE HIG TOUCH TARGETS & ANTI-ORPHAN TYPOGRAPHY */
button,
.btn,
.segment-btn,
.category-pill,
.d3-user-block,
.menu-stagger-btn {
  white-space: nowrap !important;
}

h1, h2, h3, .content-title, .streak-main-title {
  text-wrap: balance;
}

/* ==========================================================================
   BỘ TỨ KIỂU HIỂN THỊ THẺ HỌC TRÊN MOBILE (4 DISPLAY MODES)
   ========================================================================== */

/* Mode 1: Obsidian Titan Dịu Mắt (Mặc định) */
[data-mobile-theme="obsidian"] .pip-island,
[data-mobile-theme="obsidian"] .streak-full-card {
  background: #141724 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Mode 2: Kính Mờ (Liquid Glass VisionOS) */
[data-mobile-theme="liquid_glass"] .pip-island,
[data-mobile-theme="liquid_glass"] .streak-full-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.85) 100%) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  box-shadow: inset 0 1.5px 2px rgba(255, 255, 255, 0.4), 0 12px 36px rgba(0, 0, 0, 0.5) !important;
}

/* Mode 3: Chữ Nổi HUD (Dual-Stroke) */
[data-mobile-theme="hud_clean"] .pip-island,
[data-mobile-theme="hud_clean"] .streak-full-card {
  background: #121522 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
[data-mobile-theme="hud_clean"] .pip-title,
[data-mobile-theme="hud_clean"] .streak-main-title {
  text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8);
}

/* Mode 4: Dynamic Island Capsule (Viên thuốc dẹp 999px) */
[data-mobile-theme="dynamic_island"] .pip-island {
  border-radius: 999px !important;
  background: #161A28 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}




