    :root {
    --bg:        #040706;
    --bg-2:      #070c09;
    --panel:     #0a100c;
    --panel-2:   #0d1511;
    --line:      #152219;
    --text:      #d3e3d9;
    --text-dim:  #729080;
    --muted:     #445a4c;
    --green:     #1f7a4d;
    --green-lit: #35b97a;
    --green-soft:rgba(var(--green-rgb),.14);
    --green-rgb: 53,185,122;
    --overlay:   rgba(4,16,10,.86);
    --chrome:    rgba(7,12,9,.72);
    --wall-tint: rgba(4,10,7,.55);
    --wall-tint-2:rgba(4,10,7,.72);
    --r:         10px;
    --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);
    --glow:      0 0 0 1px rgba(var(--green-rgb),.06), 0 12px 32px -16px rgba(var(--green-rgb),.3);
}

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

body {
    display:flex;
    flex-direction:column;
    height:100vh;
    background:var(--bg);
    color:var(--text);
    font-family:'Inter', system-ui, -apple-system, sans-serif;
    overflow:hidden;
    -webkit-font-smoothing:antialiased;
}

.wallpaper {
    display:none;
    position:fixed;
    inset:0;
    z-index:-1;
    pointer-events:none;
    background:
        linear-gradient(var(--wall-tint, rgba(4,10,7,.55)), var(--wall-tint-2, rgba(4,10,7,.72))),
        url("https://cdn.frostedbrowser.cfd/wallpapers/n.png") center / cover no-repeat,
        var(--bg);
    filter:blur(18px) saturate(1.15);
    transform:scale(1.1);
}

body[data-wallpaper="on"] .wallpaper { display:block; }

body[data-wallpaper="on"] {
    background:transparent;
}

body[data-wallpaper="on"] .tbar,
body[data-wallpaper="on"] .address-bar,
body[data-wallpaper="on"] .sidebar {
    background:var(--chrome);
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
}

body[data-wallpaper="on"] .main-search {
    background:var(--panel);
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
}

body[data-wallpaper="on"] .set-card,
body[data-wallpaper="on"] .set-section,
body[data-wallpaper="on"] .ai-prompt-bar,
body[data-wallpaper="on"] .ai-text-wpr {
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
}

svg {
    display:block;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
    fill:none;
}

.tbar {
    display:flex;
    align-items:stretch;
    gap:0;
    height:38px;
    padding:0 8px;
    background:var(--chrome);
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
    border-bottom:1px solid var(--line);
    overflow-x:auto;
    overflow-y:hidden;
    scrollbar-width:none;
}

.tbar::-webkit-scrollbar { display:none; }

.tab {
    position:relative;
    display:flex;
    align-items:center;
    gap:8px;
    flex:0 1 auto;
    min-width:0;
    max-width:190px;
    padding:0 14px;
    background:transparent;
    cursor:pointer;
    transition:opacity .18s ease;
}

.tab + .tab::before {
    content:'';
    position:absolute;
    left:0;
    top:50%;
    transform:translateY(-50%);
    width:1px;
    height:14px;
    background:var(--line);
}

.tab:hover { background:rgba(10,15,12,.6); }

.tab-fav {
    position:relative;
    width:13px;
    height:13px;
    flex-shrink:0;
    display:flex;
    align-items:center;
    justify-content:center;
    color:var(--muted);
    transition:color .18s ease;
}

.tab-fav svg { width:12px; height:12px; }

.tab-fav img {
    width:13px;
    height:13px;
    border-radius:2px;
    object-fit:contain;
}

.tab-fav .lucide-leaf {
    width:13px;
    height:13px;
    fill:var(--green);
    stroke:var(--green);
    transition:fill .18s ease, stroke .18s ease;
}

.tab.active .tab-fav .lucide-leaf {
    fill:var(--green-lit);
    stroke:var(--green-lit);
}

.tab-tl {
    flex:1;
    min-width:0;
    font-size:12px;
    color:var(--text-dim);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    transition:color .18s ease;
}

.tab.active .tab-tl {
    color:var(--text);
    font-weight:500;
}

.tab-cl {
    width:14px;
    height:14px;
    flex-shrink:0;
    display:flex;
    align-items:center;
    justify-content:center;
    color:var(--muted);
    opacity:0;
    transition:opacity .18s ease, color .18s ease;
}

.tab-cl svg { width:12px; height:12px; }
.tab:hover .tab-cl, .tab.active .tab-cl { opacity:1; }
.tab-cl:hover { color:var(--text); }

.tab.closing {
    animation:tabOut .16s ease forwards;
    overflow:hidden;
}

@keyframes tabOut {
    to { opacity:0; max-width:0; padding:0; }
}

