    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root[data-theme="dark"] {
        --bg:           #000000;
        --chrome-top:   #111111;
        --chrome-bar:   #0e0e0e;
        --tab-inactive: #161616;
        --tab-active:   #000000;
        --tab-border:   rgba(255,255,255,0.08);
        --border:       rgba(255,255,255,0.08);
        --text:         #ffffff;
        --text-dim:     rgba(255,255,255,0.38);
        --text-mid:     rgba(255,255,255,0.62);
        --input-bg:     rgba(255,255,255,0.05);
        --input-focus:  rgba(255,255,255,0.08);
        --btn-bg:       rgba(255,255,255,0.05);
        --btn-hover:    rgba(255,255,255,0.1);
        --accent:       #555555;
        --accent-glow:  rgba(255,255,255,0.06);
        --glass:        rgba(8,8,8,0.98);
        --card:         rgba(255,255,255,0.03);
        --danger:       #ff4b4b;
    }
    :root[data-theme="solar"] {
        --bg:           #070710;
        --chrome-top:   #0d0d1e;
        --chrome-bar:   #0a0a18;
        --tab-inactive: #090916;
        --tab-active:   #070710;
        --tab-border:   rgba(100,120,255,0.12);
        --border:       rgba(100,120,255,0.1);
        --text:         #e8e8ff;
        --text-dim:     rgba(200,200,255,0.35);
        --text-mid:     rgba(200,200,255,0.6);
        --input-bg:     rgba(100,120,255,0.06);
        --input-focus:  rgba(100,120,255,0.1);
        --btn-bg:       rgba(100,120,255,0.07);
        --btn-hover:    rgba(100,120,255,0.13);
        --accent:       #7c9dff;
        --accent-glow:  rgba(124,157,255,0.18);
        --glass:        rgba(7,7,18,0.97);
        --card:         rgba(100,120,255,0.04);
        --danger:       #ff4b4b;
    }

    html, body {
        height: 100%;
        background: var(--bg);
        font-family: 'DM Sans', system-ui, sans-serif;
        color: var(--text);
        overflow: hidden;
    }

    #app-shell {
        display: flex;
        flex-direction: column;
        height: 100vh;
        width: 100vw;
    }
    #tab-strip {
        display: flex;
        align-items: flex-end;
        background: var(--chrome-top);
        padding: 9px 9px 0 9px;
        gap: 2px;
        border-bottom: 1px solid rgba(255,255,255,0.07);
        min-height: 48px;
        flex-shrink: 0;
        overflow-x: auto;
        overflow-y: visible;
        scrollbar-width: none;
        position: relative;
        z-index: 110;
    }
    #tab-strip::-webkit-scrollbar { display: none; }

    #tab-container {
        display: flex;
        gap: 2px;
        align-items: flex-end;
        min-width: 0;
    }

    .tab-item {
        display: flex;
        align-items: center;
        gap: 7px;
        padding: 0 10px;
        height: 37px;
        min-width: 140px;
        max-width: 220px;
        border-radius: 8px 8px 0 0;
        background: var(--tab-inactive);
        border: 1px solid transparent;
        border-bottom: none;
        cursor: pointer;
        font-size: 12px;
        font-weight: 500;
        color: var(--text-dim);
        flex-shrink: 0;
        position: relative;
        user-select: none;
        transition: background 0.15s, color 0.15s;
    }
    .tab-item.active {
        background: var(--tab-active);
        border-color: var(--tab-border);
        color: var(--text);
        z-index: 2;
    }
    .tab-item.active::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 0;
        right: 0;
        height: 1px;
        background: var(--tab-active);
    }
    .tab-item:hover:not(.active) {
        background: rgba(255,255,255,0.05);
        color: var(--text-mid);
    }
    .tab-favicon {
        width: 14px;
        height: 14px;
        border-radius: 3px;
        flex-shrink: 0;
        background: var(--btn-bg);
        object-fit: contain;
    }
    .tab-label {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
    }
    .tab-close {
        width: 18px;
        height: 18px;
        border-radius: 4px;
        border: none;
        background: none;
        color: var(--text-dim);
        cursor: pointer;
        font-size: 16px;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.15s, color 0.15s;
        flex-shrink: 0;
        opacity: 0;
    }
    .tab-item:hover .tab-close,
    .tab-item.active .tab-close { opacity: 1; }
    .tab-close:hover { background: rgba(255,77,77,0.2); color: var(--danger); }

    #new-tab-btn {
        width: 28px;
        height: 28px;
        border-radius: 6px;
        background: none;
        border: 1px solid transparent;
        color: var(--text-dim);
        cursor: pointer;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        margin-bottom: 4px;
        transition: background 0.15s, color 0.15s, border-color 0.15s;
    }
    #new-tab-btn:hover {
        background: var(--btn-hover);
        border-color: var(--border);
        color: var(--text);
    }
    #omnibar {
        display: flex;
        align-items: center;
        gap: 5px;
        padding: 8px 12px;
        background: var(--chrome-bar);
        border-bottom: 1px solid rgba(255,255,255,0.07);
        flex-shrink: 0;
        z-index: 109;
    }

    .omni-btn {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        background: none;
        border: none;
        color: var(--text-mid);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.15s, color 0.15s;
        flex-shrink: 0;
    }
    .omni-btn:hover { background: var(--btn-hover); color: var(--text); }
    .omni-btn:active { transform: scale(0.91); }
    .omni-btn svg { width: 17px; height: 17px; stroke-width: 2.2; pointer-events: none; }
    #omnibar-actions { display: flex; align-items: center; gap: 1px; flex-shrink: 0; }
    #address-bar-wrap {
        flex: 1;
        position: relative;
        display: flex;
        align-items: center;
    }
    #course-search-input {
        width: 100%;
        height: 36px;
        padding: 0 42px 0 14px;
        background: var(--input-bg);
        border: 1px solid var(--border);
        border-radius: 20px;
        color: var(--text);
        font-family: 'DM Mono', monospace;
        font-size: 12px;
        letter-spacing: 0.01em;
        outline: none;
        transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
    }
    #course-search-input::placeholder {
        color: var(--text-dim);
        font-family: 'DM Sans', sans-serif;
        font-size: 12.5px;
    }
    #course-search-input:hover { background: var(--input-focus); border-color: rgba(255,255,255,0.14); }
    #course-search-input:focus {
        background: var(--input-focus);
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--accent-glow);
    }

    #bookmark-star-btn {
        position: absolute;
        right: 10px;
        background: none;
        border: none;
        cursor: pointer;
        color: rgba(255,255,255,0.55);
        display: flex;
        align-items: center;
        padding: 4px;
        transition: color 0.15s, transform 0.15s, background 0.15s;
        z-index: 2;
        border-radius: 5px;
    }
    #bookmark-star-btn:hover { color: #fff; transform: scale(1.1); background: rgba(255,255,255,0.08); }
    #bookmark-star-btn.bookmarked { color: #f5c518; }
    #bookmark-star-btn.bookmarked svg { fill: #f5c518; }
    #bookmark-star-btn svg { width: 16px; height: 16px; stroke-width: 2; }
    #suggestions-dropdown {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        background: #1a1a1a;
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 12px;
        overflow: hidden;
        z-index: 500;
        box-shadow: 0 12px 32px rgba(0,0,0,0.6);
        display: none;
    }
    #suggestions-dropdown.visible { display: block; }
    .suggestion-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 9px 14px;
        cursor: pointer;
        font-size: 13px;
        color: var(--text-mid);
        transition: background 0.12s;
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }
    .suggestion-item:last-child { border-bottom: none; }
    .suggestion-item:hover,
    .suggestion-item.active { background: rgba(255,255,255,0.07); color: var(--text); }
    .suggestion-item svg { flex-shrink: 0; opacity: 0.4; width: 14px; height: 14px; }
    .suggestion-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .suggestion-fill { font-size: 11px; color: var(--text-dim); opacity: 0.5; flex-shrink: 0; padding-left: 6px; }
    #content-area {
        flex: 1;
        position: relative;
        overflow: hidden;
        background: var(--bg);
    }
    #educational-background-canvas {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        z-index: 1;
    }
    #content-viewer { position: absolute; inset: 0; z-index: 6; background: transparent; pointer-events: none; }
    #content-viewer.active { background: var(--bg); pointer-events: auto; }
    iframe { border: none; width: 100%; height: 100%; display: block; background-color: var(--bg); }
    #education-home {
        position: absolute;
        inset: 0;
        z-index: 5;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 200px;
        width: 100%;
    }
    .logo-text {
        font-family: 'DM Sans', sans-serif;
        font-weight: 700;
        font-size: 72px;
        letter-spacing: -4px;
        background: linear-gradient(160deg, rgba(255,255,255,0.45) 0%, #fff 40%, rgba(255,255,255,0.4) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        margin-bottom: 30px;
        line-height: 1;
    }
    .home-search-wrap {
        width: 100%;
        max-width: 600px;
        margin: 0 auto 40px auto;
        padding: 0 20px;
    }
    #main-search-bar {
        width: 100%;
        padding: 16px 20px;
        font-size: 16px;
        border-radius: 8px;
        background: rgba(0,0,0,0.3);
        border: 1px solid var(--border);
        color: var(--text);
        font-family: 'DM Sans', sans-serif;
        outline: none;
        transition: all 0.2s;
    }
    #main-search-bar::placeholder { color: var(--text-dim); }
    #main-search-bar:focus {
        border-color: var(--accent);
        background: rgba(0,0,0,0.45);
        box-shadow: 0 0 0 3px var(--accent-glow);
    }
    #main-search-bar:hover { background: rgba(0,0,0,0.38); }
    .shortcuts-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(80px, 80px));
        justify-content: center;
        gap: 16px;
        width: 100%;
        max-width: 600px;
    }
    .shortcut-tile {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        aspect-ratio: 1 / 1;
        background: transparent;
        border: none;
        border-radius: 12px;
        color: var(--text);
        cursor: pointer;
        transition: all 0.2s;
        padding: 8px;
    }
    .shortcut-tile:hover { transform: scale(1.05); background: rgba(255,255,255,0.05); }
    .shortcut-tile:hover .delete-shortcut,
    .shortcut-tile:hover .edit-shortcut { opacity: 1; }
    .shortcut-tile img { width: 40px; height: 40px; border-radius: 10px; margin-bottom: 8px; }
    .shortcut-tile span { font-size: 11px; font-weight: 500; opacity: 0.7; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .delete-shortcut { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; background: rgba(255,77,77,0.95); border: none; border-radius: 50%; color: white; font-size: 13px; cursor: pointer; opacity: 0; transition: all 0.2s; display: flex; align-items: center; justify-content: center; z-index: 10; }
    .delete-shortcut:hover { background: rgba(255,77,77,1); transform: scale(1.15); }
    .edit-shortcut { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; background: rgba(80,80,80,0.9); border: none; border-radius: 50%; color: white; cursor: pointer; opacity: 0; transition: all 0.2s; display: flex; align-items: center; justify-content: center; z-index: 10; padding: 0; }
    .edit-shortcut:hover { background: rgba(120,120,120,1); transform: scale(1.15); }
    .edit-shortcut svg { width: 11px; height: 11px; stroke-width: 2.5; pointer-events: none; }
    #resource-loading-overlay { position: absolute; inset: 0; background-color: var(--bg); display: none; flex-direction: column; justify-content: center; align-items: center; z-index: 10; gap: 16px; }
    #resource-loading-overlay.visible { display: flex; }
    .loader-spinner { width: 48px; height: 48px; border: 3px solid rgba(255,255,255,0.15); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
    #resource-loading-message { color: rgba(255,255,255,0.7); font-size: 12px; font-weight: 500; letter-spacing: 0.3px; }
    @keyframes spin { to { transform: rotate(360deg); } }
    #top-ad { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 8; visibility: hidden; pointer-events: none; display: flex; align-items: center; justify-content: center; width: 468px; height: 60px;}
    #top-ad.visible { visibility: visible; pointer-events: auto; }
    #home-ads-side { position: absolute; inset: 0; pointer-events: none; visibility: hidden; z-index: 7; }
    #home-ads-side.visible { visibility: visible; }
    #left-ad { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 160px; height: 600px; display: flex; align-items: center; justify-content: center; pointer-events: auto; }
    #right-ad { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 160px; height: 600px; display: flex; align-items: center; justify-content: center; pointer-events: auto;}
    .modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); background: var(--glass); backdrop-filter: blur(28px); padding: 24px; border-radius: 16px; z-index: 300; border: 1px solid rgba(255,255,255,0.09); width: 360px; box-shadow: 0 32px 64px rgba(0,0,0,0.75); max-height: 80vh; overflow-y: auto; }
    #learning-preferences-modal { width: 480px; max-width: 90vw; }
    .hidden { display: none !important; }
    .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
    .modal-header h2 { margin: 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--text-dim); }
    .clear-all-btn { background: none; border: none; color: var(--danger); font-size: 11px; font-weight: 600; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; }
    .clear-all-btn:hover { opacity: 0.7; }
    .list-container { max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
    .list-item { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; transition: 0.2s; cursor: pointer; }
    .list-item:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.12); }
    .setting-row { flex-direction: column; align-items: flex-start; gap: 5px; cursor: default; }
    .setting-label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-dim); }
    .setting-control { width: 100%; background: transparent; border: none; color: var(--text); font-size: 14px; font-weight: 500; outline: none; padding: 3px 0; cursor: pointer; appearance: none; }
    .setting-control option { background: #1c1c1e; color: white; }
    .modal-close-btn { width: 100%; margin-top: 18px; padding: 13px; background: var(--text); color: var(--bg); border: none; border-radius: 10px; font-weight: 700; font-size: 13px; cursor: pointer; transition: 0.2s; }
    .modal-close-btn:hover { opacity: 0.88; }
    .secondary-btn { width: 100%; margin-top: 7px; padding: 10px; background: var(--btn-bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px; font-size: 11px; font-weight: 600; cursor: pointer; transition: 0.2s; }
    .secondary-btn:hover { background: var(--btn-hover); }
    .add-new-tab-btn { width: 100%; padding: 13px; background: rgba(79,142,255,0.09); border: 1px solid rgba(79,142,255,0.25); border-radius: 10px; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; }
    .add-new-tab-btn:hover { background: rgba(79,142,255,0.14); }
    .tab-modal-item { display: flex; align-items: center; justify-content: space-between; padding: 14px; background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; transition: 0.2s; cursor: pointer; gap: 12px; }
    .tab-modal-item:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.12); }
    .tab-modal-item.active { background: var(--accent-glow); border-color: rgba(79,142,255,0.28); }
    .tab-modal-favicon { width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; background: var(--btn-bg); }
    .tab-info { flex: 1; overflow: hidden; display: flex; align-items: center; gap: 10px; }
    .tab-text { flex: 1; overflow: hidden; }
    .tab-modal-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tab-modal-url { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tab-close-btn { width: 26px; height: 26px; border-radius: 6px; background: var(--btn-bg); border: 1px solid var(--border); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; flex-shrink: 0; font-size: 17px; opacity: 0.6; }
    .tab-close-btn:hover { background: rgba(255,77,77,0.18); border-color: var(--danger); color: var(--danger); opacity: 1; }
    .history-item-content { display: flex; align-items: center; gap: 10px; flex: 1; overflow: hidden; }
    .history-favicon { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
    .history-text { flex: 1; overflow: hidden; }
    .history-url { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .history-time { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
    .history-delete-btn { width: 22px; height: 22px; border-radius: 5px; background: var(--btn-bg); border: 1px solid var(--border); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; flex-shrink: 0; font-size: 15px; opacity: 0.55; }
    .history-delete-btn:hover { background: rgba(255,77,77,0.18); border-color: var(--danger); color: var(--danger); opacity: 1; }
    .form-group { margin-bottom: 14px; }
    .form-group label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 7px; }
    .form-group input { width: 100%; padding: 9px 13px; background: var(--btn-bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; outline: none; transition: 0.2s; }
    .form-group input:focus { background: var(--input-focus); border-color: rgba(255,255,255,0.22); }

    ::-webkit-scrollbar { width: 6px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
    ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
    * { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }