      /* Light Theme Variables */
      :root {
        --bg-primary: #ffffff;
        --bg-secondary: #f1f3f4;
        --bg-tertiary: #e8eaed;
        --bg-tab-strip: #dee1e6;
        --accent: #1a73e8;
        --text-primary: #202124;
        --text-secondary: #5f6368;
        --border: #dadce0;
        --shadow: rgba(32, 33, 36, 0.28);
        --panel-bg: #ffffff;
      }

      /* Dark Theme Variables */
      :root[data-theme="dark"] {
        --bg-primary: #323639;
        --bg-secondary: #202124;
        --bg-tertiary: #202124;
        --bg-tab-strip: #202124;
        --accent: #8ab4f8;
        --text-primary: #e8eaed;
        --text-secondary: #9aa0a6;
        --border: #5f6368;
        --shadow: rgba(0, 0, 0, 0.5);
        --panel-bg: #292a2d;
      }

      * { margin: 0; padding: 0; box-sizing: border-box; }
      html, body { height: 100%; margin: 0; overflow: hidden; }

      body {
        font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
        background: var(--bg-primary);
        color: var(--text-primary);
        display: flex; flex-direction: column;
        transition: background-color 0.2s, color 0.2s;
      }

      /* ── LOADING ── */
      .loading-overlay {
        position: fixed; inset: 0; background: var(--bg-primary);
        display: flex; align-items: center; justify-content: center; z-index: 2000;
      }
      .spinner {
        width: 24px; height: 24px; border: 3px solid var(--bg-tertiary);
        border-top-color: var(--accent); border-radius: 50%;
        animation: spin 1s linear infinite;
      }
      @keyframes spin { to { transform: rotate(360deg); } }

      /* ── TOP BAR (Tab Strip) ── */
      .top-bar {
        background: var(--bg-tab-strip); display: flex; flex-direction: column;
        padding-top: 6px; z-index: 100; position: relative; flex-shrink: 0;
      }

      .tabs-wrapper { display: flex; align-items: flex-end; width: 100%; padding-left: 8px; }

      .search-tabs-btn {
        width: 28px; height: 28px; border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        color: var(--text-primary); cursor: pointer;
        margin-right: 8px; margin-bottom: 4px; transition: background 0.1s;
      }
      .search-tabs-btn:hover { background: var(--bg-tertiary); }

      .tabs-container {
        display: flex; align-items: flex-end; gap: 0px; height: 34px; overflow-x: auto; flex: 1;
      }
      .tabs-container::-webkit-scrollbar { display: none; }

      .tab {
        background: transparent; padding: 0 8px 0 10px; border-radius: 10px 10px 0 0; 
        font-size: 12px; cursor: default; display: flex; align-items: center; gap: 8px;
        min-width: 160px; max-width: 240px; height: 34px; color: var(--text-secondary);
        position: relative; flex-shrink: 1; transition: background 0.1s;
      }
      .tab:hover:not(.active) { background: var(--bg-tertiary); }
      .tab.active { background: var(--bg-primary); color: var(--text-primary); z-index: 2; }

      .tab.active::before, .tab.active::after {
        content: ''; position: absolute; bottom: 0; width: 12px; height: 12px;
        background: var(--bg-primary); pointer-events: none;
      }
      .tab.active::before { left: -12px; -webkit-mask-image: radial-gradient(circle at 0 0, transparent 12px, black 0); }
      .tab.active::after { right: -12px; -webkit-mask-image: radial-gradient(circle at 12px 0, transparent 12px, black 0); }

      .tab-divider {
        position: absolute; right: 0; top: 25%; height: 50%; width: 1px;
        background: var(--border); transition: opacity 0.2s;
      }
      .tab.active .tab-divider, .tab:hover .tab-divider, .tab.active + .tab .tab-divider { opacity: 0; }
      .tab:last-of-type .tab-divider { display: none; }

      .tab-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; user-select: none; }

      .close-tab {
        color: var(--text-secondary); font-size: 16px; width: 18px; height: 18px;
        display: flex; align-items: center; justify-content: center; border-radius: 50%;
        transition: background 0.1s, opacity 0.1s; cursor: pointer; user-select: none;
        opacity: 0; pointer-events: none;
      }
      .tab:hover .close-tab, .tab.active .close-tab { opacity: 1; pointer-events: auto; }
      .close-tab:hover { background: var(--bg-tertiary); color: var(--text-primary); }

      .new-tab-btn {
        width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
        cursor: pointer; color: var(--text-primary); font-size: 20px; font-weight: 300;
        margin-left: 6px; margin-bottom: 3px; transition: background 0.1s; z-index: 1;
      }
      .new-tab-btn:hover { background: var(--bg-tertiary); }

      /* ── TOOLBAR ── */
      .toolbar {
        background: var(--bg-primary); padding: 4px 8px; display: flex; gap: 8px; align-items: center;
        border-bottom: 1px solid var(--border); position: relative; z-index: 10;
      }

      .nav-btn {
        background: transparent; border: none; color: var(--text-secondary); cursor: pointer;
        width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
        transition: background 0.1s; flex-shrink: 0;
      }
      .nav-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }
      .nav-btn svg { width: 18px; height: 18px; fill: currentColor; }

      .url-bar { flex: 1; position: relative; height: 34px; margin: 0 4px; }

      .omnibox-wrapper {
        position: absolute; top: 0; left: 0; right: 0; background: var(--bg-secondary);
        border-radius: 17px; display: flex; flex-direction: column; z-index: 1000; border: 1px solid transparent;
      }
      .omnibox-wrapper.focused { background: var(--bg-primary); box-shadow: 0 4px 6px var(--shadow); }
      .omnibox-wrapper.has-suggestions { border-radius: 16px; padding-bottom: 8px; }

      .url-bar-container { display: flex; align-items: center; padding: 0 14px; height: 34px; }
      .omnibox-wrapper.has-suggestions .url-bar-container { border-bottom: 1px solid var(--border); }

      .url-bar-container input {
        width: 100%; border: none; background: transparent; color: var(--text-primary); 
        font-family: 'Roboto', sans-serif; font-size: 14px; outline: none; padding: 0 8px;
      }

      /* ── BOOKMARK BAR ── */
      .bookmark-bar {
        background: var(--bg-primary); display: flex; align-items: center; padding: 4px 8px;
        border-bottom: 1px solid var(--border); overflow-x: auto; gap: 4px; height: 34px; flex-shrink: 0;
      }
      .bookmark-bar::-webkit-scrollbar { display: none; }
      .bookmark-item {
        display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 16px;
        cursor: pointer; font-size: 12px; color: var(--text-primary); transition: background 0.1s;
      }
      .bookmark-item:hover { background: var(--bg-secondary); }
      .bookmark-item img { width: 16px; height: 16px; border-radius: 2px; flex-shrink: 0; }
      .bookmark-item span { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; }

      /* ── POPUPS & MODALS ── */
      .suggestions-dropdown { display: flex; flex-direction: column; background: transparent; padding-top: 4px; }
      .suggestion-item { padding: 6px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; color: var(--text-primary); }
      .suggestion-item:hover, .suggestion-item.selected { background: var(--bg-secondary); }
      .suggestion-icon { width: 16px; height: 16px; opacity: 0.6; }

      .popup-menu {
        position: absolute; background: var(--panel-bg); border: 1px solid var(--border);
        box-shadow: 0 4px 12px var(--shadow); border-radius: 8px; padding: 8px 0;
        z-index: 2000; min-width: 250px; display: flex; flex-direction: column;
      }
      .popup-item {
        padding: 10px 16px; display: flex; align-items: center; gap: 12px;
        cursor: pointer; font-size: 13px; color: var(--text-primary);
      }
      .popup-item:hover { background: var(--bg-secondary); }
      .popup-header { padding: 8px 16px; font-weight: 500; font-size: 14px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }

      .modal-overlay {
        position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex;
        align-items: center; justify-content: center; z-index: 4000;
      }
      .modal {
        background: var(--panel-bg); width: 400px; border-radius: 8px; padding: 20px;
        box-shadow: 0 4px 24px rgba(0,0,0,0.2); display: flex; flex-direction: column; gap: 16px;
      }
      .modal h3 { font-size: 16px; font-weight: 500; }
      .modal input, .modal textarea {
        width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border);
        background: var(--bg-secondary); color: var(--text-primary); outline: none; font-family: monospace; font-size: 13px;
      }
      .modal textarea { height: 100px; resize: none; }
      .modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
      .modal button {
        padding: 8px 16px; border-radius: 4px; font-size: 13px; font-weight: 500; cursor: pointer; border: none;
      }
      .modal button.cancel { background: transparent; color: var(--accent); }
      .modal button.cancel:hover { background: rgba(26, 115, 232, 0.1); }
      .modal button.primary { background: var(--accent); color: white; }
      .modal button.primary:hover { filter: brightness(0.9); }

      /* ── CHROME ICONS ── */
      .chrome-actions { display: flex; align-items: center; gap: 2px; margin-left: 8px; padding-left: 8px; position: relative; flex-shrink: 0;}
      .profile-icon {
        width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: white;
        display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; cursor: pointer; margin-left: 8px;
      }

      .zoom-level { font-size: 12px; color: var(--text-secondary); min-width: 42px; text-align: center; font-weight: 500; user-select: none; cursor: pointer; margin: 0 2px; }
      .zoom-level:hover { background: var(--bg-secondary); border-radius: 12px; padding: 4px 0; color: var(--text-primary); }

      /* ── CONTENT & IFRAME ZOOM ── */
      .content-area { flex: 1; background: var(--bg-primary); position: relative; display: flex; overflow: hidden; }
      #canvas-container { width: 100%; height: 100%; flex: 1; background: white; position: relative; overflow: hidden; }
      #canvas-container iframe { display: block; width: 100%; height: 100%; border: none; zoom: var(--iframe-zoom, 1); }

      /* ── HOME / NEW TAB ── */
      .empty-state {
        position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
        padding-top: 10vh; background-color: var(--bg-primary); overflow-y: auto; z-index: 10;
      }
      
      .bg-image-layer { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(6px); z-index: -2; pointer-events: none; }
      .bg-overlay-layer { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.3); z-index: -1; pointer-events: none; }

      .main-logo { font-family: 'Product Sans', 'Roboto', sans-serif; font-size: 5.5rem; font-weight: 400; letter-spacing: -2px; margin-bottom: 30px; user-select: none; z-index: 1; }
      .main-logo span:nth-child(1) { color: #4285f4; }
      .main-logo span:nth-child(2) { color: #ea4335; }
      .main-logo span:nth-child(3) { color: #fbbc05; }
      .main-logo span:nth-child(4) { color: #4285f4; }
      .main-logo span:nth-child(5) { color: #34a853; }
      .main-logo span:nth-child(6) { color: #ea4335; }
      .main-logo span:nth-child(7) { color: #4285f4; }

      .search-container { width: 100%; max-width: 580px; position: relative; padding: 0 20px; margin-bottom: 30px; z-index: 2; }
      .home-omnibox-wrapper { background: var(--bg-primary); border: 1px solid var(--border); border-radius: 24px; display: flex; flex-direction: column; position: relative; z-index: 1000; }
      .home-omnibox-wrapper:hover, .home-omnibox-wrapper.focused { box-shadow: 0 1px 6px var(--shadow); border-color: transparent; }
      .home-search-box { display: flex; align-items: center; width: 100%; padding: 0 14px 0 18px; height: 46px; }
      .home-search-box input { flex: 1; border: none; background: transparent; font-size: 16px; outline: none; padding: 0 8px; color: var(--text-primary); }

      .quick-apps-grid { display: grid; grid-template-columns: repeat(5, 112px); gap: 16px 8px; justify-items: center; justify-content: center; max-width: 600px; z-index: 1; }
      .app-card { border-radius: 8px; padding: 16px 8px 8px; display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; width: 112px; position: relative; }
      .app-card:hover { background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(4px); }
      .app-icon { width: 48px; height: 48px; background: var(--bg-secondary); border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 12px; }
      .app-card:hover .app-icon { background: var(--bg-primary); box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
      .app-icon img { width: 100%; height: 100%; object-fit: contain; }
      .app-name { font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 88px; }

      .action-btn {
        position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-primary); color: var(--text-secondary);
        display: none; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
      }
      .app-card:hover .action-btn { display: flex; }
      .action-btn:hover { background: var(--bg-secondary); }

      .customize-btn {
        position: absolute; bottom: 16px; right: 16px; display: flex; align-items: center; gap: 8px; background: var(--bg-primary); color: var(--text-secondary); padding: 6px 12px; border-radius: 16px; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.2s; user-select: none; border: 1px solid var(--border); box-shadow: 0 1px 3px var(--shadow); z-index: 2;
      }
      .customize-btn:hover { background: var(--bg-secondary); }

      .side-panel {
        position: absolute; right: 0; top: 0; bottom: 0; width: 340px; background: var(--panel-bg); box-shadow: -2px 0 10px var(--shadow); z-index: 3000; padding: 20px; display: flex; flex-direction: column; gap: 20px; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      }
      .side-panel.open { transform: translateX(0); }
      .side-panel h2 { font-size: 16px; font-weight: 500; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
      .side-panel input[type="text"] { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); outline:none; }
      .side-panel input[type="file"] { width: 100%; padding: 8px 0; color: var(--text-primary); }
      .side-panel button.close-panel { background: transparent; border: none; font-size: 24px; cursor: pointer; color: var(--text-primary); line-height: 1; }