.nt-btn {
    display:flex;
    align-items:center;
    justify-content:center;
    width:28px;
    height:28px;
    align-self:center;
    margin-left:6px;
    flex-shrink:0;
    border-radius:7px;
    color:var(--muted);
    cursor:pointer;
    transition:background .18s ease, color .18s ease;
}

.nt-btn svg { width:14px; height:14px; }
.nt-btn:hover { background:var(--panel); color:var(--green-lit); }

.main-col {
    flex:1;
    min-height:0;
    display:flex;
    flex-direction:column;
    background:transparent;
}

.address-bar {
    display:flex;
    align-items:center;
    gap:2px;
    padding:8px 12px;
    background:var(--chrome);
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
    border-bottom:1px solid var(--line);
}

.nav-btn {
    display:flex;
    align-items:center;
    justify-content:center;
    width:28px;
    height:28px;
    flex-shrink:0;
    border:none;
    background:transparent;
    border-radius:7px;
    color:var(--muted);
    cursor:pointer;
    transition:background .18s ease, color .18s ease;
}

.nav-btn svg { width:15px; height:15px; }
.nav-btn:hover { background:var(--panel); color:var(--text); }
.nav-btn:disabled { opacity:.3; cursor:default; background:transparent; color:var(--muted); }

.url-intainer {
    flex:1;
    min-width:0;
    display:flex;
    align-items:center;
    gap:9px;
    height:34px;
    margin-left:8px;
    padding:0 14px;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:8px;
    transition:border-color .18s ease, box-shadow .18s ease;
}

.url-intainer:focus-within {
    border-color:rgba(var(--green-rgb),.45);
    box-shadow:0 0 0 3px var(--green-soft);
}

.url-icon {
    width:14px;
    height:14px;
    flex-shrink:0;
    color:var(--green);
}

.url-icon svg { width:14px; height:14px; }

.url-input {
    flex:1;
    min-width:0;
    background:transparent;
    border:none;
    outline:none;
    color:var(--text);
    font-family:'Inter', sans-serif;
    font-size:13px;
}

.url-input::placeholder { color:var(--muted); }

.below {
    display:flex;
    flex:1;
    min-height:0;
}

.sidebar {
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:5px;
    width:50px;
    flex-shrink:0;
    padding:11px 0;
    background:linear-gradient(180deg, var(--panel), var(--bg) 70%);
    border-right:1px solid var(--line);
}

.sb-spacer { flex:1; }

.sb-btn {
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
    width:34px;
    height:34px;
    border:none;
    background:transparent;
    border-radius:var(--r);
    color:var(--muted);
    cursor:pointer;
    transition:background .18s ease, color .18s ease, transform .18s ease;
}

.sb-btn svg { width:17px; height:17px; transition:transform .18s ease; }
.sb-btn:hover { background:var(--panel); color:var(--text-dim); }
.sb-btn:hover svg { transform:translateY(-1px); }
.sb-btn:active { transform:scale(.94); }
.sb-btn.active { background:var(--green-soft); color:var(--green-lit); box-shadow:inset 0 0 0 1px rgba(var(--green-rgb),.16); }
.sb-btn.active::before {
    content:'';
    position:absolute;
    left:-11px;
    top:50%;
    transform:translateY(-50%);
    width:2px;
    height:16px;
    border-radius:0 2px 2px 0;
    background:var(--green-lit);
}
.sb-btn:focus { outline:none; }

.page-content {
    flex:1;
    min-width:0;
    position:relative;
    overflow:hidden;
    background:transparent;
}

.page-content { background:transparent; }

.bframe {
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    border:none;
    z-index:8;
    display:none;
    background:#fff;
}

.bframe.active { display:block; }

.bloader {
    display:none;
    position:absolute;
    inset:0;
    z-index:9;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:15px;
    background:
        radial-gradient(560px 300px at 50% 46%, rgba(20,81,47,.34), transparent 70%),
        linear-gradient(180deg, rgba(4,18,11,.91), rgba(3,12,7,.95));
    backdrop-filter:blur(7px);
    -webkit-backdrop-filter:blur(7px);
}

.bloader.active { display:flex; }

.bloader-spinner {
    width:38px;
    height:38px;
    border:2.5px solid rgba(31,122,77,.22);
    border-top-color:#1f7a4d;
    border-radius:50%;
    box-shadow:0 0 20px -4px rgba(31,122,77,.55);
    animation:spin .75s linear infinite;
}

@keyframes spin { to { transform:rotate(360deg); } }

.spinning { animation:spin .5s ease; }

.bloader-text {
    font-family:'Inter', sans-serif;
    font-size:12px;
    letter-spacing:.04em;
    color:#2f8a5a;
}

