    :root{--bg:#f9fafb;--fg:#020617;--card-bg:#fff;--muted:#6b7280;--muted-strong:#111827;--accent:#2563eb;--accent-soft:#60a5fa;--border-subtle:#e5e7eb;--result-border:#e5e7eb;--code-bg:#e5e7eb;--url:#15803d;color-scheme:light;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,sans-serif}
    body.theme-dark{--bg:#020617;--fg:#e2e8f0;--card-bg:#020617;--muted:#64748b;--muted-strong:#94a3b8;--accent:#3b82f6;--accent-soft:#60a5fa;--border-subtle:#111827;--result-border:#0f172a;--code-bg:#020617;--url:#16a34a;color-scheme:dark}
    *{box-sizing:border-box} body{margin:0;min-height:100vh;background:var(--bg);color:var(--fg);display:flex;justify-content:center}
    main{width:100%;max-width:720px;padding:3rem 1.5rem 4rem;display:flex;flex-direction:column;align-items:center}
    .top-bar{position:fixed;top:1rem;right:1.5rem;display:flex;align-items:center;gap:.5rem;font-size:.78rem;color:var(--muted);z-index:10}
    .chip{padding:.35rem .7rem;border-radius:999px;border:1px solid var(--border-subtle);background:var(--card-bg);color:var(--fg);display:inline-flex;align-items:center;gap:.35rem;cursor:pointer;font-size:.8rem;box-shadow:0 1px 2px rgba(15,23,42,.08)}
    .chip[disabled]{opacity:.5;cursor:not-allowed} .chip:hover{border-color:var(--accent-soft)}
    .brand{text-align:center;margin:4rem 0 2.5rem}.logo{font-size:clamp(2.4rem,5vw,3.4rem);font-weight:700;letter-spacing:.04em;margin:0 0 .4rem}.dot{color:var(--accent)} .tagline{margin:0;font-size:.9rem;color:var(--muted)}
    form{width:100%;max-width:620px;display:flex;gap:.6rem;margin-bottom:1rem}
    input[type="search"]{flex:1;padding:.9rem 1.2rem;border-radius:999px;border:1px solid var(--border-subtle);background:var(--card-bg);color:var(--fg);font-size:1rem;outline:none}
    input[type="search"]::placeholder{color:var(--muted)} input[type="search"]:focus{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
    button{padding:.9rem 1.4rem;border-radius:999px;border:none;background:var(--accent);color:#f9fafb;font-weight:600;cursor:pointer;font-size:.95rem;display:inline-flex;align-items:center;justify-content:center}
    button:hover{background:#1d4ed8}
    .hint{font-size:.78rem;color:var(--muted);margin-bottom:1.5rem;text-align:center}
    .results-shell{width:100%;max-width:680px;border-top:1px solid var(--border-subtle);padding-top:1.2rem;margin-top:1.5rem}
    .meta{display:none;justify-content:space-between;align-items:center;font-size:.8rem;color:var(--muted);margin-bottom:.75rem}
    .results{width:100%}.result{padding:.75rem 0;border-bottom:1px solid var(--result-border)} .result:last-child{border-bottom:none}
    .result-title{font-size:1rem;font-weight:600;margin:0}.result-title a{color:var(--accent-soft);text-decoration:none}.result-title a:hover{text-decoration:underline}
    .result-url{font-size:.8rem;color:var(--url);margin:.1rem 0 .3rem}.result-snippet{font-size:.92rem;color:var(--muted-strong)}
    .empty{font-size:.9rem;color:var(--muted);margin-top:.25rem} footer{margin-top:3rem;font-size:.75rem;color:var(--muted);text-align:center}
    .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}
    .spinner{display:inline-block;width:14px;height:14px;border:2px solid var(--muted);border-right-color:transparent;border-radius:50%;animation:spin .7s linear infinite;margin-right:.4rem}
    @keyframes spin{to{transform:rotate(360deg)}}

    /* Space view (full black) */
    #spaceView{position:fixed;inset:0;display:none;background:#000;color:#fff;z-index:5}
    #spaceInner{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem}
    #spaceTitle{font-size:clamp(2rem,6vw,3rem);font-weight:800;letter-spacing:.03em;margin:0}
    .space-meta{font-size:.85rem;color:#9ca3af}
    .space-btn{margin-top:.5rem;color:#9ca3af;text-decoration:none;border:1px solid #1f2937;padding:.35rem .7rem;border-radius:999px;background:transparent}
    .space-btn:hover{color:#fff;border-color:#fff}

    /* “My Spaces” view */
    #spacesView{display:none;width:100%;max-width:720px}
    .spaces-head{display:flex;align-items:center;justify-content:space-between;width:100%;margin:3.5rem 0 1rem}
    .spaces-title{font-size:1.2rem;font-weight:700;margin:0}
    .spaces-list{width:100%;border-top:1px solid var(--border-subtle)}
    .space-row{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.9rem 0;border-bottom:1px solid var(--border-subtle)}
    .space-row a{color:var(--accent-soft);text-decoration:none;font-weight:600}
    .space-row a:hover{text-decoration:underline}
    .space-sub{font-size:.82rem;color:var(--muted)}
        /* Space blocks editor */
    .blocks{width:min(900px,92vw);margin:1rem auto 2rem;display:flex;flex-direction:column;gap:.9rem}
    .block{background:#0b0b0b;color:#fff;border:1px solid #1f2937;border-radius:8px;padding:.9rem}
    .block img,.block video{max-width:100%;height:auto;display:block}
    .b-toolbar{display:flex;gap:.4rem;margin-top:.5rem;opacity:.8}
    .b-toolbar button{border:1px solid #374151;background:transparent;color:#9ca3af;padding:.25rem .5rem;border-radius:6px;cursor:pointer}
    .b-toolbar button:hover{color:#fff;border-color:#fff}
    .addbar{position:sticky;bottom:1rem;display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center}
    .addbar .chip{background:#0b0b0b;border-color:#1f2937;color:#9ca3af}
    .addbar .chip:hover{border-color:#fff;color:#fff}
