/* ============================================================
   AI Chat Pro — Premium Dark Theme
   ============================================================ */

/* ── Reset & Base ── */
.aic-wrapper * { box-sizing: border-box; margin: 0; padding: 0; }
.aic-wrapper { display: flex; position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100vw; height: 100vh; height: 100dvh; overflow: hidden; background: #080808; color: #e0e0e0; font-family: -apple-system, 'Segoe UI', sans-serif; }

/* ── Login ── */
.aic-login-wrap { display:flex; align-items:center; justify-content:center; min-height:60vh; }
.aic-login-box  { text-align:center; padding:48px 40px; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.08); border-radius:20px; max-width:360px; }
.aic-login-logo { font-size:32px; margin-bottom:20px; }
.aic-login-box h2 { font-size:22px; color:#ececec; margin-bottom:8px; }
.aic-login-box p  { font-size:14px; color:#555; margin-bottom:28px; }
.aic-login-btn, .aic-register-btn { display:block; padding:11px 24px; border-radius:10px; font-size:14px; font-weight:600; text-decoration:none; margin-bottom:10px; transition:all 0.15s; }
.aic-login-btn    { background:#ff7c5c; color:#fff; }
.aic-login-btn:hover { background:#ff5c3a; }
.aic-register-btn { background:rgba(255,255,255,0.05); color:#888; border:1px solid rgba(255,255,255,0.08); }
.aic-register-btn:hover { background:rgba(255,255,255,0.08); color:#ccc; }

/* ── Sidebar ── */
.aic-sidebar {
    width: 240px; min-width:240px; display:flex; flex-direction:column;
    background: #0a0a0a; border-right:1px solid rgba(255,255,255,0.06);
    transition: transform 0.3s ease, width 0.3s ease;
    z-index: 40;
}
.aic-sidebar.collapsed { width:0; min-width:0; overflow:hidden; }
.aic-sidebar-top { display:flex; align-items:center; justify-content:space-between; padding:16px 14px; border-bottom:1px solid rgba(255,255,255,0.05); }
.aic-logo { display:flex; align-items:center; gap:8px; }
.aic-logo-mark { font-size:18px; }
.aic-logo-text { font-size:14px; font-weight:600; color:#ececec; white-space:nowrap; }
.aic-new-btn { width:28px; height:28px; border-radius:7px; border:1px solid rgba(255,255,255,0.1); background:transparent; color:#666; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all 0.15s; }
.aic-new-btn:hover { background:rgba(255,255,255,0.07); color:#ccc; border-color:rgba(255,255,255,0.2); }

.aic-history-label { font-size:10px; font-weight:700; color:#2a2a2a; text-transform:uppercase; letter-spacing:1px; padding:14px 16px 6px; }
.aic-history-list  { flex:1; overflow-y:auto; padding:4px 8px; }
.aic-history-list::-webkit-scrollbar { width:3px; }
.aic-history-list::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.08); border-radius:2px; }
.aic-history-item { padding:9px 10px; border-radius:8px; cursor:pointer; font-size:13px; color:#666; transition:all 0.15s; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; border:1px solid transparent; }
.aic-history-item:hover { background:rgba(255,255,255,0.04); color:#bbb; }
.aic-history-item.active { background:rgba(255,124,92,0.08); color:#ff7c5c; border-color:rgba(255,124,92,0.18); }
.aic-no-history { padding:16px 10px; color:#333; font-size:13px; }
.aic-history-loading { display:flex; align-items:center; gap:5px; padding:16px 10px; }
.aic-history-loading span { width:5px; height:5px; border-radius:50%; background:#2a2a2a; animation:aic-bounce 1.2s ease-in-out infinite; }
.aic-history-loading span:nth-child(2) { animation-delay:0.2s; }
.aic-history-loading span:nth-child(3) { animation-delay:0.4s; }

.aic-sidebar-bottom { padding:12px; border-top:1px solid rgba(255,255,255,0.05); }
.aic-token-bar { margin-bottom:10px; }
.aic-token-bar-top { display:flex; align-items:center; gap:5px; margin-bottom:6px; }
.aic-token-icon  { font-size:12px; }
.aic-token-label { font-size:11px; color:#444; flex:1; }
.aic-token-pct   { font-size:10px; color:#555; }
.aic-token-track { height:3px; background:rgba(255,255,255,0.06); border-radius:2px; margin-bottom:5px; overflow:hidden; }
.aic-token-fill  { height:100%; background:#ff7c5c; border-radius:2px; transition:width 0.5s; }
.aic-token-nums  { display:flex; justify-content:space-between; font-size:10px; color:#333; }

.aic-user-row { display:flex; align-items:center; gap:10px; padding:10px 8px; border-radius:10px; cursor:pointer; transition:all 0.15s; border:1px solid transparent; }
.aic-user-row:hover { background:rgba(255,255,255,0.04); border-color:rgba(255,255,255,0.07); }
.aic-avatar { width:30px; height:30px; border-radius:50%; background:linear-gradient(135deg,#ff7c5c,#ff3d6b); display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; color:#fff; flex-shrink:0; }
.aic-user-info { flex:1; display:flex; flex-direction:column; gap:1px; min-width:0; }
.aic-user-name { font-size:12px; font-weight:500; color:#ccc; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.aic-user-plan { font-size:10px; color:#444; }

/* ── Overlay ── */
.aic-sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.6); z-index:39; }
.aic-sidebar-overlay.active { display:block; }

/* ── Settings Panel ── */
.aic-settings-panel { position:absolute; top:0; left:0; width:100%; height:100%; z-index:10000; background:#0a0a0a; display:flex; flex-direction:column; transform:translateX(-100%); transition:transform 0.3s cubic-bezier(0.4,0,0.2,1); overflow:hidden; }
.aic-settings-panel.open { transform:translateX(0); }
.aic-sp-header { display:flex; align-items:center; gap:14px; padding:14px 20px; border-bottom:1px solid rgba(255,255,255,0.06); background:rgba(255,255,255,0.02); flex-shrink:0; }
.aic-sp-header h2 { font-size:15px; font-weight:600; color:#ececec; letter-spacing:-0.2px; }
.aic-sp-back { display:flex; align-items:center; gap:5px; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.08); color:#888; cursor:pointer; font-size:12px; font-weight:500; padding:5px 11px 5px 8px; border-radius:8px; transition:all 0.15s; font-family:inherit; }
.aic-sp-back:hover { background:rgba(255,255,255,0.09); color:#ececec; }
.aic-sp-body { display:flex; flex:1; overflow:hidden; min-height:0; }

/* Settings sidebar */
.aic-sp-tabs { width:210px; min-width:210px; border-right:1px solid rgba(255,255,255,0.06); padding:20px 12px 16px; display:flex; flex-direction:column; gap:2px; overflow-y:auto; background:rgba(255,255,255,0.01); flex-shrink:0; }
.aic-sp-section-label { font-size:10px; font-weight:700; color:#2e2e2e; text-transform:uppercase; letter-spacing:1px; padding:4px 10px; margin-top:4px; margin-bottom:2px; }
.aic-sp-tab { display:flex; align-items:center; gap:9px; padding:9px 10px; background:transparent; border:none; color:#555; cursor:pointer; font-size:13px; font-weight:500; border-radius:9px; text-align:left; transition:all 0.15s; width:100%; font-family:inherit; position:relative; }
.aic-sp-tab-icon { width:27px; height:27px; border-radius:7px; background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.06); display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:all 0.15s; }
.aic-sp-tab span:nth-child(2) { flex:1; }
.aic-tab-arrow { opacity:0; color:#444; transition:opacity 0.15s; flex-shrink:0; }
.aic-sp-tab:hover { background:rgba(255,255,255,0.05); color:#ccc; }
.aic-sp-tab:hover .aic-tab-arrow { opacity:1; }
.aic-sp-tab.active { background:rgba(255,124,92,0.1); color:#ff7c5c; border:1px solid rgba(255,124,92,0.18); }
.aic-sp-tab.active .aic-sp-tab-icon { background:rgba(255,124,92,0.15); border-color:rgba(255,124,92,0.25); color:#ff7c5c; }
.aic-sp-tab.active .aic-tab-arrow { opacity:1; color:#ff7c5c; }
.aic-sp-tab.active::before { content:''; position:absolute; left:-12px; top:50%; transform:translateY(-50%); width:3px; height:18px; background:#ff7c5c; border-radius:0 3px 3px 0; box-shadow:0 0 8px rgba(255,124,92,0.5); }
.aic-sp-version { margin-top:auto; padding:20px 10px 4px; font-size:10px; color:#222; }

/* Settings content */
.aic-sp-content { flex:1; overflow-y:auto; padding:0; min-height:0; -webkit-overflow-scrolling:touch; }
.aic-sp-content::-webkit-scrollbar { width:4px; }
.aic-sp-content::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.08); border-radius:2px; }
.aic-sp-pane { display:none; padding:28px; }
.aic-sp-pane.active { display:block; }
.aic-pane-title { font-size:15px; font-weight:600; color:#ececec; margin-bottom:20px; }
.aic-pane-topbar { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.aic-pane-topbar h3 { font-size:15px; font-weight:600; color:#ececec; }

/* Profile */
.aic-profile-hero { display:flex; flex-direction:column; align-items:center; margin-bottom:28px; animation:aic-fadeup 0.3s ease; }
.aic-profile-ring { width:90px; height:90px; border-radius:50%; background:linear-gradient(135deg,#ff7c5c,#ff3d6b); padding:3px; margin-bottom:14px; box-shadow:0 0 0 4px rgba(255,124,92,0.1),0 8px 28px rgba(255,124,92,0.2); animation:aic-pulse-ring 3s ease-in-out infinite; }
.aic-profile-av { width:100%; height:100%; border-radius:50%; background:linear-gradient(135deg,#ff7c5c,#ff3d6b); display:flex; align-items:center; justify-content:center; font-size:32px; font-weight:800; color:#fff; border:2px solid rgba(0,0,0,0.3); }
.aic-profile-name { font-size:20px; font-weight:700; color:#ececec; margin-bottom:8px; }
.aic-profile-plan-badge { font-size:11px; font-weight:600; color:#888; background:rgba(255,124,92,0.08); border:1px solid rgba(255,124,92,0.18); border-radius:20px; padding:3px 12px; text-transform:uppercase; letter-spacing:0.5px; }
.aic-profile-card { background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.07); border-radius:16px; padding:24px; animation:aic-fadeup 0.3s 0.1s ease both; }
.aic-profile-card-title { font-size:11px; font-weight:700; color:#333; text-transform:uppercase; letter-spacing:1px; margin-bottom:20px; padding-bottom:12px; border-bottom:1px solid rgba(255,255,255,0.06); }
.aic-field-group { margin-bottom:18px; }
.aic-field-group label { display:block; font-size:10px; font-weight:700; color:#444; text-transform:uppercase; letter-spacing:0.8px; margin-bottom:7px; }
.aic-field-wrap { position:relative; display:flex; align-items:center; }
.aic-field-wrap svg { position:absolute; left:12px; color:#333; pointer-events:none; }
.aic-field-wrap input { width:100%; background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.08); border-radius:10px; padding:10px 14px 10px 36px; color:#ddd; font-size:14px; outline:none; transition:all 0.2s; font-family:inherit; }
.aic-field-wrap input:focus { border-color:rgba(255,124,92,0.45); background:rgba(255,124,92,0.04); box-shadow:0 0 0 3px rgba(255,124,92,0.08); }
.aic-field-wrap input.readonly { opacity:0.35; cursor:not-allowed; }
.aic-field-hint { display:block; font-size:11px; color:#333; margin-top:4px; padding-left:2px; }
.aic-save-btn { width:100%; display:flex; align-items:center; justify-content:center; gap:7px; padding:11px; margin-top:8px; background:linear-gradient(135deg,#ff7c5c,#ff4d3a); border:none; border-radius:10px; color:#fff; font-size:14px; font-weight:600; cursor:pointer; transition:all 0.2s; font-family:inherit; box-shadow:0 4px 16px rgba(255,124,92,0.25); }
.aic-save-btn:hover { transform:translateY(-1px); box-shadow:0 6px 20px rgba(255,124,92,0.35); }
.aic-msg { font-size:13px; margin-top:10px; min-height:18px; }

/* Usage tab */
.aic-refresh-btn { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.08); border-radius:8px; color:#666; font-size:12px; cursor:pointer; transition:all 0.15s; font-family:inherit; }
.aic-refresh-btn:hover { color:#ff7c5c; border-color:rgba(255,124,92,0.3); }
@keyframes aic-spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }

.aic-usage-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:20px; }
.aic-ustat { background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.07); border-radius:12px; padding:14px 10px; text-align:center; transition:all 0.2s; }
.aic-ustat:hover { border-color:rgba(255,255,255,0.12); }
.aic-ustat-accent { border-color:rgba(255,124,92,0.3); background:rgba(255,124,92,0.07); }
.aic-ustat-icon { font-size:16px; margin-bottom:6px; }
.aic-ustat-val { font-size:16px; font-weight:700; color:#ececec; margin-bottom:3px; font-variant-numeric:tabular-nums; }
.aic-ustat-accent .aic-ustat-val { color:#ff7c5c; }
.aic-ustat-lbl { font-size:10px; color:#444; text-transform:uppercase; letter-spacing:0.5px; font-weight:600; }

.aic-plan-bar-card { background:rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.07); border-radius:14px; padding:18px; margin-bottom:20px; }
.aic-plan-bar-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; font-size:13px; color:#888; }
.aic-plan-tag { background:rgba(255,124,92,0.1); color:#ff7c5c; border:1px solid rgba(255,124,92,0.2); border-radius:20px; padding:2px 10px; font-size:11px; font-weight:600; }
.aic-plan-nums { display:flex; align-items:baseline; gap:6px; margin-bottom:12px; }
.aic-plan-used { font-size:26px; font-weight:700; color:#ff7c5c; font-variant-numeric:tabular-nums; }
.aic-plan-nums span:last-child { font-size:13px; color:#555; }
.aic-plan-track { height:5px; background:rgba(255,255,255,0.05); border-radius:3px; overflow:hidden; margin-bottom:8px; }
.aic-plan-fill { height:100%; background:#ff7c5c; border-radius:3px; transition:width 0.5s; }
.aic-plan-footer { display:flex; justify-content:space-between; font-size:12px; color:#444; }

.aic-chart-section { margin-bottom:24px; }
.aic-chart-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.aic-chart-hdr h3 { font-size:14px; font-weight:600; color:#ececec; }
.aic-range-btns { display:flex; gap:4px; }
.aic-range-btn { padding:4px 10px; background:transparent; border:1px solid rgba(255,255,255,0.08); border-radius:20px; color:#444; font-size:11px; cursor:pointer; transition:all 0.15s; font-family:inherit; }
.aic-range-btn:hover { border-color:rgba(255,255,255,0.16); color:#aaa; }
.aic-range-btn.active { background:rgba(255,124,92,0.12); border-color:rgba(255,124,92,0.4); color:#ff7c5c; font-weight:600; }
.aic-chart-wrap { background:rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.06); border-radius:12px; padding:16px; position:relative; min-height:220px; display:flex; align-items:center; justify-content:center; }
.aic-chart-wrap canvas { display:block; width:100%!important; }
.aic-chart-loading { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; }
.aic-chart-empty { text-align:center; color:#444; }
.aic-chart-empty div { font-size:28px; margin-bottom:8px; }
.aic-chart-empty p { font-size:14px; }

.aic-by-model h3 { font-size:14px; font-weight:600; color:#ececec; margin-bottom:14px; }
.aic-stacked-wrap { background:rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.06); border-radius:12px; padding:16px; min-height:230px; margin-bottom:14px; }
.aic-stacked-wrap canvas { width:100%!important; }
.aic-mtable { width:100%; border-collapse:collapse; font-size:12px; }
.aic-mtable thead tr { border-bottom:1px solid rgba(255,255,255,0.07); }
.aic-mtable th { padding:8px 10px; text-align:right; font-size:10px; font-weight:600; color:#444; text-transform:uppercase; letter-spacing:0.5px; white-space:nowrap; }
.aic-mtable th:first-child { text-align:left; }
.aic-mtable td { padding:10px 10px; text-align:right; color:#888; border-bottom:1px solid rgba(255,255,255,0.04); font-variant-numeric:tabular-nums; }
.aic-mtable td:first-child { text-align:left; color:#ccc; font-weight:500; display:flex; align-items:center; gap:8px; }
.aic-mtable tbody tr:hover td { background:rgba(255,255,255,0.02); }
.aic-mtdot { width:8px; height:8px; border-radius:50%; flex-shrink:0; display:inline-block; }

/* Plan tab */
.aic-plans-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px; }
.aic-plan-card { background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.07); border-radius:14px; padding:20px 16px; position:relative; transition:all 0.2s; }
.aic-plan-card.active { border-color:rgba(255,124,92,0.4); background:rgba(255,124,92,0.06); }
.aic-plan-curr-badge { position:absolute; top:12px; right:12px; font-size:10px; font-weight:700; color:#ff7c5c; background:rgba(255,124,92,0.12); border-radius:20px; padding:2px 8px; }
.aic-plan-name { font-size:14px; font-weight:700; color:#ececec; margin-bottom:8px; }
.aic-plan-price { font-size:22px; font-weight:800; color:#ff7c5c; margin-bottom:6px; }
.aic-plan-price span { font-size:13px; font-weight:500; color:#555; }
.aic-plan-tokens { font-size:12px; color:#666; margin-bottom:14px; }
.aic-plan-upgrade-btn { width:100%; padding:8px; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1); border-radius:8px; color:#888; font-size:12px; cursor:pointer; transition:all 0.15s; font-family:inherit; }
.aic-plan-upgrade-btn:hover { background:rgba(255,124,92,0.1); border-color:rgba(255,124,92,0.3); color:#ff7c5c; }
.aic-plan-active-txt { text-align:center; color:#22c55e; font-size:13px; font-weight:600; }

/* Payment tab */
.aic-payment-empty { text-align:center; padding:28px; background:rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.06); border-radius:12px; margin-bottom:20px; }
.aic-pe-icon { font-size:32px; margin-bottom:10px; }
.aic-payment-empty p { color:#666; font-size:14px; }
.aic-payment-empty small { color:#333; font-size:12px; }
.aic-pay-methods { display:flex; flex-direction:column; gap:8px; }
.aic-pay-method { display:flex; align-items:center; gap:12px; padding:12px 16px; background:rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.06); border-radius:10px; font-size:13px; color:#888; }
.aic-pay-method span:nth-child(2) { flex:1; }
.aic-pay-status { font-size:11px; color:#22c55e; font-weight:600; }

/* Models tab */
.aic-models-topbar { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; flex-wrap:wrap; gap:10px; }
.aic-models-topbar h3 { font-size:15px; font-weight:600; color:#ececec; }
.aic-running-pill { display:inline-flex; align-items:center; gap:6px; padding:5px 12px; background:rgba(34,197,94,0.07); border:1px solid rgba(34,197,94,0.2); border-radius:20px; font-size:12px; color:#22c55e; font-weight:500; }
.aic-rp-dot { width:6px; height:6px; border-radius:50%; background:#22c55e; box-shadow:0 0 6px #22c55e; animation:aic-blink 2s ease-in-out infinite; }

/* Running model card */
.aic-running-card { position:relative; display:flex; align-items:center; justify-content:space-between; padding:20px 22px; border-radius:16px; border:1px solid rgba(255,255,255,0.09); background:rgba(255,255,255,0.03); margin-bottom:8px; overflow:hidden; }
.aic-rc-glow { position:absolute; top:-40px; right:-40px; width:160px; height:160px; border-radius:50%; background:radial-gradient(circle,rgba(255,124,92,0.15),transparent 70%); pointer-events:none; }
.aic-rc-left { display:flex; flex-direction:column; gap:6px; }
.aic-rc-status { display:inline-flex; align-items:center; gap:7px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:1.2px; color:#444; }
.aic-rc-dot { width:7px; height:7px; border-radius:50%; background:#22c55e; box-shadow:0 0 8px #22c55e; animation:aic-blink 2s ease-in-out infinite; }
.aic-rc-name { font-size:20px; font-weight:700; color:#ececec; letter-spacing:-0.4px; }
.aic-rc-tags { display:flex; gap:7px; flex-wrap:wrap; margin-top:4px; }
.aic-rc-tag { font-size:10px; padding:3px 9px; border-radius:6px; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.08); color:#444; font-family:monospace; }
.aic-rc-tag.premium { color:#ff7c5c; background:rgba(255,124,92,0.1); border-color:rgba(255,124,92,0.2); font-family:inherit; font-weight:600; }
.aic-rc-tag.free { color:#22c55e; background:rgba(34,197,94,0.08); border-color:rgba(34,197,94,0.2); font-family:inherit; font-weight:600; }
.aic-rc-pulse { position:relative; width:44px; height:44px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.aic-rc-ring { position:absolute; inset:0; border-radius:50%; border:2px solid rgba(255,124,92,0.4); animation:aic-pulse-out 2s ease-out infinite; }
.aic-rc-core { width:18px; height:18px; border-radius:50%; background:#ff7c5c; }

.aic-models-divider { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:#2a2a2a; margin:20px 0 12px; }

/* Provider dropdown */
.aic-prov-section { margin-bottom:8px; border:1px solid rgba(255,255,255,0.07); border-radius:14px; overflow:hidden; }
.aic-prov-section.open .aic-prov-chevron { transform:rotate(180deg); }
.aic-prov-header { display:flex; align-items:center; gap:11px; padding:12px 14px; cursor:pointer; background:rgba(255,255,255,0.02); transition:background 0.15s; user-select:none; }
.aic-prov-header:hover { background:rgba(255,255,255,0.04); }
.aic-prov-icon { width:32px; height:32px; border-radius:8px; border:1px solid; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.aic-prov-info { flex:1; display:flex; flex-direction:column; gap:2px; }
.aic-prov-name { font-size:13px; font-weight:600; color:#ccc; }
.aic-prov-count { font-size:10px; color:#444; }
.aic-prov-chevron { color:#444; transition:transform 0.25s; flex-shrink:0; }
.aic-prov-body { max-height:0; overflow:hidden; transition:max-height 0.3s cubic-bezier(0.4,0,0.2,1); }
.aic-prov-section.open .aic-prov-body { max-height:320px; overflow-y:auto; }
.aic-prov-section.open .aic-prov-body::-webkit-scrollbar { width:3px; }
.aic-prov-section.open .aic-prov-body::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.08); }
.aic-prov-section.open .aic-prov-header { border-bottom:1px solid rgba(255,255,255,0.06); }

.aic-model-row { display:flex; align-items:center; justify-content:space-between; padding:9px 14px; border-radius:0; gap:10px; transition:background 0.15s; border-bottom:1px solid rgba(255,255,255,0.03); }
.aic-model-row:last-child { border-bottom:none; }
.aic-model-row:hover { background:rgba(255,255,255,0.03); }
.aic-model-row.active { background:rgba(255,124,92,0.05); }
.aic-mr-l { display:flex; align-items:center; gap:9px; flex:1; min-width:0; }
.aic-mr-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.aic-mr-info { display:flex; flex-direction:column; gap:2px; min-width:0; }
.aic-mr-name { font-size:13px; font-weight:500; color:#ccc; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.aic-mr-id   { font-size:10px; color:#2a2a2a; font-family:monospace; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.aic-mr-r { display:flex; align-items:center; gap:7px; flex-shrink:0; }
.aic-mr-running { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:600; border:1px solid; border-radius:20px; padding:3px 10px; }
.aic-mr-rdot { width:5px; height:5px; border-radius:50%; animation:aic-blink 2s infinite; }
.aic-mr-use { padding:4px 12px; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.08); border-radius:7px; color:#555; font-size:11px; font-weight:500; cursor:pointer; transition:all 0.15s; font-family:inherit; }
.aic-mr-use:hover { background:rgba(255,255,255,0.09); color:#ccc; border-color:rgba(255,255,255,0.16); }

/* ── Main chat area ── */
.aic-main { flex:1; display:flex; flex-direction:column; overflow:hidden; min-width:0; transition:margin 0.3s; }
.aic-main.expanded { margin-left:0; }

/* Header */
.aic-header { display:flex; align-items:center; gap:12px; padding:12px 16px; border-bottom:1px solid rgba(255,255,255,0.06); background:rgba(255,255,255,0.01); flex-shrink:0; }
.aic-menu-btn { width:32px; height:32px; border-radius:8px; border:1px solid rgba(255,255,255,0.08); background:transparent; color:#666; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all 0.15s; flex-shrink:0; }
.aic-menu-btn:hover { background:rgba(255,255,255,0.07); color:#ccc; }

.aic-model-btn { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.09); border-radius:10px; color:#bbb; font-size:13px; font-weight:500; cursor:pointer; transition:all 0.15s; font-family:inherit; white-space:nowrap; }
.aic-model-btn:hover { background:rgba(255,255,255,0.08); border-color:rgba(255,255,255,0.16); color:#eee; }
.aic-model-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.aic-model-dot.free    { background:#22c55e; box-shadow:0 0 5px #22c55e88; }
.aic-model-dot.premium { background:#ff7c5c; box-shadow:0 0 5px #ff7c5c88; }
.aic-model-dot.small   { width:5px; height:5px; }
.aic-model-mult { font-size:9px; font-weight:700; color:#ff7c5c; background:rgba(255,124,92,0.1); border:1px solid rgba(255,124,92,0.2); border-radius:4px; padding:1px 4px; }

.aic-header-right { margin-left:auto; }
.aic-header-tokens { display:inline-flex; align-items:center; gap:5px; font-size:12px; color:#555; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.07); border-radius:8px; padding:5px 10px; }
#hdr-balance { color:#ccc; font-weight:600; font-variant-numeric:tabular-nums; }

/* Messages */
.aic-messages { flex:1; overflow-y:auto; padding:24px 20px; display:flex; flex-direction:column; gap:16px; }
.aic-messages::-webkit-scrollbar { width:4px; }
.aic-messages::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.08); border-radius:2px; }

/* Welcome */
.aic-welcome { display:flex; flex-direction:column; align-items:center; justify-content:center; flex:1; text-align:center; padding:40px 20px; animation:aic-fadeup 0.4s ease; }
.aic-welcome-icon { font-size:48px; margin-bottom:20px; }
.aic-welcome h2 { font-size:26px; font-weight:700; color:#ececec; margin-bottom:8px; letter-spacing:-0.5px; }
.aic-welcome p  { font-size:15px; color:#444; margin-bottom:28px; }
.aic-suggestions { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; max-width:480px; }
.aic-suggestion { padding:8px 16px; background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.09); border-radius:20px; color:#666; font-size:13px; cursor:pointer; transition:all 0.15s; font-family:inherit; }
.aic-suggestion:hover { background:rgba(255,255,255,0.08); color:#ccc; border-color:rgba(255,255,255,0.18); transform:translateY(-1px); }

/* Message bubbles */
.aic-msg { display:flex; gap:10px; animation:aic-fadeup 0.25s ease; }
.aic-msg-user { justify-content:flex-end; }
.aic-bubble { max-width:72%; padding:12px 16px; border-radius:16px; font-size:14px; line-height:1.6; }
.aic-msg-user     .aic-bubble { background:rgba(255,124,92,0.12); border:1px solid rgba(255,124,92,0.2); color:#ddd; border-radius:18px 18px 4px 18px; }
.aic-msg-assistant .aic-bubble { background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.08); color:#ccc; border-radius:18px 18px 18px 4px; }
.aic-bubble p { margin:0 0 8px; } .aic-bubble p:last-child { margin:0; }
.aic-bubble pre { background:rgba(0,0,0,0.4); border:1px solid rgba(255,255,255,0.08); border-radius:8px; padding:12px; overflow-x:auto; margin:10px 0; font-size:13px; }
.aic-bubble code { background:rgba(255,255,255,0.08); padding:2px 6px; border-radius:4px; font-size:13px; }
.aic-bubble pre code { background:transparent; padding:0; }
.aic-bubble h1,.aic-bubble h2,.aic-bubble h3 { color:#ececec; margin:10px 0 5px; }
.aic-bubble ul { padding-left:20px; margin:6px 0; }
.aic-bubble strong { color:#ececec; }
.aic-cursor { display:inline-block; width:2px; height:16px; background:#ff7c5c; margin-left:2px; animation:aic-blink-cursor 0.7s ease-in-out infinite; vertical-align:middle; border-radius:1px; }

/* Input area */
.aic-input-area { flex-shrink:0; padding:12px 16px; border-top:1px solid rgba(255,255,255,0.06); background:rgba(255,255,255,0.01); }
.aic-input-wrap { display:flex; align-items:flex-end; gap:10px; background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.1); border-radius:14px; padding:10px 12px; transition:border-color 0.2s; }
.aic-input-wrap:focus-within { border-color:rgba(255,124,92,0.35); }
.aic-input { flex:1; background:transparent; border:none; outline:none; color:#e0e0e0; font-size:14px; line-height:1.5; resize:none; font-family:inherit; max-height:160px; min-height:24px; }
.aic-input::placeholder { color:#333; }
.aic-input:disabled { opacity:0.5; cursor:not-allowed; }
.aic-send-btn { width:34px; height:34px; border-radius:10px; border:none; background:#ff7c5c; color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:all 0.2s; }
.aic-send-btn:hover:not(:disabled) { background:#ff5c3a; transform:scale(1.05); }
.aic-send-btn:disabled { background:rgba(255,255,255,0.07); cursor:not-allowed; color:#333; }
.aic-input-footer { display:flex; align-items:center; justify-content:space-between; margin-top:8px; padding:0 2px; gap:8px; }
.aic-input-model { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:#888; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1); border-radius:20px; padding:4px 10px; cursor:pointer; transition:all 0.15s; user-select:none; }
.aic-input-model:hover { background:rgba(255,255,255,0.09); color:#ccc; border-color:rgba(255,255,255,0.18); }
.aic-input-model svg { opacity:0.5; }
.aic-input-hint { font-size:10px; color:#222; }

/* ── Model Sheet ── */
.aic-model-sheet { position:fixed; inset:0; z-index:200; display:flex; align-items:flex-end; justify-content:center; }
.aic-sheet-backdrop { position:absolute; inset:0; background:rgba(0,0,0,0.7); }
.aic-sheet-panel { position:relative; width:100%; max-width:560px; background:#111; border-radius:20px 20px 0 0; display:flex; flex-direction:column; max-height:92vh; max-height:92dvh; transform:translateY(100%); transition:transform 0.3s cubic-bezier(0.4,0,0.2,1); border:1px solid rgba(255,255,255,0.09); border-bottom:none; }
.aic-model-sheet.open .aic-sheet-panel { transform:translateY(0); }
.aic-sheet-handle { width:36px; height:4px; background:rgba(255,255,255,0.1); border-radius:2px; margin:12px auto 0; flex-shrink:0; }
.aic-sheet-header { display:flex; align-items:center; justify-content:space-between; padding:14px 16px 10px; flex-shrink:0; border-bottom:1px solid rgba(255,255,255,0.07); gap:12px; }
.aic-sheet-header span { font-size:14px; font-weight:600; color:#ececec; white-space:nowrap; }
.aic-sheet-search { flex:1; background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.1); border-radius:8px; padding:7px 12px; color:#ddd; font-size:13px; outline:none; font-family:inherit; }
.aic-sheet-search:focus { border-color:rgba(255,124,92,0.4); }
.aic-sheet-close { width:28px; height:28px; border-radius:7px; border:1px solid rgba(255,255,255,0.1); background:transparent; color:#666; cursor:pointer; font-size:13px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.aic-sheet-close:hover { color:#ccc; background:rgba(255,255,255,0.07); }
.aic-sheet-list { overflow-y:auto; flex:1; padding:8px 0; }
.aic-sheet-list::-webkit-scrollbar { width:4px; }
.aic-sheet-list::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.08); }
.aic-sheet-group-label { padding:6px 16px 4px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.8px; background:#111; position:sticky; top:0; z-index:1; }
.aic-sheet-item { width:100%; display:flex; align-items:center; justify-content:space-between; padding:10px 16px; background:transparent; border:none; cursor:pointer; transition:background 0.12s; gap:10px; }
.aic-sheet-item:hover { background:rgba(255,255,255,0.04); }
.aic-sheet-item.active { background:rgba(255,124,92,0.07); }
.aic-si-left { display:flex; align-items:center; gap:10px; flex:1; min-width:0; }
.aic-si-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.aic-si-info { display:flex; flex-direction:column; gap:2px; min-width:0; }
.aic-si-name { font-size:13px; font-weight:500; color:#ccc; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.aic-si-id   { font-size:10px; color:#333; font-family:monospace; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.aic-si-right { flex-shrink:0; color:#ff7c5c; }

/* ── Loading dots ── */
.aic-dots { display:flex; align-items:center; gap:5px; }
.aic-dots span { width:6px; height:6px; border-radius:50%; background:#333; animation:aic-bounce 1.2s ease-in-out infinite; }
.aic-dots span:nth-child(2) { animation-delay:0.2s; }
.aic-dots span:nth-child(3) { animation-delay:0.4s; }
.aic-loading-center { display:flex; align-items:center; justify-content:center; padding:32px; }

/* ── Notice ── */
.aic-notice { position:fixed; top:20px; right:20px; z-index:9999; padding:11px 18px; border-radius:10px; font-size:13px; font-weight:500; color:#fff; box-shadow:0 4px 16px rgba(0,0,0,0.4); transition:opacity 0.3s; }
.aic-notice-success { background:#22c55e; }
.aic-notice-error   { background:#ef4444; }
.aic-notice-info    { background:#3b82f6; }

/* ── Animations ── */
@keyframes aic-fadeup { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }
@keyframes aic-bounce { 0%,80%,100%{transform:scale(0.7);opacity:0.4} 40%{transform:scale(1);opacity:1} }
@keyframes aic-blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
@keyframes aic-blink-cursor { 0%,100%{opacity:1} 50%{opacity:0} }
@keyframes aic-pulse-ring { 0%,100%{box-shadow:0 0 0 4px rgba(255,124,92,0.1),0 8px 28px rgba(255,124,92,0.2)} 50%{box-shadow:0 0 0 8px rgba(255,124,92,0.05),0 8px 36px rgba(255,124,92,0.3)} }
@keyframes aic-pulse-out { 0%{transform:scale(0.8);opacity:0.5} 100%{transform:scale(1.6);opacity:0} }

/* ── Mobile ── */
@media (max-width: 768px) {
    .aic-wrapper { height: 100vh; height: 100dvh; }

    .aic-sidebar {
        position: fixed; top: 0; left: 0;
        height: 100vh; height: 100dvh;
        width: 280px; min-width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s; z-index: 9999;
    }
    .aic-sidebar.open { transform: translateX(0); }

    .aic-sp-body { flex-direction: column; }

    .aic-sp-tabs {
        width: 100%; min-width: unset;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        padding: 10px 12px 8px;
        overflow-x: auto; gap: 6px;
        max-height: none; flex-shrink: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .aic-sp-tabs::-webkit-scrollbar { display: none; }

    .aic-sp-section-label, .aic-sp-version, .aic-tab-arrow { display: none !important; }
    .aic-sp-tab-icon { display: none !important; }

    .aic-sp-tab {
        padding: 7px 14px; flex-shrink: 0;
        white-space: nowrap; border-radius: 20px;
        font-size: 13px; width: auto;
        border: 1px solid rgba(255,255,255,0.08);
    }
    .aic-sp-tab span { display: inline !important; }
    .aic-sp-tab::before { display: none !important; }
    .aic-sp-tab.active {
        background: rgba(255,124,92,0.15);
        border-color: rgba(255,124,92,0.35);
        color: #ff7c5c;
    }

    .aic-sp-content { flex: 1; overflow-y: auto; min-height: 0; }
    .aic-sp-pane { padding: 18px 16px; }
    .aic-usage-stats { grid-template-columns: repeat(2,1fr); }
    .aic-bubble { max-width: 90%; }
    .aic-messages { padding: 16px 12px; }
    .aic-header { padding: 10px 12px; }
    .aic-input-area { padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
    .aic-sheet-panel { max-width: 100%; border-radius: 20px 20px 0 0; max-height: 92dvh; }
    .aic-welcome { padding: 20px 16px; }
    .aic-welcome h2 { font-size: 20px; }
    .aic-suggestions { gap: 6px; }
    .aic-suggestion { font-size: 12px; padding: 7px 12px; }
}

/* ============================================================
   Fullscreen Mode — body-level overrides
   ============================================================ */
body.aic-fullscreen-body {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #080808 !important;
}

/* Make wrapper fill the entire viewport */
body.aic-fullscreen-body .aic-wrapper {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    right: 0 !important; bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 999999 !important;
}

/* WordPress admin bar fix (logged-in admins) */
body.aic-fullscreen-body #wpadminbar {
    display: none !important;
}
body.aic-fullscreen-body.admin-bar .aic-wrapper {
    top: 0 !important;
}
