/* Neutral, achromatic surfaces shared by both appearances. */
:root,[data-theme="dark"]{--bg:#0b0b0b;--panel:#1a1a1a;--panel2:#242424;--surface-low:#141414;--surface-hover:#292929;--line:#333;--text:#f2f2f2;--muted:#929292;--subtle:#696969;--inverse:#111;--inverse-bg:#f1f1f1;--field:#171717;--accent:#f34d5b;--shadow:0 20px 65px #0008;color-scheme:dark}
[data-theme="light"]{--bg:#f5f5f5;--panel:#fff;--panel2:#f0f0f0;--surface-low:#fafafa;--surface-hover:#e8e8e8;--line:#d8d8d8;--text:#191919;--muted:#6b6b6b;--subtle:#888;--inverse:#fff;--inverse-bg:#202020;--field:#f7f7f7;--accent:#ca2336;--shadow:0 20px 60px #00000015;color-scheme:light}
body{background:var(--bg);color:var(--text)}.header{background:var(--bg);border-color:var(--line)}.main-nav button,.main-nav button:hover{color:var(--muted)}.main-nav button.active{color:var(--text)}.header-right{gap:13px}.header-language{font-size:10px;font-weight:700;color:var(--muted);width:30px;height:32px}.theme-toggle{border-radius:50%;border-color:var(--line);color:var(--muted)}.theme-toggle:hover{background:var(--surface-hover);color:var(--text)}.brand,.brand:hover{color:var(--text)}.studio-title h1 span{color:var(--muted)}.eyebrow,.studio-title p,.muted,.coming-note{color:var(--muted)}.editor{background:var(--surface-low);border:1px solid var(--line);box-shadow:0 12px 45px #0000000f;overflow:visible;isolation:isolate}.editor-top{background:transparent;border-color:var(--line);border-radius:22px 22px 0 0}.editor-top>div{color:var(--muted)!important}.saved-label,.script-tools,.editor-meta{color:var(--subtle)}.script-tools .separator{background:var(--line)}.script-area,.project-name{background:transparent;color:var(--text)}.script-area::placeholder{color:var(--muted)}.control-pill{background:var(--panel);color:var(--text);border-color:var(--line)}.control-pill:hover{background:var(--surface-hover);border-color:var(--subtle);color:var(--text)}.control-pill svg{color:var(--muted)}.editor-controls{position:relative;z-index:5}.settings-panel{background:var(--panel);border-color:var(--line);border-radius:0 0 22px 22px}.settings-title button,.field label,.field-label,.switch-row,.range-label{color:var(--muted)}.field .range-label b{color:var(--text)}input,textarea,select{background:var(--field);color:var(--text);border-color:var(--line)}.field input,.field select,.form-grid .field input,.form-grid .field select{background:var(--field)!important;border-color:var(--line)!important;color:var(--text)}.project-name,.script-area{background:transparent!important}.below-editor,.example-chip,.section-head button,footer,footer button,.footer-separator{color:var(--muted)}.example-chip,.project-card,.project-list-item,.voice-card,.panel,.stat-card,.pricing-card{background:var(--panel);border-color:var(--line)}.example-chip:hover,.project-card:hover{background:var(--surface-hover);border-color:var(--subtle);color:var(--text)}.project-card h3,.project-list-item h3,.voice-card h3{color:var(--text)}.project-card p,.project-list-item p,.voice-card p,.stat-card small,.stat-card .stat-label{color:var(--muted)}.project-art,.project-art.purple,.project-art.blue{background:var(--panel2);color:var(--muted)}.project-card .project-arrow{color:var(--subtle)}.tool-tabs button:not(.active){color:var(--muted)}.tool-tabs button:not(.active):hover{background:var(--panel2);color:var(--text)}.tag,.pill-status,.pill-status.wait{background:var(--panel2);border-color:var(--line);color:var(--muted)}.secondary{background:var(--panel2);border-color:var(--line);color:var(--text)}.secondary:hover{background:var(--surface-hover);border-color:var(--subtle);color:var(--text)}.icon-button{border-color:var(--line);color:var(--muted)}.icon-button:hover{background:var(--surface-hover);color:var(--text)}.search{background:var(--field);border-color:var(--line);color:var(--muted)}.search input{background:transparent!important}.search input:focus{outline:none}.progress{background:var(--surface-hover)}.progress span{background:#df3547}.mini-avatar{color:white}.upload-zone{background:var(--surface-low);border-color:var(--subtle)}.upload-zone p,.upload-zone small,.feature-row{color:var(--muted)}.upload-zone:hover{background:var(--panel2);border-color:var(--accent)}.upload-icon{background:var(--panel2);border-color:var(--line);color:var(--text)}.upload-zone.dragging{background:var(--panel2)}.account-menu{background:var(--panel);border-color:var(--line);box-shadow:var(--shadow);padding:13px;border-radius:19px}.menu-account-heading{display:flex;align-items:center;gap:12px;padding:8px 10px 17px}.menu-account-heading .avatar{display:grid;place-items:center;flex-shrink:0;font-size:20px}.menu-account-heading h3{font-size:13px;letter-spacing:0}.menu-account-heading p{color:var(--muted);font-size:10px;margin-top:2px}.menu-plan,.account-menu .menu-plan{background:var(--panel2);border-color:var(--line);padding:13px;border-radius:12px}.menu-plan>div:first-child{align-items:center}.menu-plan small{display:block;color:var(--muted);font-size:10px;margin-top:9px}.account-menu .menu-item{color:var(--text)!important;padding:11px;font-size:12px}.account-menu .menu-item:hover{background:var(--surface-hover)!important}.menu-item>svg{color:var(--muted)}.menu-item>svg:last-child{width:14px;transform:rotate(-90deg)}.menu-divider{background:var(--line)}.menu-preference{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:11px}.menu-preference>span{display:flex;align-items:center;gap:12px;font-size:12px}.menu-preference>span svg{color:var(--muted);width:18px}.current-locale{margin-left:auto;color:var(--muted);font-size:10px}.theme-control{display:flex;border-radius:24px;background:var(--panel2);padding:3px;border:1px solid var(--line);gap:2px}.theme-control button{display:flex;align-items:center;justify-content:center;gap:6px;font-size:11px;color:var(--muted);border-radius:20px;padding:7px 11px}.theme-control button.selected{background:var(--surface-hover);color:var(--text);box-shadow:0 1px 4px #0001}.theme-control svg{width:15px;height:15px}.menu-preference .theme-control button{padding:6px 9px}.menu-preference .theme-control button span{display:none}.locale-control{display:flex;flex-direction:column;gap:5px}.locale-control button{display:flex;align-items:center;justify-content:space-between;gap:25px;min-width:180px;font-size:12px;padding:11px 13px;border-radius:9px;border:1px solid transparent;text-align:left;color:var(--text)}.locale-control button.selected{background:var(--panel2);border-color:var(--line)}.locale-control button:hover{background:var(--surface-hover)}.locale-control button svg{width:15px;color:var(--accent)}.language-preference .locale-control{flex-direction:row;flex-wrap:wrap;justify-content:flex-end;gap:5px;max-width:460px}.language-preference .locale-control button{min-width:0;padding:8px 11px;font-size:10px;gap:7px;border-color:var(--line)}.language-preference .locale-control button.selected{border-color:var(--accent)}.account-page{padding:36px 32px 48px;max-width:1130px;margin:auto;animation:appear .3s ease}.account-workspace{border:1px solid var(--line);border-radius:16px;background:var(--bg);min-height:calc(100vh - 220px);display:flex;flex-direction:column}.account-topbar{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:0 31px;border-bottom:1px solid var(--line);min-height:69px}.account-tabs{display:flex;gap:25px;align-items:stretch;min-height:69px}.account-tabs button{font-size:13px;font-weight:650;color:var(--subtle);padding:0 0;position:relative;white-space:nowrap}.account-tabs button.active{color:var(--text)}.account-tabs button.active:after{content:'';position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--text)}.account-tabs button:hover{color:var(--text)}.account-close{display:grid;place-items:center;color:var(--muted);height:32px;width:32px;border-radius:8px;flex-shrink:0}.account-close svg{width:17px;height:17px}.account-close:hover{background:var(--panel2);color:var(--text)}.account-content{padding:28px 31px;display:flex;flex-direction:column;gap:20px}.account-card{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:25px 26px}.account-card h2{font-size:14px;letter-spacing:-.2px;font-weight:650}.account-card h3{font-size:12px;letter-spacing:0}.account-card p{color:var(--muted);font-size:11px;line-height:1.9}.account-card-title{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:21px}.account-card-title>span{font-size:10px;color:var(--subtle)}.account-card-title .tag{font-size:9px}.connect-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:25px}.connect-heading h2{margin:0 0 9px}.connect-heading .mono-button{flex-shrink:0}.mono-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;background:var(--inverse-bg);color:var(--inverse);border-radius:24px;font-size:11px;font-weight:650;padding:9px 15px;white-space:nowrap}.mono-button svg{width:13px;height:13px}.mono-button:hover{opacity:.88;color:var(--inverse);transform:translateY(-1px)}.integration-tags{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:15px 0 20px;color:var(--subtle);font-size:9px}.integration-tags>span:first-child{margin-right:4px}.integration-tags .tag{border-radius:20px;font-size:8px;padding:1px 6px;border:0;background:var(--panel2)}.endpoint-row{border-radius:8px;background:var(--panel2);padding:12px 13px;display:flex;align-items:center;gap:10px;font-size:9px;color:var(--subtle);overflow:hidden}.endpoint-row code{font-family:monospace;font-size:10px;color:var(--muted);overflow:hidden;text-overflow:ellipsis}.endpoint-status{margin-left:auto;border:1px solid var(--line);padding:1px 6px;border-radius:5px;font-size:8px;flex-shrink:0}.keys-empty{min-height:200px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:8px;padding:20px}.keys-empty-icon{width:37px;height:37px;border-radius:50%;display:grid;place-items:center;background:var(--panel2);color:var(--subtle);margin-bottom:1px}.keys-empty-icon svg{height:19px;width:19px}.keys-empty h3{font-size:12px;font-weight:650}.keys-empty p{font-size:10px;max-width:330px;line-height:1.8}.compact-button{margin-top:6px;border:1px solid var(--line);background:var(--bg);border-radius:6px;padding:6px 10px;display:flex;align-items:center;gap:5px;font-size:10px;color:var(--text)}.compact-button svg{width:12px;height:12px}.compact-button:hover{background:var(--surface-hover);color:var(--text)}.account-hint{font-size:10px;color:var(--subtle);padding:0 3px}.account-footnote{display:flex;align-items:center;gap:7px;color:var(--subtle);font-size:9px;padding:20px 31px 25px;margin-top:auto}.account-footnote .status-dot{background:var(--subtle)}.keys-table th,.usage-table th{font-size:8px;padding:12px 8px;color:var(--subtle);border-color:var(--line);white-space:nowrap}.keys-table td,.usage-table td{font-size:10px;padding:16px 8px;color:var(--muted);border-color:var(--line);white-space:nowrap}.keys-table td:first-child,.usage-table td:first-child{color:var(--text)}.keys-table code{display:block;color:var(--muted);font-size:10px;font-family:monospace;margin:4px 0}.keys-table small{display:block;font-size:8px;color:var(--subtle)}.key-name{font-size:11px;display:flex;align-items:center;gap:6px;max-width:220px;white-space:normal;word-break:break-word;text-align:left;color:var(--text)}.key-name svg{width:12px;height:12px;color:var(--muted);flex-shrink:0}.key-name:hover{color:var(--accent)}.account-section-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:2px}.account-section-heading h1{font-size:23px;margin-bottom:5px}.account-section-heading p{font-size:11px;color:var(--muted)}.account-section-heading select{font-size:10px;min-width:145px}.usage-totals{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.usage-totals .account-card{display:flex;flex-direction:column;gap:12px;padding:21px 23px}.usage-totals span{font-size:10px;color:var(--muted)}.usage-totals strong{font-size:31px;line-height:1;letter-spacing:-1px;font-weight:550;color:var(--text)}.usage-totals strong em{font-style:normal;font-size:13px;letter-spacing:0;color:var(--muted)}.usage-totals small{font-size:9px;color:var(--subtle)}.preference-row{display:flex;align-items:center;justify-content:space-between;gap:25px;padding:16px 0;border-bottom:1px solid var(--line)}.preference-row:first-of-type{padding-top:0}.preference-row:last-child{border-bottom:0;padding-bottom:0}.preference-row h3{margin-bottom:4px}.preference-row select{font-size:11px;min-width:150px;max-width:240px}.subtle-button{display:inline-flex;align-items:center;gap:5px;font-size:10px;color:var(--muted)}.subtle-button svg{width:13px;height:13px}.account-identity{display:flex;gap:13px;align-items:center;margin-bottom:25px}.account-identity .profile-avatar{height:49px;width:49px;border-radius:50%;background:#883a49;color:white;display:grid;place-items:center;font-size:23px}.account-identity h3{font-size:14px}.account-identity p{font-size:11px}.account-card .field label{font-size:10px}.account-card .field input,.account-card .field select{width:100%;font-size:12px}.billing-summary{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:30px;padding:9px 0 25px}.billing-summary h1{font-size:31px;margin:8px 0}.billing-summary strong{display:block;font-size:30px;letter-spacing:-.8px;font-weight:550}.key-detail-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin-bottom:25px}.key-detail-stats>div{background:var(--panel2);padding:15px;border-radius:11px}.key-detail-stats span{display:block;font-size:10px;color:var(--muted);margin-bottom:9px}.key-detail-stats strong{font-size:23px;font-weight:550}.key-detail-stats small{font-size:11px;color:var(--muted)}.context-picker-anchor{position:relative;display:flex;align-items:center;flex-shrink:0}.context-picker-anchor>.control-pill{height:100%}.context-picker-anchor.picker-open{z-index:20}.context-popover.inline-picker{position:absolute;left:0;top:calc(100% + 10px);width:350px;max-width:calc(100vw - 32px);max-height:min(350px,65vh);background:var(--panel);border-color:var(--line);box-shadow:var(--shadow);padding:15px;border-radius:15px;z-index:30;transform-origin:top;animation:appear .16s ease}.inline-picker .popover-title{font-size:14px;margin:3px 4px 12px}.model-option{color:var(--text)}.model-option.selected,.language-options button.selected{background:var(--surface-hover)}.model-option:hover,.language-options button:hover{background:var(--panel2);color:var(--text)}.model-icon{background:var(--panel2);color:var(--muted)}.model-option small{color:var(--muted)}.model-option em{border-color:var(--line);color:var(--muted)}.model-option>svg{color:var(--text)}.language-options button{color:var(--text)}.language-options button svg{color:var(--accent)}.inline-picker .search{width:100%;margin-bottom:10px}.library-modal,.context-popover,dialog{background:var(--surface-low);color:var(--text);border-color:var(--line);box-shadow:var(--shadow)}dialog::backdrop{background:#0008;backdrop-filter:blur(5px)}.modal-head{border-color:var(--line)}.modal-body>p{color:var(--muted)}.library-toolbar,.library-tabs,.library-filters,.library-note{border-color:var(--line)}.library-tabs>button{color:var(--muted)}.library-tabs>button.active{color:var(--text)}.library-count,.library-note,.library-id{color:var(--subtle)}.library-card{background:var(--panel);border-color:var(--line)}.library-card .voice-card-top p{color:var(--muted)}.library-card-actions .secondary{background:var(--panel2);border-color:var(--line);color:var(--text)}.library-card-actions .icon-button{background:var(--panel2)}.library-filters{background:var(--panel)}.filter-chip{color:var(--muted);border-color:var(--line)}.filter-chip.selected{background:#df354712;color:var(--accent);border-color:var(--accent)}.library-note{background:var(--surface-low)}.mobile-nav-panel{background:var(--panel);border-color:var(--line)}.mobile-nav-panel button{color:var(--text)}.mobile-nav-panel button.active{background:var(--panel2)}.page-notice{color:var(--muted);background:var(--panel2);border-color:var(--line)}.result-panel{background:var(--panel);border-color:var(--line)}.result-panel h3{color:var(--text)}.result-panel p{color:var(--muted)}.settings-list>.switch-row,.settings-toggles{border-color:var(--line)}#toast{background:var(--inverse-bg);color:var(--inverse);border-color:var(--line);box-shadow:var(--shadow)}footer{border-color:var(--line)}
[data-theme="light"] .hero-card{background:#23191c;color:#fff;border-color:#d8bfc3}[data-theme="light"] .hero-card h3{color:#fff}[data-theme="light"] .hero-card p{color:#c6b3b7}[data-theme="light"] .balance{background:#fff0f1;border-color:#f2c0c7;color:#b62739}[data-theme="light"] .nav-count{border-color:var(--line);color:var(--muted)}[data-theme="light"] .pricing-card.featured,[data-theme="light"] .wide-banner,[data-theme="light"] .referral-hero{background:linear-gradient(130deg,#fff,#ffe9ed);border-color:#e5b5bf;color:var(--text)}[data-theme="light"] .referral-hero p,[data-theme="light"] .wide-banner p,[data-theme="light"] .pricing-card p,[data-theme="light"] .pricing-card ul{color:var(--muted)}[data-theme="light"] .ref-link input{background:#fff;color:var(--text);border-color:var(--line)}[data-theme="light"] .profile-sidebar{background:var(--panel);border-color:var(--line)}[data-theme="light"] .profile-links button{color:var(--muted)}[data-theme="light"] .profile-links button.active{background:var(--panel2);color:var(--text)}[data-theme="light"] .empty,[data-theme="light"] .empty h3,[data-theme="light"] td,[data-theme="light"] th{color:var(--muted)}[data-theme="light"] table td,[data-theme="light"] table th{border-color:var(--line)}
@media(max-width:1120px){.header-right{gap:9px}.demo-tag{display:none}.main-nav{gap:20px}}
@media(max-width:800px){.account-page{padding:25px 22px 35px}.account-topbar{padding:0 22px}.account-content{padding:22px}.account-footnote{padding-inline:22px}.account-tabs{gap:22px}.account-tabs button{font-size:12px}.account-card{padding:22px}.connect-heading p br{display:none}.preference-row{gap:18px}.language-preference{align-items:flex-start;flex-direction:column}.language-preference .locale-control{justify-content:flex-start}.usage-totals .account-card{padding:19px}.usage-totals strong{font-size:27px}}
@media(max-width:600px){.header{padding:0 16px;gap:7px}.header-right{gap:10px}.header-language{display:none}.theme-toggle{width:29px;height:29px}.theme-toggle svg{width:15px;height:15px}.header .balance{display:none}.brand{font-size:23px}.account-page{padding:20px 12px 28px}.account-workspace{border-radius:11px;min-height:calc(100vh - 170px)}.account-topbar{padding:0 15px;min-height:57px;gap:8px}.account-tabs{min-height:57px;gap:16px;overflow-x:auto;scrollbar-width:none}.account-tabs button{font-size:11px;flex-shrink:0}.account-close{width:22px;height:28px}.account-close svg{width:14px}.account-content{padding:17px 15px;gap:16px}.account-card{padding:19px 17px;border-radius:12px}.account-card h2{font-size:12px}.connect-heading{gap:14px;flex-direction:column}.connect-heading p{font-size:10px}.connect-heading .mono-button{padding:8px 12px;font-size:10px}.integration-tags{margin:14px 0 16px}.endpoint-row{font-size:8px;padding:10px;gap:7px}.endpoint-row code{font-size:8px}.endpoint-row>span:first-child{display:none}.account-card-title{margin-bottom:15px;gap:8px}.keys-empty{min-height:205px;padding:20px 6px}.keys-empty h3{font-size:11px}.keys-empty p{font-size:9px}.keys-empty-icon{width:32px;height:32px}.keys-empty-icon svg{width:17px}.account-footnote{padding:18px 15px;font-size:8px}.account-hint{font-size:8px;line-height:1.7}.usage-totals{gap:8px}.usage-totals .account-card{padding:14px 11px;border-radius:10px;gap:10px}.usage-totals span{font-size:8px;min-height:23px;line-height:1.5}.usage-totals strong{font-size:24px}.usage-totals small{font-size:8px}.usage-totals strong em{font-size:9px}.account-section-heading{gap:12px;flex-wrap:wrap}.account-section-heading h1{font-size:21px}.account-section-heading p{font-size:10px}.account-section-heading select{padding:8px 10px;font-size:10px;min-width:0}.preference-row{flex-direction:column;align-items:flex-start;gap:13px}.preference-row p{font-size:10px}.preference-row select{width:100%;max-width:none;font-size:10px}.theme-control button{font-size:10px;padding:8px 13px}.menu-preference .theme-control button{padding:6px 10px}.menu-preference{flex-direction:row}.language-preference .locale-control{gap:5px}.language-preference .locale-control button{font-size:9px;padding:7px 9px}.billing-summary{gap:18px}.billing-summary h1,.billing-summary strong{font-size:26px}.billing-summary p{font-size:9px}.key-detail-stats{gap:7px}.key-detail-stats>div{padding:12px 9px}.key-detail-stats strong{font-size:20px}.key-detail-stats span{font-size:8px}.context-popover.inline-picker{width:320px;padding:12px;max-height:330px}.context-picker-anchor{flex:0 1 auto}.context-picker-anchor .language-control{min-width:116px}.popover-title{font-size:13px}.model-option{padding:12px 8px}.model-option b{font-size:12px}.model-option small{font-size:10px}.model-icon{width:32px;height:32px}.library-tabs>button{font-size:9px}.library-count{font-size:8px}.editor-top{border-radius:17px 17px 0 0}.settings-panel{border-radius:0 0 17px 17px}}
.editor:has(.picker-open){position:relative;z-index:25}.context-picker-anchor .model-option b em{margin-left:6px}

/* One centered, undistorted close control across all windows. */
.modal-head>button[data-action="close-modal"],button[data-close-popover],button.account-close{display:inline-flex;align-items:center;justify-content:center;flex:0 0 32px;width:32px;height:32px;min-width:32px;min-height:32px;padding:0;line-height:1;border-radius:8px;color:var(--muted);transform:none}
.modal-head>button[data-action="close-modal"]:hover,button[data-close-popover]:hover,button.account-close:hover{background:var(--surface-hover);color:var(--text);transform:none}
svg.icon.icon-close{display:block;flex:0 0 18px;width:18px;height:18px;min-width:18px;max-width:18px;min-height:18px;max-height:18px;margin:0;padding:0;transform:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;fill:none}
