/* Avxor web — mirrors the desktop app (WPF) colors, spacing, and shapes. */
:root{
  --bg:#191919; --titlebar:#202020; --sidebar:#202020; --line:#303030; --text:#EEEEEE; --text2:#F1F1EF;
  --muted:#A5A5A2; --dim:#A0A0A0; --hover:#252932; --press:#303540;
  --popup:#2B2B2B; --popup-line:#3E3E3E; --row-sel:#2D436E; --accent:#408BFF; --orange:#EE7E40;
  --serif:Georgia,"Times New Roman",serif;
  --sans:"Segoe UI",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif;
  --mono:Consolas,"Cascadia Mono","SF Mono",Menlo,monospace;
  color-scheme:dark;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--text);font:14px/1.45 var(--sans);-webkit-font-smoothing:antialiased;overflow:hidden}
[hidden]{display:none!important}
button{font:inherit;color:inherit;background:transparent;border:1px solid var(--line);border-radius:22px;cursor:pointer;padding:8px 12px}
button:hover{background:var(--hover)}
button:active{background:var(--press)}
button:disabled{opacity:.45;cursor:default}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible{outline:2px solid #6b8fd6;outline-offset:2px}
input,textarea,select{font:inherit;color:var(--text2)}
a{color:inherit}
svg{flex:none}
::selection{background:#6941C6;color:#fff}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:#555;border-radius:5px;border:2px solid transparent;background-clip:padding-box}
::-webkit-scrollbar-track{background:transparent}
*{scrollbar-color:#555 transparent;scrollbar-width:thin}
.noscript{padding:40px;text-align:center}
.boot{position:fixed;inset:0;display:grid;place-items:center;background:var(--bg);z-index:100}
.boot svg{opacity:.85;animation:pulse 1.4s ease-in-out infinite}
@keyframes pulse{50%{opacity:.35}}

/* ---------- Auth (desktop sign-in window) ---------- */
.auth{display:grid;grid-template-columns:1fr 1fr;height:100%;background:#151515;color:#F4F4F2}
.auth-art{position:relative;background:#0D0E14;overflow:hidden;display:grid;place-items:center}
.auth-shapes{position:absolute;inset:0;width:100%;height:100%}
.auth-brand{position:relative;display:flex;align-items:center;gap:22px}
.auth-brand span{font:76px var(--serif);margin-bottom:4px}
.auth-side{background:#171717;overflow:auto;display:flex;align-items:safe center;justify-content:center;padding:48px 56px}
.auth-card{width:100%;max-width:520px}
.auth-mobile-brand{display:none}
.auth-panel{display:flex;flex-direction:column}
.auth-panel h1{font-size:38px;font-weight:600;text-align:center;margin:0}
.auth-sub{color:#A5A5A2;font-size:17px;text-align:center;margin:12px 0 34px}
.auth-panel label{font-size:15px;font-weight:600;margin:20px 0 8px}
.auth-panel label:first-of-type{margin-top:0}
.auth-panel input:not([type=checkbox]){height:54px;padding:0 16px;font-size:15px;background:#242424;border:1px solid #343434;border-radius:8px;color:#fff;outline:none}
.auth-panel input:not([type=checkbox]):focus{border-color:#5a5a5a}
.auth-panel input.code{font-size:24px;text-align:center;letter-spacing:6px}
.auth-panel small{color:#777;font-size:12px;margin:6px 0 0 2px}
.auth-panel .check{display:flex;gap:10px;align-items:flex-start;font-weight:400;font-size:14px;color:#cfcfcb;margin:16px 0 0;cursor:pointer;line-height:1.4}
.auth-panel .check + .check{margin-top:10px}
.auth-panel .check a{color:#fff;font-weight:600}
.primary{height:56px;margin:28px 0 14px;background:#F2F2EF;color:#121212;border:0;font-size:16px;font-weight:600}
.primary:hover{background:#ffffff}
.primary:active{background:#dcdcd8}
.link{border:0;padding:3px;font-weight:600;color:#fff;align-self:center}
.link:hover{background:transparent;text-decoration:underline}
.auth-switch{color:#A5A5A2;text-align:center;margin-top:4px}
.auth-switch .link{display:inline}
.auth-status{min-height:20px;text-align:center;color:#FF7A7A;margin:18px 0 0;white-space:pre-wrap}
.auth-status.ok{color:#8fe3a2}
.auth-footer{color:#888;text-align:center;margin-top:46px}
.auth-footer a{color:#999;font-weight:600;text-decoration:none}
.auth-footer a:hover{text-decoration:underline}

/* checkbox (desktop CheckBox template) */
input[type=checkbox]{appearance:none;width:15px;height:15px;margin:2px 0 0;flex:none;border:1px solid #5A5A5A;border-radius:3px;background:#242424;display:inline-grid;place-items:center;cursor:pointer}
input[type=checkbox]:hover{border-color:#8B8B88}
input[type=checkbox]:checked{background:#F1F1EF;border-color:#F1F1EF}
input[type=checkbox]:checked::after{content:"";width:8px;height:4px;border:2px solid #171717;border-top:0;border-right:0;transform:rotate(-45deg) translate(1px,-1px)}

/* ---------- App shell ---------- */
.app{display:grid;grid-template-rows:36px 1fr;height:100%;height:100dvh;background:var(--bg)}
.titlebar{background:var(--titlebar);display:flex;align-items:center;gap:0;padding:0 12px;user-select:none}
.tb-name{color:#AFAFAC;font-size:12px;width:43px}
.meter{display:flex;align-items:center;width:195px;color:#A0A0A0;font-size:12px;cursor:default}
.meter i{flex:1;height:7px;background:#303030;border-radius:2px;margin:0 5px;overflow:hidden}
.meter b{display:block;height:100%;width:0;background:#D6D6D2;border-radius:2px;transition:width .3s}
.workspace{display:grid;grid-template-columns:300px 1fr;min-height:0;position:relative}
.app.collapsed .workspace{grid-template-columns:0 1fr}
.app.collapsed .sidebar{visibility:hidden}

/* sidebar */
.sidebar{background:var(--sidebar);border-right:1px solid var(--line);display:grid;grid-template-rows:60px auto 1fr 58px;min-height:0;overflow:hidden;width:300px}
.side-head{display:flex;align-items:center;justify-content:space-between;padding:0 16px}
.brand{display:flex;align-items:center;gap:10px}
.brand span{font:23px var(--serif)}
.icon-btn{width:32px;height:32px;padding:0;border:0;display:grid;place-items:center;color:#D0D0CD}
.icon-btn.small{width:28px;height:28px;font-size:18px;color:#CECECB;line-height:1}
.side-nav{padding:4px 8px;display:flex;flex-direction:column}
.nav-btn{border:0;display:flex;align-items:center;gap:9px;padding:10px 14px;text-align:left;font-size:14px}
.nav-btn svg{color:#D9D9D6}
.projects{display:grid;grid-template-rows:34px 1fr;min-height:0;padding:6px 12px;margin-top:22px;position:relative}
.proj-head{display:flex;align-items:center;justify-content:space-between;padding:0 6px;color:#A5A5A2;font-size:12px}
.proj-actions{display:flex}
.select{height:40px;margin:4px 2px 6px;padding:0 34px 0 12px;background:#242424;border:1px solid #3A3A3A;border-radius:7px;text-align:left;position:relative;display:flex;align-items:center;color:var(--text2)}
.select:hover{background:#2a2a2a}
.select span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.select::after{content:"";position:absolute;right:14px;top:50%;width:6px;height:6px;border:solid #B8B8B4;border-width:0 1.5px 1.5px 0;transform:translateY(-70%) rotate(45deg)}
.task-list{list-style:none;margin:0;padding:0;overflow-y:auto;min-height:0}
.task{display:grid;grid-template-columns:22px 1fr auto;align-items:center;padding:11px 10px;margin:2px 0;border:1px solid transparent;border-radius:9px;cursor:pointer;outline:none}
.task:hover{background:#292929}
.task.selected{background:#303030;border-color:#3B3B3B}
.task:focus-visible{border-color:#737373}
.task svg.bubble-icon{color:#939393}
.task .title{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.task .pin{border:0;padding:0 5px;margin-left:4px;height:22px;opacity:0;color:#BDBDBD;display:grid;place-items:center}
.task:hover .pin,.task .pin:focus-visible,.task.pinned .pin{opacity:1}
.task.pinned .pin{color:#fff}
.task.pinned .pin path{fill:#fff}
.empty-tasks{position:absolute;inset:40px 12px 0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#959595;text-align:center;pointer-events:none}
.empty-icon{font-size:38px;color:#858585;margin-bottom:10px;line-height:1}
.profile-wrap{padding:4px 8px 8px}
.profile-btn{width:100%;display:grid;grid-template-columns:30px 1fr 22px;align-items:center;padding:6px 8px;background:#2D2D2D;border:0;text-align:left}
.profile-btn:hover{background:#333}
.avatar{width:24px;height:24px;border-radius:50%;background:#D86BA5;display:grid;place-items:center;font-size:10px;font-weight:600;overflow:hidden;color:#fff}
.avatar img{width:100%;height:100%;object-fit:cover}
.profile-name{font-size:13px;margin:0 7px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dots{color:#A7A7A7;font-size:16px;text-align:center}
.scrim{position:fixed;inset:36px 0 0;background:rgba(0,0,0,.5);z-index:20}

/* main */
.main{display:grid;grid-template-rows:60px 1fr;min-width:0;min-height:0;position:relative}
.main-top{position:relative;display:flex;align-items:center;padding:0 12px}
.open-side{margin-right:8px}
.temp-label{background:#252525;border:1px solid #3A3A3A;border-radius:12px;padding:5px 10px;color:#B7B7B2;font-size:12px}
.top-right{position:absolute;right:20px;top:14px;display:flex;align-items:center;gap:8px;z-index:2}
.pill{height:30px;display:flex;align-items:center;gap:8px;padding:0 12px;background:#262626;border:1px solid #555;border-radius:15px;color:#F3F3F0;font-size:13px;white-space:nowrap}
.pill.credits{padding:0 10px;gap:6px}
.pill.credits b{font-weight:600}
.pill.plan{cursor:pointer;gap:7px;font:inherit;font-size:13px}
.pill.plan:hover{border-color:#777}
.pill.plan i{width:34px;height:5px;border-radius:3px;background:#3a3a3a;overflow:hidden;display:block}
.pill.plan i b{display:block;height:100%;background:#F2F2EF;border-radius:3px}
.pill.plan.full i b{background:var(--orange)}
.dialog.plans{width:620px}
.dialog.plans h2{font-size:22px;margin:0}
.plan-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:4px 0 6px}
.plan-card{display:flex;flex-direction:column;gap:4px;background:#262626;border:1px solid #363636;border-radius:14px;padding:16px 14px}
.plan-card.current{border-color:#8a8a86}
.plan-card b{font-size:16px;font-weight:600}
.plan-card .price{font-size:24px;font-weight:600;margin:6px 0 0}
.plan-card .price small{font-size:13px;font-weight:400;color:#AFAFAC}
.plan-card .usage{color:#cfcfcb;font-size:13px;margin:0 0 12px}
.plan-card button{margin-top:auto;border-radius:18px;height:36px}
.plan-now{background:#262626;border:1px solid #363636;border-radius:14px;padding:16px;margin:4px 0 12px}
.plan-now .head{display:flex;justify-content:space-between;align-items:baseline;gap:10px;flex-wrap:wrap}
.plan-now .head b{font-size:17px;font-weight:600}
.plan-now .state{color:#AFAFAC;font-size:13px}
.plan-now .state.warn{color:#ffb38a}
.meter-row{margin-top:14px}
.meter-row .top{display:flex;justify-content:space-between;font-size:13px;color:#d8d8d4;margin-bottom:6px;gap:10px}
.meter-row .top span:last-child{color:#9a9a96}
.meter-row .bar{height:8px;border-radius:4px;background:#1a1a1a;border:1px solid #333;overflow:hidden}
.meter-row .bar b{display:block;height:100%;background:#F2F2EF;border-radius:4px}
.meter-row.full .bar b{background:var(--orange)}
.plans .check{display:flex;gap:10px;align-items:flex-start;margin:4px 0 0;cursor:pointer;line-height:1.4}
.plans .check small{display:block;color:#9a9a96;font-size:12px;margin-top:2px}
.plans .foot{color:#9a9a96;font-size:12px;margin:12px 2px 0;line-height:1.5}
.plans .foot a{color:#cfcfcb}
.plans .foot .link{display:inline;padding:0;font-size:inherit;color:#fff}
.pill-btn{display:grid;place-items:center;width:30px;height:30px;padding:0;background:#262626;border-color:#555;font-size:18px;line-height:1;color:#F3F3F0}
.stage{display:grid;grid-template-rows:1fr auto;min-height:0;width:100%;max-width:920px;margin:0 auto;padding:0 35px 36px}
.chat-area{position:relative;min-height:0;display:grid}
.greeting{grid-area:1/1;align-self:center;justify-self:center;margin:0;font:42px var(--serif);font-weight:400;text-align:center;padding:0 10px}
.chat-scroll{grid-area:1/1;overflow-y:auto;min-height:0;margin:8px 0 20px;overscroll-behavior:contain}
.messages{display:flex;flex-direction:column;padding-right:4px}

/* Downloads page (signed-in only, from the profile menu) */
.dialog.downloads{width:560px}
.downloads .sub{margin:4px 0 18px}
.platforms{display:grid;gap:8px}
.platform{display:grid;grid-template-columns:40px 1fr auto;align-items:center;gap:12px;background:#262626;border:1px solid #333;border-radius:14px;padding:12px 14px}
.platform .logo{width:40px;height:40px;border-radius:10px;background:#1a1a1a;border:1px solid #3a3a3a;display:grid;place-items:center;color:#F2F2F0}
.platform b{display:block;font-weight:600}
.platform small{display:block;color:#A5A5A2;font-size:12px;margin-top:2px}
.platform.soon{opacity:.6}
.dl-btn{display:inline-flex;align-items:center;gap:7px;height:34px;padding:0 16px;border-radius:17px;background:#F2F2EF;color:#121212;font-weight:600;font-size:13px;text-decoration:none;white-space:nowrap}
.dl-btn:hover{background:#fff}
.dl-pair{display:flex;flex-direction:column;gap:6px}
.dl-pair .dl-btn{justify-content:center}
.soon-pill{height:28px;display:inline-flex;align-items:center;padding:0 12px;border-radius:14px;border:1px solid #444;color:#BDBDB9;font-size:12px;white-space:nowrap}
.ide-setup{background:#202020;border:1px solid #363636;border-radius:12px;padding:14px 16px;margin:4px 0 8px}
.ide-field{margin:12px 0 0}.ide-field small{color:#9A9A96;display:block;margin-bottom:5px}
.ide-row{display:flex;gap:8px;align-items:flex-start}
.ide-row code{flex:1;background:#141414;border:1px solid #333;border-radius:8px;padding:9px 11px;font-size:12.5px;color:#EDEDEA;white-space:pre-wrap;overflow-wrap:anywhere;max-height:120px;overflow:auto}
.ide-head{display:flex;justify-content:space-between;align-items:center;margin:20px 0 8px}
.ide-key{display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-top:1px solid #2c2c2c;gap:10px}
.ide-key code{color:#9A9A96;font-size:12px}
.ide-revoke{background:none;border:0;color:#E07A6A;cursor:pointer;font-size:13px}
.ide-row code.snippet{max-height:none}
.ide-setup h4{margin-top:2px}
.ide-warn{background:#3A2C12;border:1px solid #6B4E1B;color:#F2C879;border-radius:10px;padding:10px 12px;margin:10px 0;line-height:1.5}
.ide-setup .ide-row code.snippet{max-height:220px}
.ide-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0 6px}
.ide-tabs button{border-radius:16px;padding:6px 14px}
.ide-tabs button.on{background:#F2F2EF;color:#121212;border-color:#F2F2EF}
.ide-steps{margin:10px 0 4px 20px;padding:0;color:#CFCFCB;line-height:1.7}
.downloads .foot{color:#9a9a96;font-size:12px;margin:14px 2px 0;line-height:1.5}

/* messages */
.bubble{position:relative;max-width:700px;padding:11px;border:1px solid #353535;border-radius:9px;margin:8px 50px 12px 0;align-self:flex-start;background:#202020;min-width:60px}
.bubble.user{align-self:flex-end;background:#2D2D2D;margin:8px 0 12px 50px}
.bubble-body{padding:20px 3px 3px;font-size:14px;line-height:20px;color:#fff;overflow-wrap:anywhere;user-select:text}
.bubble.user .bubble-body{white-space:pre-wrap}
.copy-btn{position:absolute;top:8px;right:8px;width:24px;height:20px;padding:0;border:0;color:#AAAAAA;font-size:13px;line-height:20px;border-radius:5px}
.copy-btn:hover{background:#2c2c2c;color:#ddd}
.turn-btn{right:34px;display:flex;align-items:center;justify-content:center}
.retry-btn{display:inline-flex;align-items:center;gap:7px;margin:10px 0 2px 3px;padding:7px 16px 7px 14px;border:0;border-radius:15px;background:#F2F2EF;color:#1A1A1A;font-size:13px;font-weight:600;cursor:pointer}
.retry-btn:hover{background:#fff}
.typing-dots{display:flex;gap:5px;padding:8px 0 2px 4px}
.typing-dots[hidden]{display:none}
.typing-dots i{width:7px;height:7px;border-radius:50%;background:#A0A09C;animation:typing-bounce 1.2s ease-in-out infinite}
.typing-dots i:nth-child(2){animation-delay:.15s}.typing-dots i:nth-child(3){animation-delay:.3s}
@keyframes typing-bounce{0%,50%,100%{transform:translateY(0)}25%{transform:translateY(-5px)}}
@media (prefers-reduced-motion:reduce){.typing-dots i{animation:none}}
.bubble{min-width:84px}
.activity{margin:-6px 12px 12px 30px;font-size:13px;color:#969692}
.activity-line{display:flex;gap:9px;align-items:center;padding:3px 0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.activity-line .ok{color:#6CC28A;width:14px;text-align:center;font-weight:600}.activity-line .bad{color:#E07A6A;width:14px;text-align:center;font-weight:600}
.compact-note{align-self:center;color:#8c8c8c;font-size:11px;text-align:center;margin:6px 40px 10px}
.image-row{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;max-width:600px;margin:8px 0 0 50px;align-self:flex-end}
.image-row button{width:112px;height:92px;padding:2px;border:1px solid #414141;border-radius:9px;background:#171717;overflow:hidden}
.image-row img{width:100%;height:100%;object-fit:contain;display:block}

/* markdown */
.md p{margin:0 0 2px;min-height:1px}
.md p.gap{margin-bottom:8px}
.md h1{font-size:21px;font-weight:700;margin:4px 0 6px;line-height:1.3}
.md h2{font-size:18px;font-weight:600;margin:4px 0 6px;line-height:1.3}
.md h3,.md h4{font-size:16px;font-weight:600;margin:4px 0 4px;line-height:1.3}
.md li{display:block;margin:0 0 2px}
.md code{font-family:var(--mono);background:#303030;color:#E1E1E1;border-radius:4px;padding:1px 4px;font-size:13px}
.md pre{position:relative;background:#161616;border:1px solid #333;border-radius:8px;padding:30px 12px 12px;margin:6px 0 10px;overflow:auto;max-height:520px}
.md pre code{background:none;padding:0;white-space:pre;font-size:13px;line-height:19px;display:block}
.md pre .code-lang{position:absolute;top:6px;left:12px;color:#8a8a8a;font:11px var(--sans)}
.md pre .code-copy{position:absolute;top:4px;right:6px;border:0;padding:2px 8px;font-size:11px;color:#aaa;border-radius:6px}
.md blockquote{margin:4px 0 8px;padding:2px 0 2px 12px;border-left:3px solid #444;color:#cfcfcf}
.md hr{border:0;border-top:1px solid #3a3a3a;margin:10px 0}
.md a{color:#8ab4ff;text-decoration:underline;text-underline-offset:2px}
.md table{border-collapse:collapse;margin:6px 0 10px;font-size:13px;display:block;overflow-x:auto;max-width:100%}
.md th,.md td{border:1px solid #3a3a3a;padding:5px 9px;text-align:left;vertical-align:top}
.md th{background:#262626;font-weight:600}

/* thinking (desktop Expander) */
.thinking{margin:8px 12px 18px;color:#808080}
.thinking summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:8px;font-size:14px;user-select:none;width:max-content;max-width:100%}
.thinking summary::-webkit-details-marker{display:none}
.thinking .chev{width:19px;height:19px;border:1px solid #6a6a6a;border-radius:50%;display:grid;place-items:center;flex:none}
.thinking .chev::before{content:"";width:5px;height:5px;border:solid #9a9a9a;border-width:0 1.4px 1.4px 0;transform:translateY(-1px) rotate(45deg)}
.thinking[open] .chev::before{transform:translateY(1px) rotate(-135deg)}
.thinking summary:hover .chev{border-color:#9a9a9a}
.thinking-text{margin:8px 0 8px 24px;font-size:13px;white-space:pre-wrap;color:#8c8c8c;overflow-wrap:anywhere;max-height:420px;overflow-y:auto}

/* slash commands */
.command-menu{position:absolute;left:0;bottom:10px;width:460px;max-width:100%;max-height:280px;overflow:auto;margin:0;padding:10px;list-style:none;background:#252525;border:1px solid #444;color:#EEE;z-index:10;border-radius:8px}
.command-menu li{padding:5px 8px;border-radius:5px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.command-menu li.active,.command-menu li:hover{background:#3a3a3a}

/* composer */
.composer{background:#242424;border:1px solid #333;border-radius:22px;padding:14px 12px 10px 16px;display:flex;flex-direction:column;min-height:120px}
.composer.dragging{border-color:#5a7fd0}
.composer textarea{flex:1;min-height:42px;max-height:240px;resize:none;border:0;outline:none;background:transparent;color:#fff;font-size:14px;line-height:20px;padding:0;margin:0}
.composer textarea::placeholder{color:#626262}
.composer-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;height:34px;margin-top:6px}
.bar-left,.bar-right{display:flex;align-items:center;gap:6px;min-width:0}
.bar-right{flex:none}
.round-btn{width:34px;height:32px;padding:0;display:grid;place-items:center;color:#D8D8D5}
.chip-btn{height:32px;padding:0 10px;font-size:12px;display:flex;align-items:center;gap:7px;white-space:nowrap}
.chip-btn.approval{color:#D3D3D3}
.chip-btn.approval.full{color:var(--orange)}
.folder-chip{max-width:170px;color:#cfd8ff;border-color:#3a4766}
.folder-chip span{overflow:hidden;text-overflow:ellipsis}
.picker{height:32px;padding:0 10px;font-size:12px;background:#373737;border:0;display:flex;align-items:center;gap:6px;white-space:nowrap}
.picker:hover{background:#414141}
.picker .chev{width:10px;height:8px;color:var(--dim)}
.send{width:32px;height:32px;padding:0;background:#343434;display:grid;place-items:center;color:#fff;margin-left:2px}
.send:hover{background:#3d3d3d}
/* While a reply runs: a white round button with a small dark rounded square. */
.send.stop{background:#F2F2EF;border-color:#F2F2EF}
.send.stop:hover{background:#fff}
.send .stop-mark{width:10px;height:10px;border-radius:2.5px;background:#1A1A1A}
.image-previews{display:flex;gap:10px;overflow-x:auto;margin:0 0 10px;padding-top:4px}
.image-tile{position:relative;width:168px;height:126px;flex:none}
.image-tile .frame{position:absolute;inset:4px 6px 0 0;border:1px solid #464646;border-radius:10px;background:#171717;overflow:hidden}
.image-tile img{width:100%;height:100%;object-fit:contain;display:block;padding:2px}
.image-tile .remove{position:absolute;top:0;right:0;width:22px;height:22px;padding:0;border:0;border-radius:50%;background:#fff;color:#000;display:grid;place-items:center;opacity:0}
.image-tile:hover .remove,.image-tile .remove:focus-visible{opacity:1}

/* ---------- Popups, menus, dialogs ---------- */
.layer{position:fixed;inset:0;pointer-events:none;z-index:50}
.layer>*{pointer-events:auto}
.popup{position:fixed;background:var(--popup);border:1px solid var(--popup-line);border-radius:14px;padding:8px;color:#fff;box-shadow:0 10px 30px rgba(0,0,0,.35);max-height:calc(100vh - 20px);overflow:auto}
.popup.side{background:#282828;border-color:var(--accent);border-radius:12px;padding:14px;font-size:12px;white-space:pre-wrap;max-width:330px;line-height:1.5}
.popup.menu{background:#282828;border-color:#414141;border-radius:12px;padding:5px;min-width:180px;font-size:13px}
.popup.profile{background:#292929;border-color:#424242;border-radius:12px;padding:7px;width:268px}
.popup.approval{background:#282828;border-radius:16px;width:365px;max-width:calc(100vw - 20px)}
.menu-item{display:flex;width:100%;border:0;border-radius:7px;padding:9px 12px;text-align:left;font-size:13px;color:#EEE;gap:8px;align-items:center}
.menu-item:hover{background:#3A3A3A}
.menu-sep{height:1px;background:#3E3E3E;margin:0 3px 5px}
.profile-head{display:grid;grid-template-columns:32px 1fr;align-items:center;margin:7px 8px 10px}
.profile-head .avatar{width:26px;height:26px}
.profile-head b{margin:0 8px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.popup.profile .menu-item{font-size:14px;padding:10px 14px;border-radius:22px}
.popup.profile .menu-item:hover{background:var(--hover)}

/* model picker rows */
.model-list{width:250px}
.more-list{width:200px}
.row{display:grid;grid-template-columns:1fr auto auto;align-items:center;width:100%;border:0;border-radius:9px;padding:8px 11px;margin:1px 0;text-align:left;position:relative;background:transparent;color:#fff}
.row:hover{background:rgba(255,255,255,.125)}
.row.on{background:var(--row-sel)}
.row.on:hover{background:#3a5181}
.row .tail{font-size:12px;color:var(--dim);min-width:10px;text-align:right}
.row.on .tail{color:var(--accent)}
.row.more{grid-template-columns:1fr auto;margin-top:4px;padding:7px 11px}
.row.more .tail{font-size:15px}
.qchip{width:22px;height:22px;padding:0;margin:0 8px;border:1px solid var(--popup-line);border-radius:6px;background:#323232;color:silver;font-weight:700;font-size:12px;display:grid;place-items:center}
.qchip:hover{background:#5A5A5A}

/* thinking (effort) popup */
.effort{width:260px}
.effort-head{display:grid;grid-template-columns:auto 1fr auto;align-items:center;margin:2px 2px 8px 4px}
.effort-head .lbl{color:var(--dim);font-size:12px}
.effort-head b{font-size:13px;font-weight:600;margin-left:8px}
.effort-head .qchip{margin:0}
.slider{position:relative;height:28px;margin:2px 2px 0;touch-action:none;cursor:pointer;border-radius:14px}
.slider .track{position:absolute;left:0;right:0;top:2px;height:24px;background:#494949;border-radius:14px}
.slider .fill{position:absolute;left:0;top:2px;height:24px;background:#3D83F6;border-radius:12px 0 0 12px}
.slider .thumb{position:absolute;top:0;width:28px;height:28px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.4)}
.notches{position:relative;height:7px;margin:3px 2px 0}
.notches i{position:absolute;top:1px;width:2px;height:5px;border-radius:1px;background:#787878}
.notches i.on{top:0;height:7px;background:#fff}
.ends{display:flex;justify-content:space-between;margin:3px 2px 0;color:var(--dim);font-size:10px}
.recommended{position:relative;height:16px;margin:4px 14px 0;overflow:hidden}
.recommended span{position:absolute;color:var(--accent);font-size:10px;white-space:nowrap}

/* approval popup */
.approval-title{color:#A9A9A9;margin:6px 10px 12px}
.approval-row{display:grid;grid-template-columns:24px 1fr 22px;align-items:center;width:100%;border:0;border-radius:22px;padding:9px 10px;text-align:left;color:#fff}
.approval-row b{font-weight:600;display:block}
.approval-row small{display:block;font-size:12px;color:#A9A9A9;margin-top:3px;line-height:1.35}
.approval-row.full,.approval-row.full small{color:var(--orange)}
.approval-note{color:#808080;font-size:11px;margin:12px 10px 6px;line-height:1.4}

/* folder dropdown */
.popup.folders{border-radius:7px;padding:4px;background:#242424;border-color:#454545}
.folder-item{display:block;width:100%;border:0;border-radius:4px;padding:8px 10px;text-align:left;color:#F1F1EF;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.folder-item:hover,.folder-item.on{background:#343434}

/* modal dialogs */
.backdrop{position:fixed;inset:0;background:rgba(0,0,0,.45);display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);place-items:center;padding:16px;z-index:60;animation:fade .12s ease-out}
@keyframes fade{from{opacity:0}}
.dialog{width:420px;max-width:100%;max-height:calc(100vh - 32px);overflow:auto;background:#202020;border:1px solid #3A3A3A;border-radius:18px;padding:24px;color:#fff}
.dialog h2{font-size:18px;font-weight:600;margin:0 0 16px}
.dialog .message{white-space:pre-wrap;margin:0 0 16px;max-height:280px;overflow:auto;overflow-wrap:anywhere;color:#e6e6e6}
.dialog .message.mono{font:12px/1.5 var(--mono);background:#181818;border:1px solid #333;border-radius:8px;padding:10px}
.dialog input[type=text],.dialog input[type=password],.dialog input[type=email],.dialog input:not([type]),.field{width:100%;height:40px;padding:0 11px;background:#242424;border:1px solid #3A3A3A;border-radius:7px;color:#fff;outline:none}
.field:focus,.dialog input:focus{border-color:#5a5a5a}
.dialog .buttons{display:flex;justify-content:flex-end;gap:8px;margin-top:20px;flex-wrap:wrap}
.dialog .buttons button{min-width:75px}
.btn-primary{background:#F2F2EF;color:#121212;border-color:#F2F2EF;font-weight:600}
.btn-primary:hover{background:#fff}
.btn-danger{border-color:#7a3434;color:#ff9d9d}
.btn-danger:hover{background:#3a1f1f}
.dialog.buy{width:460px;background:#1F1F1F;border-color:#464646}
.dialog.buy h2{font-size:22px;margin:0}
.dialog .sub{color:#AFAFAC;margin:7px 0 14px}
.option{display:flex;flex-direction:column;align-items:flex-start;width:100%;padding:13px 14px;margin:0 0 8px;text-align:left;border-radius:22px}
.option b{font-size:15px;font-weight:600}
.option small{color:#AAAAA7;font-size:12px;margin-top:3px}
.dialog select{width:100%;height:40px;background:#242424;border:1px solid #3A3A3A;border-radius:7px;padding:0 10px;margin:0 0 16px;color:#F1F1EF}
.custom-row{display:flex;align-items:center;gap:8px;margin:4px 0 8px}
.custom-row .dollar{color:#bdbdb9;font-size:15px;padding-left:4px}
.custom-row .field{flex:1}
.custom-row button{height:40px;border-radius:20px}
.row.guide{border-top:1px solid #3a3a3a;border-radius:0 0 9px 9px;margin-top:6px;padding-top:9px;color:#cfcfcb}
.popup.side{max-width:360px}
.copyfield{display:flex;gap:6px;margin:5px 0 12px}
.copyfield input{flex:1;font-family:var(--mono);font-size:12px}
.copyfield button{flex:none;height:40px;border-radius:7px}
.invoice .state{font-size:15px;font-weight:600;margin:4px 0 3px}
.invoice .countdown{color:#C0C0C0;margin:0 0 12px}
.terms-dialog{width:520px}
.terms-dialog .check{display:flex;gap:10px;align-items:flex-start;margin:12px 0 0;cursor:pointer;color:#ddd}
.terms-dialog a{color:#fff;font-weight:600}
.viewer{position:fixed;inset:0;background:rgba(20,20,20,.97);display:grid;place-items:center;z-index:70;padding:56px 28px 28px}
.viewer img{max-width:100%;max-height:100%;object-fit:contain}
.viewer button{position:absolute;top:12px;right:12px;width:40px;height:40px;padding:0;border:0;background:#2d2d2d;font-size:26px;line-height:1;border-radius:20px}
.toast{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);background:#2a2a2a;border:1px solid #444;border-radius:10px;padding:9px 14px;color:#ddd;font-size:13px;z-index:80;max-width:calc(100vw - 32px);box-shadow:0 8px 24px rgba(0,0,0,.4);animation:fade .15s}

/* settings (desktop Settings window) */
.settings{width:920px;height:650px;max-width:100%;max-height:calc(100vh - 32px);background:#171717;border:1px solid #3A3A3A;border-radius:14px;display:grid;grid-template-rows:70px 1fr 58px;overflow:hidden;color:#F1F1EF}
.settings-head{display:flex;align-items:center;justify-content:space-between;padding:0 26px}
.settings-head h2{font:28px var(--serif);margin:0;font-weight:400}
.settings-body{display:grid;grid-template-columns:190px 1fr;border-top:1px solid #303030;border-bottom:1px solid #303030;min-height:0}
.settings-tabs{background:#202020;padding:16px 10px;overflow:auto}
.settings-tabs button{display:block;width:100%;text-align:left;border:0;border-radius:8px;padding:11px 15px;margin:2px 0;color:#B8B8B4;font-size:14px}
.settings-tabs button:hover{background:#292929}
.settings-tabs button.on{background:#303030;color:#fff}
.settings-page{padding:34px;overflow:auto;max-width:640px}
.settings-page h3{font-size:25px;font-weight:600;margin:0}
.settings-page .lead{color:#8F8F8B;margin:6px 0 26px}
.settings-page label.f{display:block;margin:16px 0 7px}
.settings-page .hint{color:#777;font-size:11px;margin:6px 0 0}
.settings-page .row-btns{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}
.settings-page .status{margin:12px 0 0;min-height:18px;white-space:pre-wrap}
.settings-page .status.ok{color:#90EE90}
.settings-page .status.err{color:#E06464}
.settings-page h4{font-size:16px;font-weight:600;margin:28px 0 4px}
.settings-page .check{display:flex;gap:10px;align-items:center;margin:12px 0;cursor:pointer}
.settings-foot{display:flex;justify-content:flex-end;align-items:center;gap:10px;padding:0 22px}
.avatar-row{display:flex;gap:20px;align-items:center}
.avatar.big{width:88px;height:88px;font-size:25px;font-weight:400}
.swatches{display:flex;gap:5px}
.swatches button{width:24px;height:24px;padding:0;border:2px solid transparent}
.swatches button.on{border-color:#fff}
.settings-page textarea.bug-details{width:100%;height:auto;min-height:140px;padding:10px 11px;resize:vertical;line-height:1.45}
.danger-zone{border:1px solid #5a2a2a;border-radius:12px;padding:16px;margin-top:24px}
.danger-zone p{color:#bdbdbd;margin:6px 0 12px}

/* ---------- Narrow screens ---------- */
.app.compact .bubble{margin-top:4px;margin-bottom:6px}
.app.compact .task{padding:8px 10px}
@media (max-width:860px){
  .workspace{grid-template-columns:1fr!important}
  .sidebar{position:fixed;left:0;top:36px;bottom:0;z-index:30;transform:translateX(-102%);transition:transform .18s ease;visibility:visible!important}
  .app.drawer-open .sidebar{transform:none}
  .open-side{display:grid!important}
  .top-right{position:static;margin-left:auto;gap:6px}
  .pill.plan span{display:none}
  .plan-grid{grid-template-columns:1fr}
  .main-top{padding:0 10px}
  .stage{padding:0 12px 14px}
  .greeting{font-size:32px}
  .bubble{margin-right:12px}.bubble.user{margin-left:24px}
  .chip-btn.approval span,.attach-label{display:none}
  .settings{grid-template-rows:60px 1fr 58px}
  .settings-body{grid-template-columns:1fr;grid-template-rows:auto 1fr}
  .settings-tabs{display:flex;overflow-x:auto;padding:8px}
  .settings-tabs button{width:auto;white-space:nowrap;padding:8px 12px}
  .settings-page{padding:20px}
}
@media (max-width:760px){
  .auth{grid-template-columns:1fr}
  .auth-art{display:none}
  .auth-side{padding:28px 20px}
  .auth-mobile-brand{display:flex;align-items:center;justify-content:center;gap:10px;margin-bottom:24px;font:30px var(--serif)}
  .auth-panel h1{font-size:30px}
  .auth-sub{font-size:15px;margin-bottom:24px}
}
@media (max-width:520px){
  .composer{padding:12px 10px 8px 12px;border-radius:18px}
  .composer-bar{height:auto;flex-wrap:wrap;row-gap:6px}
  #attachImage{display:none}
  .picker{padding:0 8px}
  .titlebar .meter{width:150px}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* two-factor choice for new accounts */
.dialog.tfa-choice{width:480px}
.tfa-option b{display:flex;align-items:center;gap:8px}
.tfa-option .badge{font-size:11px;font-weight:600;color:#121212;background:#F2F2EF;border-radius:10px;padding:2px 8px}
.tfa-option small{line-height:1.45}

/* ---------- Invite-friends offer card (shown when the app opens) ---------- */
.promo{position:fixed;right:20px;top:62px;width:320px;background:#202020;border:1px solid #464646;border-radius:16px;padding:16px 18px;z-index:40;box-shadow:0 12px 32px rgba(0,0,0,.45);display:grid;gap:9px;animation:promo-in .25s ease}
@keyframes promo-in{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.promo b{font-size:15px;font-weight:600;padding-right:26px}
.promo p{margin:0;color:#cfcfcb;font-size:13px;line-height:1.45}
.promo .btn-primary{height:36px;border-radius:18px}
.promo .check{display:flex;gap:8px;align-items:center;font-size:12.5px;color:#bdbdb9;cursor:pointer}
.promo .check input{margin:0}
.promo small{color:#8f8f8b;font-size:11.5px;line-height:1.4}
.promo-x{position:absolute;top:10px;right:10px;width:26px;height:26px;padding:0;border-radius:50%;border:0;background:transparent;color:#bdbdb9;font-size:13px;line-height:26px}
.promo-x:hover{background:#2e2e2e;color:#fff}
.dialog .buttons.start{justify-content:flex-start;margin-top:8px}
@media (max-width:860px){.promo{left:12px;right:12px;width:auto;top:auto;bottom:12px}}

/* Beta models section in the More models menu */
.menu-section{padding:9px 10px 4px;margin-top:4px;border-top:1px solid #3a3a3a;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:#9a9a96}
.menu-section:first-child{border-top:0;margin-top:0}