.main {
    position:absolute;
    inset:0;
    z-index:5;
    display:flex;
    overflow-y:auto;
    overflow-x:hidden;
    padding:44px 24px;
    box-sizing:border-box;
    background:transparent;
    transition:opacity .25s ease;
    scrollbar-width:thin;
}

.main.hidden {
    opacity:0;
    pointer-events:none;
    visibility:hidden;
}

.main-ctr {
    margin:auto;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:20px;
    max-width:100%;
    text-align:center;
    transform:translateY(-6px);
}

.nt-head {
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:7px;
}

.nt-sub {
    display:none;
    font-size:12.5px;
    letter-spacing:.02em;
    color:var(--muted);
}

.nt-sub.on { display:block; }

.nt-tiles {
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:10px;
    max-width:520px;
}

.nt-tile {
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:8px;
    width:76px;
    padding:12px 6px;
    background:transparent;
    border:1px solid transparent;
    border-radius:12px;
    color:var(--text-dim);
    font-family:'Inter', sans-serif;
    cursor:pointer;
    transition:background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.nt-tile:hover {
    background:var(--panel);
    border-color:var(--line);
    color:var(--text);
    transform:translateY(-1px);
}

.nt-tile-ic {
    display:flex;
    align-items:center;
    justify-content:center;
    width:34px;
    height:34px;
    border-radius:10px;
    background:var(--panel);
    border:1px solid var(--line);
    color:var(--green);
    transition:color .18s ease, border-color .18s ease;
}

.nt-tile:hover .nt-tile-ic {
    color:var(--green-lit);
    border-color:rgba(var(--green-rgb),.35);
}

.nt-tile-ic svg { width:16px; height:16px; }

.nt-tile-lb {
    max-width:100%;
    font-size:11.5px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

@media (max-width:520px) {
    .main { padding:32px 16px; }
    .main-tl { font-size:34px; }
    .nt-tile { width:66px; }
}

.nt-brand {
    display:flex;
    align-items:center;
    gap:12px;
}

.nt-brand-ic {
    width:40px;
    height:40px;
    color:var(--green-lit);
    fill:var(--green-lit);
    stroke:var(--green-lit);
    flex-shrink:0;
}

.main-tl {
    display:flex;
    font-size:46px;
    font-weight:700;
    letter-spacing:-.02em;
    color:var(--green-lit);
}

.main-char {
    display:inline-block;
    opacity:0;
    transform:translateY(14px);
    animation:charIn .5s cubic-bezier(.34,1.56,.64,1) forwards;
}

@keyframes charIn {
    to { opacity:1; transform:translateY(0); }
}

.main-search {
    display:flex;
    align-items:center;
    gap:10px;
    width:min(520px, 78vw);
    height:44px;
    padding:0 18px;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:999px;
    transition:border-color .18s ease, box-shadow .18s ease;
}

.main-search:focus-within {
    border-color:rgba(var(--green-rgb),.45);
    box-shadow:0 0 0 3px var(--green-soft);
}

.main-search-icon {
    width:16px;
    height:16px;
    flex-shrink:0;
    color:var(--muted);
}

.main-search-icon svg { width:16px; height:16px; }

.main-search-input {
    flex:1;
    min-width:0;
    background:transparent;
    border:none;
    outline:none;
    color:var(--text);
    font-family:'Inter', sans-serif;
    font-size:14px;
}

.main-search-input::placeholder { color:var(--muted); }

.ai-view {
    position:absolute;
    inset:0;
    z-index:6;
    display:none;
    flex-direction:column;
    background:transparent;
}

.ai-view.active { display:flex; }

.ai-topbar {
    display:flex;
    align-items:center;
    flex-shrink:0;
    padding:10px 14px;
    position:relative;
}

.ai-chat-btn {
    display:flex;
    align-items:center;
    gap:8px;
    height:30px;
    padding:0 11px;
    background:transparent;
    border:1px solid var(--line);
    border-radius:8px;
    color:var(--text-dim);
    font-family:'Inter', sans-serif;
    font-size:12.5px;
    cursor:pointer;
    transition:background .18s ease, border-color .18s ease, color .18s ease;
}

.ai-chat-btn:hover { background:var(--panel); color:var(--text); }
.ai-chat-btn svg { width:14px; height:14px; }
.ai-chat-btn .ai-chv { width:12px; height:12px; color:var(--muted); transition:transform .18s ease; }
.ai-chat-btn .ai-chv.open { transform:rotate(180deg); }

.ai-dr {
    position:absolute;
    top:46px;
    left:14px;
    z-index:30;
    display:none;
    flex-direction:column;
    width:250px;
    max-height:330px;
    padding:6px;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:10px;
    box-shadow:0 18px 40px rgba(0,0,0,.6);
}

.ai-dr.open { display:flex; }

.ai-top-spacer { flex:1; }

.ai-model-btn { color:var(--green-lit); }

.ai-mdr { left:auto; right:14px; }

.ai-new {
    display:flex;
    align-items:center;
    gap:9px;
    padding:8px 10px;
    border-radius:7px;
    font-size:12.5px;
    color:var(--green-lit);
    cursor:pointer;
    transition:background .18s ease;
}

.ai-new:hover { background:var(--green-soft); }
.ai-new svg { width:14px; height:14px; }

.ai-divider { height:1px; background:var(--line); margin:6px 4px; }

.ai-chat-list {
    display:flex;
    flex-direction:column;
    gap:1px;
    overflow-y:auto;
    scrollbar-width:thin;
}

.ai-chat-opt {
    display:flex;
    align-items:center;
    gap:6px;
    padding:7px 8px;
    border-radius:7px;
    cursor:pointer;
    transition:background .18s ease;
}

.ai-chat-opt:hover { background:rgba(var(--green-rgb),.06); }
.ai-chat-opt.active { background:var(--green-soft); }

.ai-chat-opt-main {
    display:flex;
    align-items:center;
    gap:8px;
    flex:1;
    min-width:0;
    color:var(--text-dim);
}

.ai-chat-opt.active .ai-chat-opt-main { color:var(--text); }
.ai-chat-opt-main svg { width:13px; height:13px; flex-shrink:0; }

.ai-chat-opt-main span {
    font-size:12px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.ai-chat-del {
    display:flex;
    align-items:center;
    justify-content:center;
    width:22px;
    height:22px;
    flex-shrink:0;
    border-radius:6px;
    color:var(--muted);
    opacity:0;
    transition:opacity .18s ease, color .18s ease;
}

.ai-chat-opt:hover .ai-chat-del { opacity:1; }
.ai-chat-del:hover { color:#e06a6a; }
.ai-chat-del svg { width:13px; height:13px; }

.ai-content {
    flex:1;
    min-height:0;
    overflow-y:auto;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:18px;
    padding:26px 22px;
    scrollbar-width:thin;
}

.ai-empty {
    margin:auto;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:9px;
    max-width:560px;
    text-align:center;
}

.ai-empty-mark {
    display:flex;
    align-items:center;
    justify-content:center;
    width:44px;
    height:44px;
    margin-bottom:5px;
    border-radius:13px;
    background:var(--green-soft);
    color:var(--green-lit);
}

.ai-empty-mark svg { width:21px; height:21px; }

.ai-empty-title {
    font-size:20px;
    font-weight:600;
    letter-spacing:-.01em;
    color:var(--text);
}

.ai-empty-sub { font-size:12.5px; color:var(--muted); }

.ai-chips {
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:7px;
    margin-top:15px;
}

.ai-chip {
    display:flex;
    align-items:center;
    gap:7px;
    padding:7px 13px;
    background:transparent;
    border:1px solid var(--line);
    border-radius:999px;
    color:var(--text-dim);
    font-family:'Inter', sans-serif;
    font-size:12px;
    cursor:pointer;
    transition:border-color .18s ease, background .18s ease, color .18s ease;
}

.ai-chip svg { width:13px; height:13px; color:var(--green); }

.ai-chip:hover {
    background:var(--panel);
    border-color:rgba(var(--green-rgb),.35);
    color:var(--text);
}

.ai-msg {
    width:min(720px, 100%);
    flex-shrink:0;
    font-size:13.5px;
    line-height:1.68;
    word-wrap:break-word;
}

.ai-msg-user {
    align-self:flex-end;
    width:auto;
    max-width:min(560px, 82%);
    padding:10px 15px;
    background:var(--green-soft);
    border:1px solid rgba(var(--green-rgb),.2);
    border-radius:12px;
    color:var(--text);
}

.ai-msg-ai {
    align-self:flex-start;
    color:var(--text);
}

.ai-msg-sys {
    align-self:center;
    width:auto;
    max-width:min(720px, 100%);
    padding:5px 12px;
    border:1px solid var(--line);
    border-radius:999px;
    color:var(--muted);
    font-size:12px;
}

.ai-msg-ai p { margin:0 0 10px; }
.ai-msg-ai p:last-child { margin-bottom:0; }
.ai-msg-ai ul, .ai-msg-ai ol { margin:0 0 10px; padding-left:22px; }
.ai-msg-ai li { margin:3px 0; }
.ai-msg-ai h1, .ai-msg-ai h2, .ai-msg-ai h3 {
    margin:16px 0 8px;
    font-weight:600;
    color:var(--green-lit);
}
.ai-msg-ai h1 { font-size:17px; }
.ai-msg-ai h2 { font-size:15px; }
.ai-msg-ai h3 { font-size:13.5px; }
.ai-msg-ai code {
    padding:1.5px 5px;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:4px;
    font-family:ui-monospace, 'SF Mono', Menlo, monospace;
    font-size:12px;
}
.ai-msg-ai pre {
    margin:0 0 10px;
    padding:12px 14px;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:8px;
    overflow-x:auto;
}
.ai-msg-ai pre code { padding:0; background:none; border:none; }
.ai-msg-ai a { color:var(--green-lit); }
.ai-msg-ai blockquote {
    margin:0 0 10px;
    padding-left:12px;
    border-left:2px solid var(--line);
    color:var(--text-dim);
}
.ai-msg-ai table { border-collapse:collapse; margin:0 0 10px; }
.ai-msg-ai th, .ai-msg-ai td {
    padding:5px 10px;
    border:1px solid var(--line);
    font-size:12.5px;
}

.ai-msg-error { color:#e06a6a; }

.ai-thinking {
    display:flex;
    align-items:center;
    gap:9px;
    color:var(--text-dim);
    font-size:12.5px;
}

.ai-thinking-spinner {
    width:13px;
    height:13px;
    border:1.5px solid rgba(var(--green-rgb),.2);
    border-top-color:var(--green-lit);
    border-radius:50%;
    animation:spin .7s linear infinite;
}

.ai-prompt-bar {
    flex-shrink:0;
    display:flex;
    justify-content:center;
    padding:10px 22px 24px;
}

.ai-prompt-group {
    width:min(760px, 100%);
    display:flex;
    flex-direction:column;
    gap:8px;
}

.ai-text-wpr {
    display:flex;
    align-items:center;
    gap:11px;
    height:54px;
    padding:0 8px 0 17px;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:16px;
    transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.ai-text-wpr:hover { border-color:rgba(var(--green-rgb),.28); }

.ai-text-wpr:focus-within {
    background:var(--panel-2);
    border-color:rgba(var(--green-rgb),.5);
    box-shadow:0 0 0 3px var(--green-soft);
}

.ai-text-icon { width:17px; height:17px; flex-shrink:0; color:var(--green); }

.ai-text-input {
    flex:1;
    min-width:0;
    background:transparent;
    border:none;
    outline:none;
    color:var(--text);
    font-family:'Inter', sans-serif;
    font-size:14px;
}

.ai-text-input::placeholder { color:var(--muted); }

.ai-send-btn {
    display:flex;
    align-items:center;
    justify-content:center;
    width:38px;
    height:38px;
    flex-shrink:0;
    background:var(--green);
    border:none;
    border-radius:11px;
    color:#eaf5ee;
    cursor:pointer;
    transition:background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.ai-send-btn svg { width:17px; height:17px; }
.ai-send-btn:hover { background:var(--green-lit); box-shadow:var(--glow); }
.ai-send-btn:active { transform:scale(.93); }
.ai-send-btn:disabled { opacity:.45; cursor:not-allowed; }
.ai-send-btn .ai-stop-icon { display:none; }
.ai-send-btn.stop-mode { background:#7a2f2f; }
.ai-send-btn.stop-mode .ai-send-icon { display:none; }
.ai-send-btn.stop-mode .ai-stop-icon { display:block; }

body[data-accent="teal"]   { --green:#166b70; --green-lit:#2fb3bb; --green-rgb:47,179,187;  --green-soft:rgba(47,179,187,.14); }
body[data-accent="lime"]   { --green:#4d7a1f; --green-lit:#8ecf3f; --green-rgb:142,207,63;  --green-soft:rgba(142,207,63,.14); }
body[data-accent="blue"]   { --green:#1f4d7a; --green-lit:#4a9bea; --green-rgb:74,155,234;  --green-soft:rgba(74,155,234,.14); }
body[data-accent="violet"] { --green:#4a2f7a; --green-lit:#9a7ae8; --green-rgb:154,122,232; --green-soft:rgba(154,122,232,.14); }
body[data-accent="amber"]  { --green:#7a5a1f; --green-lit:#e0a83f; --green-rgb:224,168,63;  --green-soft:rgba(224,168,63,.14); }

body[data-theme="dim"] {
    --bg:#0d1210;
    --bg-2:#101713;
    --panel:#141b17;
    --panel-2:#18211c;
    --line:#22322a;
    --text:#cfdcd4;
    --text-dim:#7d9187;
    --muted:#4d6055;
    --overlay:rgba(13,18,16,.86);
    --chrome:rgba(19,26,22,.72);
    --wall-tint:rgba(10,15,13,.55);
    --wall-tint-2:rgba(10,15,13,.72);
    --shadow:0 1px 2px rgba(0,0,0,.35), 0 8px 24px -12px rgba(0,0,0,.6);
}

body[data-theme="light"] {
    --bg:#f2f5f3;
    --bg-2:#e9efeb;
    --panel:#ffffff;
    --panel-2:#f6f9f7;
    --line:#d8e0da;
    --text:#101a15;
    --text-dim:#4a5b52;
    --muted:#8a9a91;
    --overlay:rgba(242,245,243,.86);
    --chrome:rgba(242,245,243,.78);
    --wall-tint:rgba(242,245,243,.55);
    --wall-tint-2:rgba(242,245,243,.72);
    --shadow:0 1px 2px rgba(0,0,0,.06), 0 8px 24px -12px rgba(0,0,0,.12);
}

body[data-theme="light"] .tab:hover { background:rgba(0,0,0,.04); }
body[data-theme="light"] .ai-chat-opt:hover { background:rgba(0,0,0,.04); }
body[data-theme="light"] .ai-chip:hover { background:rgba(0,0,0,.03); }
body[data-theme="light"] .set-swatch { border-color:rgba(0,0,0,.14); }
body[data-theme="light"] .ai-dr { box-shadow:0 18px 40px rgba(0,0,0,.14); }

body[data-tabs="bar"] .tab.active::after {
    content:'';
    position:absolute;
    left:12px;
    right:12px;
    bottom:0;
    height:2px;
    border-radius:1px 1px 0 0;
    background:var(--green-lit);
}

body[data-tabs="bar"] .tab.active .tab-fav .lucide-leaf { fill:var(--green-lit); stroke:var(--green-lit); }

.launch-view {
    position:absolute;
    inset:0;
    z-index:6;
    display:none;
    flex-direction:column;
    overflow:hidden;
}

.launch-view.active { display:flex; }

.launch-head {
    display:flex;
    flex-direction:column;
    gap:4px;
    flex-shrink:0;
    padding:32px 30px 6px;
}

.launch-title {
    font-size:22px;
    font-weight:600;
    letter-spacing:-.02em;
    color:var(--green-lit);
}

.launch-sub { font-size:12.5px; color:var(--muted); }

.launch-srcs {
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    margin-top:12px;
}

.launch-src {
    height:28px;
    padding:0 13px;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:999px;
    color:var(--text-dim);
    font-family:'Inter', sans-serif;
    font-size:12px;
    cursor:pointer;
    transition:background .18s ease, border-color .18s ease, color .18s ease;
}

.launch-src:hover { background:var(--panel-2); color:var(--text); }

.launch-src.active {
    background:var(--green-soft);
    border-color:rgba(var(--green-rgb),.45);
    color:var(--green-lit);
}

.launch-body {
    flex:1;
    min-height:0;
    overflow-y:auto;
    padding:18px 30px 52px;
    scrollbar-width:thin;
}

.launch-search-wpr {
    display:flex;
    align-items:center;
    gap:9px;
    height:40px;
    max-width:420px;
    margin-bottom:18px;
    padding:0 14px;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:10px;
    transition:border-color .18s ease, box-shadow .18s ease;
}

.launch-search-wpr:focus-within {
    border-color:rgba(var(--green-rgb),.45);
    box-shadow:0 0 0 3px var(--green-soft);
}

.launch-search-ic { width:15px; height:15px; flex-shrink:0; color:var(--muted); }

.launch-search {
    flex:1;
    min-width:0;
    background:transparent;
    border:none;
    outline:none;
    color:var(--text);
    font-family:'Inter', sans-serif;
    font-size:13px;
}

.launch-search::placeholder { color:var(--muted); }

.launch-empty {
    grid-column:1 / -1;
    padding:38px 0;
    color:var(--muted);
    font-size:13px;
    text-align:center;
}

.launch-grid {
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(150px, 1fr));
    gap:14px;
    max-width:1000px;
}

/* square tiles: big art/icon on top, label underneath */
.launch-card {
    position:relative;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:10px;
    aspect-ratio:1 / 1;
    padding:14px 12px;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:var(--r);
    color:var(--text-dim);
    font-family:'Inter', sans-serif;
    text-align:center;
    cursor:pointer;
    overflow:hidden;
    transition:background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.launch-card:hover {
    background:var(--panel-2);
    border-color:rgba(var(--green-rgb),.3);
    color:var(--text);
    transform:translateY(-2px);
    box-shadow:var(--glow);
}

.launch-card-ic {
    display:flex;
    align-items:center;
    justify-content:center;
    width:74px;
    height:74px;
    flex-shrink:0;
    border-radius:16px;
    background:rgba(var(--green-rgb),.07);
    border:1px solid rgba(var(--green-rgb),.14);
    color:var(--green);
    transition:color .18s ease, background .18s ease, border-color .18s ease;
}

.launch-card:hover .launch-card-ic {
    color:var(--green-lit);
    background:rgba(var(--green-rgb),.12);
    border-color:rgba(var(--green-rgb),.3);
}

/* placeholder icon fills the tile art box */
.launch-card-ic svg { width:38px; height:38px; }

/* cover art fills the tile art box */
.launch-card-img {
    width:100%;
    height:100%;
    border-radius:15px;
    object-fit:cover;
    display:block;
}

.launch-card-tx {
    display:flex;
    flex-direction:column;
    gap:3px;
    min-width:0;
    width:100%;
}
.launch-card-lb {
    font-size:12.5px;
    font-weight:500;
    color:var(--text);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.launch-card-hs {
    font-size:10.5px;
    color:var(--muted);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

/* games whose backing file is missing */
.launch-card--off {
    opacity:.45;
    cursor:not-allowed;
}
.launch-card--off:hover {
    transform:none;
    border-color:var(--line);
    background:var(--panel);
    box-shadow:none;
}

@media (max-width:560px) {
    .launch-head { padding:22px 18px 4px; }
    .launch-body { padding:14px 18px 40px; }
    .launch-grid { grid-template-columns:repeat(auto-fill, minmax(124px, 1fr)); gap:10px; }
    .launch-card-ic { width:58px; height:58px; border-radius:13px; }
    .launch-card-ic svg { width:30px; height:30px; }
    .launch-card-img { border-radius:12px; }
}

.set-view {
    position:absolute;
    inset:0;
    z-index:7;
    display:none;
    flex-direction:column;
    background:transparent;
    overflow:hidden;
}

.set-view.active { display:flex; }

.set-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    flex-shrink:0;
    padding:16px 26px;
    border-bottom:1px solid var(--line);
}

.set-head-l { display:flex; align-items:baseline; gap:10px; min-width:0; }

.set-title {
    font-size:14px;
    font-weight:600;
    letter-spacing:-.01em;
    color:var(--text);
}

.set-count { font-size:11.5px; color:var(--green-lit); white-space:nowrap; }
.set-head-r { display:flex; align-items:center; gap:10px; flex-shrink:0; }

.set-filter {
    display:flex;
    align-items:center;
    gap:8px;
    width:230px;
    height:32px;
    padding:0 12px;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:8px;
    transition:border-color .18s ease, box-shadow .18s ease;
}

.set-filter:focus-within {
    border-color:rgba(var(--green-rgb),.45);
    box-shadow:0 0 0 3px var(--green-soft);
}

.set-filter svg { width:13px; height:13px; flex-shrink:0; color:var(--muted); }

.set-filter input {
    flex:1;
    min-width:0;
    background:transparent;
    border:none;
    outline:none;
    color:var(--text);
    font-family:'Inter', sans-serif;
    font-size:12.5px;
}

.set-filter input::placeholder { color:var(--muted); }

.set-close {
    display:flex;
    align-items:center;
    justify-content:center;
    width:32px;
    height:32px;
    border:none;
    background:transparent;
    border-radius:8px;
    color:var(--muted);
    cursor:pointer;
    transition:background .18s ease, color .18s ease;
}

.set-close svg { width:15px; height:15px; }
.set-close:hover { background:var(--panel); color:var(--text); }

.set-body {
    flex:1;
    min-height:0;
    overflow-y:auto;
    width:min(780px, 100%);
    margin:0 auto;
    padding:24px 26px 56px;
    display:flex;
    flex-direction:column;
    gap:28px;
    scrollbar-width:thin;
}

.set-group { display:flex; flex-direction:column; gap:10px; }

.set-group-title {
    display:flex;
    align-items:center;
    gap:7px;
    font-size:10.5px;
    letter-spacing:.09em;
    color:var(--muted);
}

.set-group-title svg { width:12px; height:12px; }

.set-card {
    display:flex;
    flex-direction:column;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:12px;
    overflow:hidden;
}

.set-row {
    display:flex;
    align-items:center;
    gap:14px;
    padding:14px 16px;
    transition:background .18s ease;
}

.set-row + .set-row { border-top:1px solid var(--line); }
.set-row:hover { background:rgba(var(--green-rgb),.03); }

.set-ic {
    display:flex;
    align-items:center;
    justify-content:center;
    width:32px;
    height:32px;
    flex-shrink:0;
    border-radius:9px;
    background:rgba(var(--green-rgb),.07);
    border:1px solid rgba(var(--green-rgb),.14);
    color:var(--green);
}

.set-ic svg { width:15px; height:15px; }
.set-ic-leaf { color:var(--green-lit); border-color:rgba(var(--green-rgb),.28); }

.set-info { display:flex; flex-direction:column; gap:3px; min-width:0; flex:1; }
.set-label { font-size:13px; color:var(--text); }
.set-sub   { font-size:11.5px; color:var(--muted); }

.set-swatches { display:flex; gap:9px; flex-shrink:0; }

.set-swatch {
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
    width:24px;
    height:24px;
    padding:0;
    border-radius:50%;
    border:1px solid rgba(255,255,255,.14);
    cursor:pointer;
    transition:transform .16s ease, box-shadow .16s ease;
}

.set-swatch svg { width:13px; height:13px; color:#fff; opacity:0; transition:opacity .16s ease; }
.set-swatch:hover { transform:scale(1.12); }
.set-swatch.active svg { opacity:1; }
.set-swatch.active { box-shadow:0 0 0 2px var(--panel), 0 0 0 3.5px currentColor; }

.set-swatch[data-accent="green"]  { background:#1f7a4d; color:#1f7a4d; }
.set-swatch[data-accent="teal"]   { background:#166b70; color:#166b70; }
.set-swatch[data-accent="lime"]   { background:#4d7a1f; color:#4d7a1f; }
.set-swatch[data-accent="blue"]   { background:#1f4d7a; color:#1f4d7a; }
.set-swatch[data-accent="violet"] { background:#4a2f7a; color:#4a2f7a; }
.set-swatch[data-accent="amber"]  { background:#7a5a1f; color:#7a5a1f; }

.set-seg {
    display:flex;
    gap:2px;
    flex-shrink:0;
    padding:3px;
    background:var(--bg);
    border:1px solid var(--line);
    border-radius:9px;
}

.set-seg-btn {
    display:flex;
    align-items:center;
    gap:6px;
    padding:5px 11px;
    border:none;
    background:transparent;
    border-radius:6px;
    color:var(--text-dim);
    font-family:'Inter', sans-serif;
    font-size:12px;
    cursor:pointer;
    transition:background .16s ease, color .16s ease;
}

.set-seg-btn svg { width:12px; height:12px; }
.set-seg-btn:hover { color:var(--text); }
.set-seg-btn.active { background:var(--green-soft); color:var(--green-lit); }

.set-prev { width:11px; height:11px; border-radius:3px; border:1px solid var(--line); }
.set-prev[data-p="black"] { background:#050807; }
.set-prev[data-p="dim"]   { background:#0d1210; }
.set-prev[data-p="light"] { background:#f2f5f3; }

.set-bar-prev { width:12px; height:2px; border-radius:1px; background:currentColor; }

.set-select {
    flex-shrink:0;
    height:32px;
    padding:0 10px;
    background:var(--bg);
    border:1px solid var(--line);
    border-radius:8px;
    color:var(--text);
    font-family:'Inter', sans-serif;
    font-size:12.5px;
    cursor:pointer;
    outline:none;
    transition:border-color .18s ease;
}

.set-select:hover { border-color:rgba(var(--green-rgb),.35); }

.set-toggle {
    position:relative;
    width:40px;
    height:23px;
    flex-shrink:0;
    padding:0;
    background:var(--bg);
    border:1px solid var(--line);
    border-radius:999px;
    cursor:pointer;
    transition:background .18s ease, border-color .18s ease;
}

.set-knob {
    position:absolute;
    top:3px;
    left:3px;
    width:15px;
    height:15px;
    border-radius:50%;
    background:var(--muted);
    transition:transform .18s ease, background .18s ease;
}

.set-toggle[aria-checked="true"] { background:var(--green-soft); border-color:rgba(var(--green-rgb),.4); }
.set-toggle[aria-checked="true"] .set-knob { transform:translateX(17px); background:var(--green-lit); }

.set-danger {
    display:flex;
    align-items:center;
    gap:6px;
    flex-shrink:0;
    padding:7px 12px;
    background:transparent;
    border:1px solid var(--line);
    border-radius:8px;
    color:#e06a6a;
    font-family:'Inter', sans-serif;
    font-size:12px;
    cursor:pointer;
    transition:background .16s ease, border-color .16s ease;
}

.set-danger svg { width:13px; height:13px; }
.set-danger:hover { background:rgba(224,106,106,.1); border-color:rgba(224,106,106,.35); }

.set-row.filtered, .set-group.filtered { display:none; }

.set-empty {
    display:none;
    flex-direction:column;
    align-items:center;
    gap:10px;
    padding:44px 0;
    color:var(--muted);
    font-size:12.5px;
}

.set-empty.on { display:flex; }
.set-empty svg { width:22px; height:22px; }

@media (max-width:640px) {
    .set-head { flex-wrap:wrap; padding:14px 18px; }
    .set-filter { width:100%; }
    .set-head-r { width:100%; }
    .set-body { padding:20px 18px 44px; }
    .set-row { flex-wrap:wrap; }
    .set-info { flex-basis:calc(100% - 46px); }
    .set-swatches, .set-seg, .set-select, .set-toggle, .set-danger { margin-left:46px; }
}