/* Shared theme layer. Loaded after app.css/apps.css. */
body.theme-spyroz{--accent:var(--custom-accent,#8ea6ff);--bg:#040609;--panel:#090d14;--panel2:#0b111b;--line:rgba(150,170,220,.16);--text:#eef3ff;--muted:#7d879b;--good:#78dca9;--danger:#ff7580;--theme-input:#070a10;--theme-panel:#080b11;--theme-deep:#05080d;--theme-top:rgba(4,6,9,.9)}

body.theme-fenix{--accent:#ff4f7b;--bg:#08070d;--panel:#100d17;--panel2:#15101f;--line:rgba(255,91,139,.20);--text:#fff3f7;--muted:#a4869a;--good:#70e0ae;--danger:#ff6b74;--theme-input:#0d0a13;--theme-panel:#100c16;--theme-deep:#07060b;--theme-top:rgba(9,6,12,.92);background-color:var(--bg)}
body.theme-fenix.public{background-color:#08070d;background-image:radial-gradient(circle at 18% 20%,rgba(255,62,123,.12),transparent 32%),radial-gradient(circle at 82% 72%,rgba(116,67,255,.10),transparent 31%),linear-gradient(135deg,#07060b,#0b0710 58%,#07060a)}
body.theme-fenix .brand{color:#fff2f6;text-shadow:0 0 22px rgba(255,59,117,.34),0 0 55px rgba(116,67,255,.14)}
body.theme-fenix .hero-brand{background:linear-gradient(90deg,#fff,#ff668e 52%,#a981ff);-webkit-background-clip:text;background-clip:text;color:transparent;text-shadow:none}
body.theme-fenix .search-box{background:rgba(13,9,17,.88);border-color:rgba(255,84,130,.28);box-shadow:0 20px 70px rgba(0,0,0,.52),0 0 42px rgba(255,55,113,.08)}
body.theme-fenix .utility-nav,body.theme-fenix .suite-nav{background:rgba(10,7,13,.68)}

body.theme-studio{--accent:#ef3347;--bg:#080506;--panel:#110c0e;--panel2:#171012;--line:rgba(239,51,71,.20);--text:#f7f2f3;--muted:#9b8388;--good:#37df8c;--danger:#ff5263;--theme-input:#0d090a;--theme-panel:#110c0e;--theme-deep:#070506;--theme-top:rgba(9,6,7,.96);background-color:var(--bg)}
body.theme-studio.public{background:#080506;background-image:linear-gradient(rgba(239,51,71,.018) 1px,transparent 1px),linear-gradient(90deg,rgba(239,51,71,.018) 1px,transparent 1px),radial-gradient(circle at 50% 12%,rgba(209,25,42,.13),transparent 34%);background-size:48px 48px,48px 48px,100% 100%}
body.theme-studio .ambient{background:linear-gradient(120deg,transparent 0 46%,rgba(230,35,54,.055) 50%,transparent 54%)}
body.theme-studio .brand{color:#fff4f5;text-shadow:0 0 26px rgba(230,38,57,.23)}
body.theme-studio .search-box{background:rgba(14,9,10,.94);border-color:rgba(230,42,59,.28);border-radius:4px;box-shadow:0 18px 55px rgba(0,0,0,.55),0 0 30px rgba(231,33,52,.055)}
body.theme-studio .metric,body.theme-studio .panel{border-radius:2px}
body.theme-studio .btn,body.theme-studio input,body.theme-studio select,body.theme-studio textarea,body.theme-studio .tool-btn,body.theme-studio .tool-select,body.theme-studio .tool-input{border-radius:2px}
body.theme-studio .suite-nav,body.theme-studio .app-toolbar,body.theme-studio .tabs-bar,body.theme-studio .code-status{background:#0b0809;border-color:rgba(239,51,71,.16)}
body.theme-studio .suite-brand{font-weight:600;letter-spacing:.04em;text-indent:0}

body.theme-google{--accent:#1a73e8;--bg:#ffffff;--panel:#ffffff;--panel2:#f8fafd;--line:#dadce0;--text:#202124;--muted:#5f6368;--good:#188038;--danger:#d93025;--theme-input:#ffffff;--theme-panel:#ffffff;--theme-deep:#f8fafd;--theme-top:rgba(255,255,255,.96);--font:Arial,'Segoe UI',sans-serif;background:#fff;color:#202124;font-weight:400}
body.theme-google.public{background:#fff;background-image:none}
body.theme-google .ambient{display:none}
body.theme-google .brand{color:#202124;text-shadow:none;font-family:Arial,'Segoe UI',sans-serif;font-weight:500;letter-spacing:-.03em;text-indent:0}
body.theme-google .hero-brand{font-size:clamp(48px,8vw,88px);font-weight:500}
body.theme-google .system-tag,body.theme-google .eyebrow{color:#80868b;letter-spacing:.09em}
body.theme-google .search-box{background:#fff;border:1px solid #dfe1e5;border-radius:24px;box-shadow:0 1px 6px rgba(32,33,36,.20)}
body.theme-google .search-box:focus-within{border-color:#dfe1e5;box-shadow:0 1px 6px rgba(32,33,36,.28)}
body.theme-google .search-box input{color:#202124}
body.theme-google .search-box input::placeholder{color:#80868b}
body.theme-google .search-box button{color:#4285f4;border-left:0}
body.theme-google .utility-nav{color:#3c4043;background:transparent!important;backdrop-filter:none!important;font-family:Arial,'Segoe UI',sans-serif;letter-spacing:0;font-size:12px}
body.theme-google .utility-nav a,body.theme-google .utility-login{letter-spacing:0;text-transform:none;color:#3c4043}
body.theme-google .utility-nav a:hover,body.theme-google .utility-login:hover{color:#1a73e8;text-shadow:none;text-decoration:underline}
body.theme-google .public-nav{color:#5f6368;font-family:Arial,'Segoe UI',sans-serif;letter-spacing:.02em}
body.theme-google .public-nav a:hover{color:#1a73e8}
body.theme-google .home-shell footer{color:#70757a}
body.theme-google .index-count{color:#70757a;letter-spacing:.06em}
body.theme-google .results-header{background:rgba(255,255,255,.96);border-color:#ebedef;box-shadow:0 1px 2px rgba(60,64,67,.08)}
body.theme-google .result{border-color:#ebedef}
body.theme-google .result-domain{color:#202124}
body.theme-google .result-title{color:#1a0dab}
body.theme-google .result-title:hover{color:#1a0dab;text-shadow:none;text-decoration:underline}
body.theme-google .result-url{color:#188038}
body.theme-google .result p{color:#4d5156}
body.theme-google .result-meta,body.theme-google .pagination{color:#70757a}
body.theme-google .empty-state h2{color:#202124}

/* Shared surfaces driven by theme variables. */
body[class*="theme-"] input,body[class*="theme-"] select,body[class*="theme-"] textarea{background:var(--theme-input);color:var(--text);border-color:var(--line)}
body[class*="theme-"] .admin-body,body.admin-body[class*="theme-"]{background:var(--bg)}
body[class*="theme-"] .sidebar{background:var(--theme-deep);border-color:var(--line)}
body[class*="theme-"] .sidebar nav a:hover,body[class*="theme-"] .sidebar nav a.active{background:var(--panel2);color:var(--text)}
body[class*="theme-"] .metric,body[class*="theme-"] .panel{background:var(--theme-panel);border-color:var(--line)}
body[class*="theme-"] .metric b,body[class*="theme-"] .panel-head h2,body[class*="theme-"] .admin-top h1{color:var(--text)}
body[class*="theme-"] .metric span,body[class*="theme-"] .panel-head>span,body[class*="theme-"] .panel-head>a,body[class*="theme-"] .muted{color:var(--muted)}
body[class*="theme-"] td{color:color-mix(in srgb,var(--text) 72%,var(--muted));border-color:color-mix(in srgb,var(--line) 70%,transparent)}
body[class*="theme-"] th{color:var(--muted);border-color:var(--line)}
body[class*="theme-"] .btn{background:var(--panel2);color:var(--text);border-color:var(--line)}
body[class*="theme-"] .btn.primary{background:color-mix(in srgb,var(--accent) 14%,var(--panel));border-color:color-mix(in srgb,var(--accent) 54%,var(--line));color:var(--text)}
body[class*="theme-"] pre{background:var(--theme-deep);color:color-mix(in srgb,var(--text) 72%,var(--muted));border-color:var(--line)}
body[class*="theme-"] .progress{background:color-mix(in srgb,var(--panel2) 80%,#000)}
body[class*="theme-"] .crawl-stats>div{background:var(--theme-deep);border-color:var(--line)}
body[class*="theme-"] .setup-card{background:color-mix(in srgb,var(--panel) 94%,transparent);border-color:var(--line)}
body[class*="theme-"] .setup-body{background:var(--bg)}

/* Browser office suite shared overrides. */
body[class*="theme-"] .suite-nav{background:var(--theme-top);border-color:var(--line)}
body[class*="theme-"] .suite-brand{color:var(--text)}
body[class*="theme-"] .suite-app,body[class*="theme-"] .suite-nav a,body[class*="theme-"] .suite-nav button.nav-btn{color:var(--muted)}
body[class*="theme-"] .suite-nav a:hover,body[class*="theme-"] .suite-nav button.nav-btn:hover,body[class*="theme-"] .suite-nav a.active{color:var(--text)}
body[class*="theme-"] .app-toolbar{background:var(--theme-panel);border-color:var(--line)}
body[class*="theme-"] .tool-btn,body[class*="theme-"] .tool-select,body[class*="theme-"] .tool-input{background:var(--theme-input);color:color-mix(in srgb,var(--text) 80%,var(--muted));border-color:var(--line)}
body[class*="theme-"] .privacy-chip{background:color-mix(in srgb,var(--theme-deep) 88%,transparent);color:var(--muted);border-color:var(--line)}
body[class*="theme-"] .sheet-wrap,body[class*="theme-"] .code-workspace{background:var(--bg)}
body[class*="theme-"] .sheet-grid thead th,body[class*="theme-"] .sheet-grid .row-head{background:var(--panel2);color:var(--muted);border-color:var(--line)}
body[class*="theme-"] .sheet-grid td{background:var(--theme-panel);color:var(--text);border-color:var(--line)}
body[class*="theme-"] .cell-input:focus{background:var(--panel2)}
body[class*="theme-"] .formula-bar input{background:var(--theme-input);color:var(--text);border-color:var(--line)}
body[class*="theme-"] .tabs-bar,body[class*="theme-"] .code-status{background:var(--theme-deep);border-color:var(--line)}
body[class*="theme-"] .code-tab.active{background:var(--panel2);color:var(--text);border-color:var(--line)}
body[class*="theme-"] .code-editor-shell{background:var(--bg)}
body[class*="theme-"] .line-numbers{background:var(--theme-deep);color:color-mix(in srgb,var(--muted) 65%,transparent)}
body[class*="theme-"] .code-editor{background:var(--theme-panel);color:color-mix(in srgb,var(--text) 88%,var(--muted))}

/* Google-specific suite/admin polish. */
body.theme-google .sidebar{background:#f8fafd}
body.theme-google .sidebar nav a,body.theme-google .sidebar-bottom a{color:#5f6368}
body.theme-google .sidebar nav a:hover,body.theme-google .sidebar nav a.active{background:#e8f0fe;color:#174ea6}
body.theme-google .metric,body.theme-google .panel{box-shadow:0 1px 2px rgba(60,64,67,.08)}
body.theme-google .suite-nav{box-shadow:0 1px 2px rgba(60,64,67,.12)}
body.theme-google .suite-brand{font-family:Arial,'Segoe UI',sans-serif;font-weight:500;letter-spacing:-.02em;text-indent:0}
body.theme-google .doc-page{box-shadow:0 1px 8px rgba(60,64,67,.22)}
body.theme-google .code-editor{color:#202124}
body.theme-google .line-numbers{color:#80868b}
body.theme-google .access-overlay{background:rgba(255,255,255,.82)}
body.theme-google .access-shell{background:#fff;border-color:#dadce0;box-shadow:0 24px 80px rgba(60,64,67,.24)}
body.theme-google .access-header,body.theme-google .auth-side,body.theme-google .terminal{border-color:#dadce0}
body.theme-google .terminal{background:#f8fafd;color:#5f6368}
body.theme-google .auth-side{background:#fff}
body.theme-google .access-header span,body.theme-google .auth-side h4,body.theme-google .auth-sub{color:#5f6368}
body.theme-google .auth-brand h3,body.theme-google .deny{color:#202124}
body.theme-google .deny-copy{color:#5f6368}
body.theme-google .retry-btn{background:#1a73e8;color:#fff;border-color:#1a73e8}

/* Theme picker in admin. */
.theme-picker{grid-column:1/-1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.theme-choice{display:block;cursor:pointer}
.theme-choice input{position:absolute;opacity:0;pointer-events:none}
.theme-card{display:block;border:1px solid var(--line);background:var(--theme-deep);padding:10px;border-radius:7px;transition:.15s}
.theme-choice input:checked+.theme-card{border-color:var(--accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 35%,transparent)}
.theme-preview{height:62px;border-radius:4px;margin-bottom:9px;display:block;position:relative;overflow:hidden;border:1px solid rgba(127,127,127,.2)}
.theme-preview::before{content:"";position:absolute;left:14%;right:14%;top:25%;height:7px;border-radius:10px;background:currentColor;opacity:.85}
.theme-preview::after{content:"";position:absolute;left:22%;right:22%;top:54%;height:13px;border:1px solid currentColor;border-radius:10px;opacity:.55}
.preview-spyroz{background:#05080d;color:#8ea6ff}.preview-fenix{background:linear-gradient(135deg,#08070d,#180a17);color:#ff4f7b}.preview-google{background:#fff;color:#1a73e8}.preview-studio{background:linear-gradient(#080506,#14090b);color:#ef3347}
.theme-card b{display:block;font-size:10px;letter-spacing:.08em;color:var(--text)}
.theme-card small{display:block!important;margin-top:4px;color:var(--muted)!important}
@media(max-width:820px){.theme-picker{grid-template-columns:1fr 1fr}}
