:root {
  /* ── DESIGN SYSTEM — Ultra Premium Minimal ── */

  /* Espacements — multiples de 8 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Rayons — sobres et cohérents */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-2xl: 28px;
  --radius-pill: 999px;

  /* Ombres — ultra douces style Apple */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.10), 0 8px 16px rgba(0,0,0,0.05);

  /* Couleurs — palette minimaliste */
  --color-primary: #0a0a0a;
  --color-primary-hover: #1a1a1a;
  --color-green: #16a34a;
  --color-green-mid: #1a7f5a;
  --color-green-light: #f0fdf4;
  --color-green-border: #bbf7d0;
  --color-red: #dc2626;
  --color-red-light: #fef2f2;
  --color-red-border: #fecaca;
  --color-amber: #d97706;
  --color-amber-light: #fffbeb;
  --color-amber-border: #fde68a;
  --color-blue: #2563eb;
  --color-blue-light: #eff6ff;

  /* Backgrounds */
  --color-bg: #fafafa;
  --color-bg-subtle: #f4f4f5;
  --color-surface: #ffffff;
  --color-surface-raised: #ffffff;

  /* Bordures */
  --color-border: #e4e4e7;
  --color-border-subtle: #f0f0f2;
  --color-border-strong: #d1d1d6;

  /* Textes */
  --color-text: #09090b;
  --color-text-secondary: #71717a;
  --color-text-tertiary: #a1a1aa;
  --color-text-disabled: #d4d4d8;

  /* Typographie */
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;
  --tracking-tight: -0.03em;
  --tracking-tighter: -0.05em;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:16px;-webkit-text-size-adjust:100%;overflow-x:hidden}
body{font-family:-apple-system,BlinkMacSystemFont,'SF Pro Display','Segoe UI',system-ui,sans-serif;background:var(--color-bg);color:#1c1c1e;min-height:100vh;overflow-x:hidden}
::-webkit-scrollbar{width:4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#d1d1d6;border-radius:99px}
.demo-banner{background:#1c1c1e;color:#fff;padding:8px 16px;font-size:13px;font-weight:600;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.demo-banner a{color:#a3a3a3;text-decoration:underline;cursor:pointer}
.auth-screen{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:40px 20px;background:#0a0a0b;position:relative;overflow:hidden}
.auth-bg{position:absolute;inset:0;pointer-events:none}
.auth-bg-circle{position:absolute;border-radius:50%;filter:blur(80px);opacity:0.15}
.auth-bg-circle.c1{width:400px;height:400px;background:#1a7f5a;top:-100px;left:-100px;animation:float1 8s ease-in-out infinite}
.auth-bg-circle.c2{width:300px;height:300px;background:#3b82f6;bottom:-80px;right:-80px;animation:float2 10s ease-in-out infinite}
.auth-bg-circle.c3{width:200px;height:200px;background:#f59e0b;top:50%;left:50%;animation:float3 12s ease-in-out infinite}
@keyframes float1{0%,100%{transform:translate(0,0)}50%{transform:translate(30px,20px)}}
@keyframes float2{0%,100%{transform:translate(0,0)}50%{transform:translate(-20px,30px)}}
@keyframes float3{0%,100%{transform:translate(-50%,-50%)}50%{transform:translate(-40%,-60%)}}
.auth-wrap{display:flex;gap:48px;align-items:center;max-width:1100px;width:100%;position:relative;z-index:1;flex-wrap:nowrap}
.auth-pitch{flex:1;color:#fff}
.auth-pitch-logo{display:flex;align-items:center;gap:12px;margin-bottom:32px}
.auth-pitch-title{font-size:42px;font-weight:900;line-height:1.1;margin:0 0 16px;letter-spacing:-1.5px;background:linear-gradient(135deg,#fff 60%,rgba(255,255,255,0.6));-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.auth-pitch-sub{font-size:16px;color:rgba(255,255,255,0.6);margin:0 0 32px;line-height:1.6}
.auth-features-list{display:flex;flex-direction:column;gap:16px}
.auth-feature-big{display:flex;align-items:flex-start;gap:14px}
.auth-feature-icon{font-size:20px;width:44px;height:44px;background:rgba(255,255,255,0.08);border:1px solid rgba(255,255,255,0.12);border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0;backdrop-filter:blur(4px)}
.auth-feature-title{font-size:14px;font-weight:700;color:#fff;margin-bottom:3px}
.auth-feature-desc{font-size:12px;color:rgba(255,255,255,0.5);line-height:1.5}
.auth-card{width:100%;max-width:400px;background:#fff;border-radius:24px;padding:36px 32px;box-shadow:0 32px 100px rgba(0,0,0,0.5),0 0 0 1px rgba(255,255,255,0.05);flex-shrink:0}
.auth-logo{display:flex;align-items:center;gap:14px;margin-bottom:32px}
.logo-icon{width:48px;height:48px;background:#1c1c1e;border-radius:14px;display:flex;align-items:center;justify-content:center;color:#fff;flex-shrink:0}
.logo-icon.sm{width:30px;height:30px;border-radius:8px}
.logo-name{font-size:22px;font-weight:800;color:#1c1c1e;letter-spacing:-0.6px}
.logo-sub{font-size:12px;color:#8e8e93;margin-top:2px;font-weight:500}
.auth-tabs{display:flex;background:var(--color-bg);border-radius:14px;padding:4px;margin-bottom:28px}
.auth-tab{flex:1;padding:9px;border:none;background:transparent;color:#8e8e93;font-size:14px;font-weight:700;border-radius:8px;cursor:pointer;transition:all 0.2s;font-family:inherit}
.auth-tab.active{background:#fff;color:#1c1c1e;box-shadow:0 1px 6px rgba(0,0,0,0.1)}
.field{margin-bottom:14px}
.field label{display:block;font-size:11px;color:#8e8e93;margin-bottom:6px;font-weight:700;text-transform:uppercase;letter-spacing:0.6px}
.field input,.field select{width:100%;padding:12px 14px;background:var(--color-bg);border:none;border-radius:12px;color:#1c1c1e;font-size:14px;font-family:inherit;font-weight:500;transition:all 0.2s}
.field input:focus,.field select:focus{outline:none;background:#ebebeb}
.auth-field{margin-bottom:14px}
.auth-label{display:block;font-size:12px;font-weight:700;color:#8e8e93;text-transform:uppercase;letter-spacing:0.5px;margin-bottom:6px}
.auth-input{width:100%;padding:13px 14px;border:2px solid #f0f0f0;border-radius:12px;font-size:15px;outline:none;transition:border 0.2s;box-sizing:border-box;font-family:inherit;background:#fafafa}
.auth-input:focus{border-color:#1c1c1e;background:#fff;box-shadow:0 0 0 3px rgba(28,28,30,0.08)}
.auth-divider{display:flex;align-items:center;gap:12px;margin:16px 0;color:#8e8e93;font-size:12px;font-weight:600}
.auth-divider::before,.auth-divider::after{content:'';flex:1;height:1px;background:#f0f0f0}
.auth-terms{font-size:11px;color:#8e8e93;text-align:center;margin-top:12px;line-height:1.5}
.btn-auth{width:100%;padding:14px 20px;background:#1c1c1e;border:none;border-radius:14px;color:#fff;font-size:15px;font-weight:800;cursor:pointer;margin-top:4px;transition:all 0.2s;font-family:inherit;display:flex;align-items:center;justify-content:center;gap:8px}
.btn-auth:hover{background:#000;box-shadow:0 8px 24px rgba(0,0,0,0.2)}
.btn-demo{width:100%;padding:12px;background:var(--color-bg);border:none;border-radius:12px;color:#1c1c1e;font-size:14px;font-weight:700;cursor:pointer;font-family:inherit;transition:all 0.2s}
.btn-demo:hover{background:#e8e8e8}
.auth-msg{margin-top:12px;font-size:13px;text-align:center;min-height:20px;font-weight:600}
.auth-msg.error{color:#ff3b30}.auth-msg.success{color:#34c759}
@media(max-width:700px){.auth-wrap{flex-direction:column;gap:24px}.auth-pitch{text-align:center}.auth-pitch-title{font-size:28px}.auth-features-list{display:none}.auth-card{max-width:100%}}
#app{display:flex;flex-direction:column;min-height:100vh}
.topbar{height:52px;background:rgba(250,250,250,0.92);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border-bottom:1px solid var(--color-border-subtle);display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:0 16px;position:sticky;top:0;z-index:100}
.topbar-left{display:flex;align-items:center;gap:12px}
.topbar-logo{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:800;color:#1c1c1e;letter-spacing:-0.4px}
.menu-btn{background:transparent;border:none;color:#1c1c1e;cursor:pointer;padding:6px;border-radius:8px;display:flex;align-items:center}
.menu-btn:hover{background:var(--color-bg)}
.topbar-right{display:flex;align-items:center;gap:6px;justify-content:flex-end}
.price-ticker{display:flex;align-items:center;gap:8px;padding:4px 12px;background:var(--color-bg);border-radius:99px;justify-content:center}
.notif-btn{position:relative;background:transparent;border:none;cursor:pointer;padding:7px;border-radius:8px;color:#1c1c1e;display:flex;align-items:center}
.notif-btn:hover{background:var(--color-bg)}
.notif-dot{position:absolute;top:5px;right:5px;width:7px;height:7px;background:#ff3b30;border-radius:50%;border:2px solid #fff;display:none}
.notif-dot.show{display:block}
.profile-pill{display:flex;align-items:center;gap:7px;background:var(--color-bg);border-radius:20px;padding:4px 12px 4px 4px;cursor:pointer;transition:background 0.2s}
.profile-pill:hover{background:#ebebeb}
.avatar{width:28px;height:28px;background:#1c1c1e;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800;color:#fff}
#topbar-email{font-size:12px;color:#1c1c1e;font-weight:700;max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar{width:176px;background:var(--color-bg);border-right:1px solid var(--color-border-subtle);position:fixed;top:54px;left:-180px;height:calc(100vh - 54px);overflow-y:auto;overflow-x:hidden;z-index:200;transition:left 0.3s cubic-bezier(0.4,0,0.2,1);display:flex;flex-direction:column;padding:12px 8px}
.sidebar.open{left:0}
.sidebar-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.2);z-index:199;display:none}
.sidebar-overlay.show{display:block}
.sidebar-logo{display:flex;align-items:center;gap:8px;padding:4px 6px 12px;border-bottom:1px solid #f5f5f5;margin-bottom:8px}
.nav-group-label{font-size:10px;font-weight:800;color:#c7c7cc;text-transform:uppercase;letter-spacing:0.8px;padding:8px 8px 3px}
.nav-btn{display:flex;align-items:center;gap:9px;width:100%;height:36px;padding:0 10px;background:transparent;border:none;border-radius:var(--radius-xs);color:var(--color-text-secondary);cursor:pointer;transition:all 0.12s;font-size:12.5px;font-weight:500;font-family:inherit;text-align:left;letter-spacing:-0.01em}
.nav-btn:hover{background:var(--color-bg);color:#1c1c1e}
.nav-btn.active{background:var(--color-bg);color:#1c1c1e;font-weight:700}
.nav-btn svg{flex-shrink:0;width:16px;height:16px;opacity:0.6}
.nav-btn.active svg{opacity:1}
.nav-btn span{font-size:13px;font-weight:600}
.nav-sep{height:1px;background:var(--color-bg);width:100%;margin:4px 0}
.logout-btn{display:flex;align-items:center;gap:9px;margin-top:auto;padding:10px;background:transparent;border:none;border-radius:10px;color:#ff3b30;cursor:pointer;font-family:inherit;font-size:13px;font-weight:700;width:100%}
.logout-btn:hover{background:#fff5f5}
.notif-panel{position:fixed;top:54px;right:0;width:310px;height:calc(100vh - 54px);background:#fff;border-left:1px solid #ebebeb;z-index:300;transform:translateX(100%);transition:transform 0.3s cubic-bezier(0.4,0,0.2,1);overflow-y:auto;padding:18px 14px;box-shadow:-4px 0 20px rgba(0,0,0,0.06)}
.notif-panel.open{transform:translateX(0)}
.notif-panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.notif-panel-title{font-size:18px;font-weight:800;color:#1c1c1e;letter-spacing:-0.4px}
.notif-close{background:var(--color-bg);border:none;cursor:pointer;color:#8e8e93;font-size:17px;padding:5px 10px;border-radius:8px;line-height:1;font-weight:800}
.notif-item{background:var(--color-bg);border-radius:14px;padding:12px 14px;margin-bottom:8px;border-left:3px solid}
.notif-item.high{border-left-color:#ff3b30}.notif-item.medium{border-left-color:#ff9500}.notif-item.low{border-left-color:#34c759}
.notif-item-title{font-size:13px;font-weight:800;color:#1c1c1e;margin-bottom:4px}
.notif-item-text{font-size:12px;color:#8e8e93;line-height:1.4;font-weight:500}
.notif-item-action{font-size:12px;color:#1c1c1e;font-weight:700;margin-top:7px;background:#fff;border:none;border-radius:8px;padding:4px 10px;cursor:pointer;font-family:inherit;display:inline-block}
.notif-item-time{font-size:11px;color:#c7c7cc;margin-top:5px;font-weight:500}
.notif-empty{text-align:center;color:#8e8e93;font-size:14px;padding:36px 20px;font-weight:500}
.main{flex:1;padding:24px 20px;width:100%;display:flex;flex-direction:column;gap:0}
.sec{display:none}.sec.active{display:block}
.page-header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:24px;gap:12px}
.page-header h1{font-size:26px;font-weight:900;color:var(--color-text);letter-spacing:var(--tracking-tighter);line-height:1.1}
.page-sub{font-size:13px;color:var(--color-text-secondary);margin-top:4px;font-weight:400;letter-spacing:-0.01em}
.card{background:#fff;border-radius:20px;padding:18px;margin-bottom:12px;box-shadow:0 1px 3px rgba(0,0,0,0.06),0 1px 2px rgba(0,0,0,0.04),0 1px 2px rgba(0,0,0,0.04)}
.card-head{margin-bottom:14px}
.card-title{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:800;color:#1c1c1e;letter-spacing:-0.2px}
.card-icon{width:24px;height:24px;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.card-icon svg{width:14px;height:14px}
.card-icon.green{background:#e8f8f0;color:#1a7f5a}
.card-icon.blue{background:#e8f0fe;color:#1a56db}
.card-icon.dark{background:#1c1c1e;color:#fff}
.card-icon.amber{background:#fff5e0;color:#cc7a00}
.card-icon.red{background:#fff0f0;color:#cc2f26}
.cards-row{display:grid;grid-template-columns:1fr;gap:12px}
.metrics-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:14px}
.metric-card{background:#fff;border-radius:16px;padding:16px;box-shadow:0 1px 3px rgba(0,0,0,0.06),0 1px 2px rgba(0,0,0,0.04),0 1px 2px rgba(0,0,0,0.04)}
.metric-label{font-size:10px;color:var(--color-text-tertiary);font-weight:500;text-transform:uppercase;letter-spacing:0.8px;margin-bottom:8px}
.metric-val{font-size:22px;font-weight:800;color:var(--color-text);letter-spacing:var(--tracking-tight);line-height:1.1}
.metric-val.green{color:#1a7f5a}.metric-val.red{color:#cc2f26}.metric-val.blue{color:#1c1c1e}
.metric-trend{font-size:11px;color:#8e8e93;margin-top:5px;font-weight:500}
.pos-grid{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.pos-card{background:#fff;border-radius:20px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,0.06),0 1px 2px rgba(0,0,0,0.04),0 1px 2px rgba(0,0,0,0.04);transition:box-shadow 0.2s}
.pos-card:hover{box-shadow:var(--shadow-md);border-color:var(--color-border-strong)}
.pos-card-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;cursor:pointer}
.pos-card-left{display:flex;align-items:center;gap:12px}
.pos-avatar{width:40px;height:40px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:800;color:#fff;flex-shrink:0}
.pos-name{font-size:15px;font-weight:800;color:#1c1c1e;letter-spacing:-0.2px;display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.pos-meta{font-size:11px;color:#8e8e93;margin-top:2px;font-weight:600;display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.pos-card-right{text-align:right;flex-shrink:0}
.pos-val{font-size:15px;font-weight:800;color:#1c1c1e}
.pos-pnl{font-size:12px;font-weight:700;margin-top:2px}
.pos-pnl.green{color:#1a7f5a}.pos-pnl.red{color:#cc2f26}
.pos-signal-row{padding:0 14px 14px;display:none}
.pos-signal-content{background:var(--color-bg);border-radius:14px;padding:13px}
.signal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;flex-wrap:wrap;gap:7px}
.signal-badge-large{display:inline-flex;align-items:center;gap:5px;padding:6px 14px;border-radius:99px;font-size:13px;font-weight:800}
.sig-buy{background:#e8f8f0;color:#1a7f5a}.sig-hold{background:#fff5e0;color:#cc7a00}.sig-sell{background:#fff0f0;color:#cc2f26}.sig-loading{background:var(--color-bg);color:#8e8e93}
.signal-text{font-size:13px;color:#3c3c43;line-height:1.5;font-weight:500}
.perf-bar-wrap{margin-top:9px}
.perf-bar-label{display:flex;justify-content:space-between;font-size:11px;color:#8e8e93;margin-bottom:4px;font-weight:600}
.perf-bar-bg{height:4px;background:#e5e5ea;border-radius:99px;overflow:hidden}
.perf-bar-fill{height:100%;border-radius:99px;transition:width 0.6s}
.pos-actions{display:flex;gap:7px;margin-top:10px;flex-wrap:wrap}
.pill{display:inline-flex;align-items:center;padding:3px 10px;border-radius:99px;font-size:11px;font-weight:700}
.pill-green{background:#e8f8f0;color:#1a7f5a}.pill-red{background:#fff0f0;color:#cc2f26}.pill-blue{background:#e8f0fe;color:#1a56db}.pill-dark{background:#1c1c1e;color:#fff}.pill-amber{background:#fff5e0;color:#cc7a00}.pill-gray{background:var(--color-bg);color:#8e8e93}
.btn-add{display:flex;align-items:center;gap:6px;padding:9px 16px;background:var(--color-primary);border:none;border-radius:var(--radius-sm);color:#fff;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;letter-spacing:-0.01em;transition:all 0.15s;white-space:nowrap}
.btn-add:hover{opacity:0.8}
.btn-primary{padding:11px 20px;background:var(--color-primary);border:none;border-radius:var(--radius-sm);color:#fff;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;letter-spacing:-0.01em;transition:all 0.15s}
.btn-primary:hover{background:var(--color-primary-hover);opacity:0.92}
.btn-secondary{padding:12px 20px;background:var(--color-bg);border:none;border-radius:12px;color:#1c1c1e;font-size:14px;font-weight:600;cursor:pointer;font-family:inherit}
.btn-secondary:hover{background:var(--color-bg-subtle);border-color:var(--color-text-tertiary)}
.btn-save{padding:12px 20px;background:var(--color-bg);border:none;border-radius:12px;color:#1c1c1e;font-size:14px;font-weight:700;cursor:pointer;font-family:inherit}
.btn-save:hover{background:#ebebeb}
.btn-danger{padding:10px 16px;background:#fff0f0;border:none;border-radius:10px;color:#cc2f26;font-size:13px;cursor:pointer;font-family:inherit;font-weight:700}
.btn-refresh{display:flex;align-items:center;gap:6px;padding:9px 14px;background:var(--color-bg);border:none;border-radius:10px;color:#1c1c1e;font-size:13px;cursor:pointer;font-family:inherit;font-weight:600;white-space:nowrap}
.btn-refresh:hover{background:#ebebeb}
.btn-row{display:flex;gap:8px;flex-wrap:wrap}
.btn-del{padding:5px 10px;background:#fff0f0;border:none;border-radius:8px;color:#cc2f26;font-size:12px;cursor:pointer;font-family:inherit;font-weight:700}
.btn-sm{padding:7px 14px;background:var(--color-bg);border:none;border-radius:8px;color:#1c1c1e;font-size:12px;font-weight:700;cursor:pointer;font-family:inherit}
.btn-sm:hover{background:#ebebeb}
.btn-sm.buy{background:#e8f8f0;color:#1a7f5a}.btn-sm.sell{background:#fff0f0;color:#cc2f26}
.btn-analyse{padding:9px 16px;background:#1c1c1e;border:none;border-radius:10px;color:#fff;font-size:13px;font-weight:700;cursor:pointer;font-family:inherit}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px}
.form-grid.three{grid-template-columns:1fr 1fr 1fr}
.field-hint{font-size:11px;color:#8e8e93;font-weight:500}
input,select{width:100%;padding:12px 14px;background:var(--color-bg);border:none;border-radius:12px;color:#1c1c1e;font-size:14px;font-family:inherit;font-weight:500;transition:all 0.2s}
input:focus,select:focus{outline:none;background:#ebebeb}
.bar-row{margin-bottom:10px}
.bar-label{display:flex;justify-content:space-between;font-size:12px;color:#8e8e93;margin-bottom:4px;font-weight:600}
.bar-bg{height:5px;background:#f0f0f0;border-radius:99px;overflow:hidden}
.bar-fill{height:100%;border-radius:99px;transition:width 0.5s}
.score-wrap{display:flex;align-items:center;gap:18px;margin-bottom:14px}
.score-ring{width:78px;height:78px;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;flex-shrink:0;border:3px solid}
.score-num{font-size:24px;font-weight:800}
.score-max{font-size:11px;opacity:0.6;font-weight:600}
.score-items{flex:1}
.score-row{display:flex;align-items:center;gap:8px;padding:5px 0;border-bottom:1px solid #f5f5f5;font-size:12px}
.score-row:last-child{border-bottom:none}
.score-row-label{min-width:120px;color:#8e8e93;font-weight:600}
.score-bar-bg{flex:1;height:4px;background:#e5e5ea;border-radius:99px;overflow:hidden}
.score-bar-fill{height:100%;border-radius:99px}
.score-val{min-width:26px;text-align:right;font-weight:800}
.alert{display:flex;gap:9px;align-items:flex-start;padding:11px 14px;border-radius:12px;font-size:13px;line-height:1.5;margin-bottom:8px;font-weight:600}
.alert-ok{background:var(--color-green-light);color:#166534;border:1px solid var(--color-green-border)}.alert-warn{background:var(--color-amber-light);color:#92400e;border:1px solid var(--color-amber-border)}.alert-err{background:var(--color-red-light);color:#991b1b;border:1px solid var(--color-red-border)}.alert-info{background:#e8f0fe;color:#1a4ba3}
.crisis-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-bottom:14px}
.crisis-card{border-radius:16px;padding:16px;text-align:center}
.crisis-pct{font-size:20px;font-weight:800;margin-bottom:4px}
.crisis-val{font-size:14px;font-weight:800;margin-bottom:3px;letter-spacing:-0.3px}
.crisis-sub{font-size:11px;opacity:0.65;font-weight:600}
.obj-bar-bg{height:8px;background:#e5e5ea;border-radius:99px;overflow:hidden;margin:10px 0 7px}
.obj-bar-fill{height:100%;background:#1c1c1e;border-radius:99px;transition:width 0.6s}
.filter-row{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:14px}
.filter-pill{padding:6px 14px;border-radius:var(--radius-pill);border:1px solid var(--color-border);background:var(--color-surface);color:var(--color-text-secondary);font-size:12px;font-weight:500;cursor:pointer;font-family:inherit;transition:all 0.15s;letter-spacing:-0.01em}
.filter-pill.active{background:var(--color-primary);color:#fff;border-color:var(--color-primary)}
.filter-pill:hover:not(.active){background:#ebebeb;color:#1c1c1e}
.news-item{background:#fff;border-radius:20px;margin-bottom:9px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,0.06),0 1px 2px rgba(0,0,0,0.04),0 1px 2px rgba(0,0,0,0.04)}
.news-item-head{padding:16px;cursor:pointer}
.news-item-head:hover{background:#fafafa}
.news-meta{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:7px;align-items:center}
.news-time{font-size:11px;color:#c7c7cc;font-weight:600}
.news-title{font-size:15px;font-weight:800;color:#1c1c1e;line-height:1.3;margin-bottom:4px;letter-spacing:-0.3px}
.news-summary{font-size:13px;color:#8e8e93;line-height:1.5;font-weight:500}
.news-expand{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:#8e8e93;background:transparent;border:none;cursor:pointer;font-family:inherit;margin-top:6px;font-weight:700}
.news-reco{display:none;padding:14px 16px;border-top:1px solid #f5f5f5;background:#fafafa}
.news-reco.open{display:block}
.signal-badge{display:inline-flex;align-items:center;gap:5px;padding:6px 14px;border-radius:99px;font-size:13px;font-weight:800;margin-bottom:10px}
.signal-buy{background:#e8f8f0;color:#1a7f5a}.signal-wait{background:#fff5e0;color:#cc7a00}.signal-avoid{background:#fff0f0;color:#cc2f26}.signal-neutral{background:var(--color-bg);color:#8e8e93}
.news-reco-text{font-size:13px;color:#3c3c43;line-height:1.6;margin-bottom:12px;font-weight:500}
.opp-strip{display:flex;align-items:center;justify-content:space-between;gap:10px;border-radius:12px;padding:12px 14px;flex-wrap:wrap;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,0.06),0 1px 2px rgba(0,0,0,0.04)}
.opp-label{font-size:13px;font-weight:800;color:#1c1c1e}
.opp-sub{font-size:11px;color:#8e8e93;margin-top:2px;font-weight:600}
.opp-amount{font-size:20px;font-weight:800;color:#1c1c1e;letter-spacing:-0.5px}
.prefill-notice{background:var(--color-bg);border-radius:12px;padding:11px 14px;font-size:13px;color:#1c1c1e;margin-bottom:14px;font-weight:700;border-left:3px solid #1c1c1e}
.slider{width:100%;-webkit-appearance:none;appearance:none;height:6px;border-radius:99px;background:#e5e5ea;outline:none;margin:12px 0;cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-user-drag:none}
.slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:22px;height:22px;border-radius:50%;background:#1c1c1e;cursor:grab;border:3px solid #fff;box-shadow:0 1px 5px rgba(0,0,0,0.25)}
.slider::-webkit-slider-thumb:active{cursor:grabbing}
.slider::-moz-range-thumb{width:22px;height:22px;border-radius:50%;background:#1c1c1e;cursor:grab;border:3px solid #fff;box-shadow:0 1px 5px rgba(0,0,0,0.25)}
.slider::-moz-range-track{height:6px;border-radius:99px;background:#e5e5ea}
.slider-labels{display:flex;justify-content:space-between;font-size:11px;color:#c7c7cc;font-weight:600}
.chat-card{display:flex;flex-direction:column;gap:12px}
.chat-messages{display:flex;flex-direction:column;gap:9px;max-height:300px;overflow-y:auto}
.bubble{padding:12px 15px;border-radius:16px;font-size:14px;line-height:1.6;max-width:88%;white-space:normal;word-break:break-word;font-weight:500}
.bubble.bot{background:var(--color-bg);color:#1c1c1e}
.bubble.user{background:#1c1c1e;color:#fff;align-self:flex-end}
.quick-questions{display:flex;flex-wrap:wrap;gap:7px}
.quick-questions button{padding:7px 14px;background:var(--color-bg);border:none;border-radius:99px;color:#1c1c1e;font-size:12px;cursor:pointer;font-family:inherit;font-weight:600}
.quick-questions button:hover{background:#ebebeb}
.chat-input-row{display:flex;gap:7px}
.chat-input-row input{flex:1}
.chat-input-row button{padding:11px 15px;background:#1c1c1e;border:none;border-radius:12px;color:#fff;cursor:pointer;display:flex;align-items:center}
.slider-group{display:flex;flex-direction:column;gap:4px;margin-bottom:14px}
.slider-row{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid #f5f5f5}
.slider-row:last-child{border-bottom:none}
.slider-row label{min-width:140px;font-size:13px;color:#8e8e93;flex-shrink:0;font-weight:600}
.slider-row input{flex:1}
.slider-row span{min-width:60px;text-align:right;font-size:14px;font-weight:800;color:#1c1c1e;letter-spacing:-0.3px}
.dca-result{background:var(--color-bg);border-radius:16px;padding:16px}
.tips-list{display:flex;flex-direction:column;gap:12px}
.tip-item{display:flex;gap:11px;font-size:13px;color:#8e8e93;line-height:1.5;font-weight:500}
.tip-num{width:24px;height:24px;border-radius:50%;background:#1c1c1e;color:#fff;font-size:12px;font-weight:800;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.tip-item strong{color:#1c1c1e;font-weight:800}
.empty-state{text-align:center;padding:44px 20px;color:#8e8e93}
.empty-icon{font-size:36px;margin-bottom:10px}
.empty-state div{font-size:15px;font-weight:600}
.btn-link{background:transparent;border:none;color:#1c1c1e;font-size:14px;cursor:pointer;font-family:inherit;margin-top:10px;font-weight:800;display:block;text-decoration:underline}
@keyframes spin{to{transform:rotate(360deg)}}
.spinning{animation:spin 1s linear infinite}
.sec{transition:opacity 0.2s ease,transform 0.2s ease}
.search-wrap{position:relative;margin-bottom:4px}
.search-box{display:flex;align-items:center;gap:10px;background:#fff;border-radius:14px;padding:12px 16px;box-shadow:0 1px 4px rgba(0,0,0,0.06)}
.search-box svg{flex-shrink:0;color:#8e8e93}
.search-box input{flex:1;border:none;background:transparent;font-size:15px;color:#1c1c1e;font-family:inherit;font-weight:500;outline:none}
.search-box input::placeholder{color:#c7c7cc}
.search-drop{position:absolute;top:calc(100% + 6px);left:0;right:0;background:#fff;border-radius:14px;box-shadow:0 4px 20px rgba(0,0,0,0.12);z-index:50;overflow:hidden}
.search-result-item{display:flex;align-items:center;gap:10px;padding:12px 16px;cursor:pointer;transition:background 0.12s}
.search-result-item:hover{background:var(--color-bg)}
.sr-avatar{width:36px;height:36px;border-radius:10px;background:#1c1c1e;color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;flex-shrink:0}
.sr-name{font-size:14px;font-weight:700;color:#1c1c1e}
.sr-ticker{font-size:12px;color:#8e8e93;font-weight:500}
.watchlist-strip{display:flex;gap:8px;overflow-x:auto;padding:4px 0 10px;scrollbar-width:none;-webkit-overflow-scrolling:touch;scroll-snap-type:x mandatory}
.watchlist-strip::-webkit-scrollbar{display:none}
.watchlist-chip{scroll-snap-align:start;flex-shrink:0;display:flex;align-items:center;gap:8px;padding:8px 12px;background:#fff;border-radius:12px;box-shadow:0 1px 3px rgba(0,0,0,0.06),0 1px 2px rgba(0,0,0,0.04),0 1px 2px rgba(0,0,0,0.04);cursor:pointer;transition:box-shadow 0.2s;min-width:100px}
.watchlist-chip:hover{box-shadow:0 3px 10px rgba(0,0,0,0.1)}
.watchlist-chip.in-portfolio{border:2px solid #1c1c1e}
.wchip-avatar{width:32px;height:32px;border-radius:8px;background:#1c1c1e;color:#fff;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800;flex-shrink:0}
.wchip-name{font-size:13px;font-weight:800;color:#1c1c1e}
.wchip-sector{font-size:11px;color:#8e8e93;font-weight:500}
.wchip-badge{font-size:10px;font-weight:800;background:#1c1c1e;color:#fff;padding:2px 7px;border-radius:99px;margin-left:auto}
.wchip-remove{background:transparent;border:none;color:#c7c7cc;font-size:16px;cursor:pointer;margin-left:auto;padding:0;line-height:1}
.wchip-remove:hover{color:#ff3b30}
.popular-section{margin-bottom:20px}
.popular-title{font-size:13px;font-weight:700;color:#8e8e93;margin-bottom:10px;text-transform:uppercase;letter-spacing:0.5px}
.popular-grid{display:flex;flex-direction:column;gap:6px}
.popular-chip{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:#fff;border-radius:14px;box-shadow:0 1px 3px rgba(0,0,0,0.06),0 1px 2px rgba(0,0,0,0.04),0 1px 2px rgba(0,0,0,0.04);cursor:pointer;transition:box-shadow 0.2s}
.popular-chip:hover{box-shadow:0 4px 12px rgba(0,0,0,0.1),0 2px 4px rgba(0,0,0,0.06)}
.popular-left{display:flex;align-items:center;gap:10px}
.popular-avatar{width:38px;height:38px;border-radius:10px;background:var(--color-bg);color:#1c1c1e;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;flex-shrink:0}
.popular-name{font-size:14px;font-weight:700;color:#1c1c1e}
.popular-ticker{font-size:12px;color:#8e8e93;font-weight:500}
.btn-follow{padding:7px 14px;background:var(--color-bg);border:none;border-radius:99px;color:#1c1c1e;font-size:12px;font-weight:700;cursor:pointer;font-family:inherit;transition:all 0.15s;white-space:nowrap}
.btn-follow:hover{background:#ebebeb}
.btn-follow.following{background:#1c1c1e;color:#fff}
.btn-follow.sm{padding:5px 10px;font-size:13px}
.pill-count{background:#1c1c1e;color:#fff;border-radius:99px;padding:1px 7px;font-size:11px;font-weight:800;margin-left:4px}
.empty-news-msg{text-align:center;padding:40px 20px;color:#8e8e93}
.auth-tagline{display:none}
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.5);z-index:1000;display:flex;align-items:center;justify-content:center;padding:20px;backdrop-filter:blur(4px)}
.modal-card{background:#fff;border-radius:24px;padding:32px;width:100%;max-width:420px;box-shadow:0 8px 40px rgba(0,0,0,0.15)}
.onboard-step{text-align:center}
.ob-icon{font-size:48px;margin-bottom:16px}
.ob-title{font-size:22px;font-weight:800;color:#1c1c1e;letter-spacing:-0.5px;margin-bottom:10px}
.ob-text{font-size:14px;color:#8e8e93;line-height:1.6;font-weight:500;margin-bottom:20px}
.ob-progress{display:flex;gap:6px;justify-content:center;margin:20px 0}
.ob-dot{width:8px;height:8px;border-radius:50%;background:#e5e5ea}
.ob-dot.active{background:#1c1c1e;width:24px;border-radius:99px}
.ob-choices{display:flex;flex-direction:column;gap:8px;margin-bottom:20px;text-align:left}
.ob-choice{display:flex;align-items:center;gap:12px;padding:14px;background:var(--color-bg);border-radius:14px;cursor:pointer;transition:background 0.15s;font-size:14px;font-weight:600;color:#1c1c1e}
.ob-choice:hover{background:#ebebeb}
.ob-choice-icon{font-size:24px;flex-shrink:0}
.tooltip-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;background:#e5e5ea;color:#8e8e93;border-radius:50%;font-size:10px;font-weight:800;cursor:help;position:relative}
.tooltip-icon:hover::after{content:attr(data-tip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);background:#1c1c1e;color:#fff;padding:6px 10px;border-radius:8px;font-size:11px;font-weight:500;white-space:nowrap;z-index:100;pointer-events:none;max-width:200px;white-space:normal;text-align:center}
.empty-home{text-align:center;padding:20px 0}
.empty-home-icon{font-size:40px;margin-bottom:12px}
.empty-home-title{font-size:16px;font-weight:800;color:#1c1c1e;margin-bottom:6px}
.empty-home-sub{font-size:13px;color:#8e8e93;margin-bottom:18px;font-weight:500}
.empty-home-actions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
.bubble.bot strong{color:#1c1c1e;font-weight:800}
.bubble.bot em{color:#3c3c43;font-style:italic}
.port-tabs{display:flex;gap:4px;background:var(--color-bg);border-radius:12px;padding:4px;margin-bottom:14px}
.port-tab{flex:1;padding:8px;border:none;background:transparent;color:#8e8e93;font-size:13px;font-weight:700;border-radius:8px;cursor:pointer;font-family:inherit;transition:all 0.15s}
.port-tab.active{background:#fff;color:#1c1c1e;box-shadow:0 1px 4px rgba(0,0,0,0.08)}
.tx-item{display:flex;align-items:center;justify-content:space-between;padding:12px 0;border-bottom:1px solid #f5f5f5}
.tx-item:last-child{border-bottom:none}
.tx-left{display:flex;align-items:center;gap:10px}
.tx-avatar{width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800;color:#fff;flex-shrink:0}
.tx-name{font-size:14px;font-weight:700;color:#1c1c1e;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.tx-meta{font-size:12px;color:#8e8e93;margin-top:2px;font-weight:500}
.tx-notes{font-size:11px;color:#c7c7cc;margin-top:2px;font-style:italic}
.tx-total{font-size:15px;font-weight:800;letter-spacing:-0.3px;flex-shrink:0}
.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);background:rgba(9,9,11,0.92);backdrop-filter:blur(16px);color:#fff;padding:10px 18px;border-radius:var(--radius-pill);font-size:13px;font-weight:500;letter-spacing:-0.01em;z-index:9999;opacity:0;transition:all 0.25s cubic-bezier(0.16,1,0.3,1);white-space:nowrap;border:1px solid rgba(255,255,255,0.1);box-shadow:var(--shadow-lg)}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.ac-wrap{position:relative}
.ac-box{display:flex;align-items:center;gap:10px;background:var(--color-bg);border-radius:12px;padding:13px 16px;transition:background 0.2s}
.ac-box:focus-within{background:#ebebeb}
.ac-box input{flex:1;border:none;background:transparent;font-size:15px;color:#1c1c1e;font-family:inherit;font-weight:500;outline:none}
.ac-box input::placeholder{color:#c7c7cc}
.ac-drop{position:absolute;top:calc(100% + 6px);left:0;right:0;background:#fff;border-radius:16px;box-shadow:0 4px 24px rgba(0,0,0,0.12);z-index:50;overflow:hidden;border:1px solid #f0f0f0}
.ac-item{display:flex;align-items:center;gap:12px;padding:12px 16px;cursor:pointer;transition:background 0.12s}
.ac-item:hover{background:#f9f9f9}
.ac-item-avatar{width:40px;height:40px;border-radius:10px;background:#1c1c1e;color:#fff;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:800;flex-shrink:0}
.ac-item-avatar.etf{background:#1a7f5a}
.ac-item-info{flex:1;min-width:0}
.ac-item-name{font-size:14px;font-weight:700;color:#1c1c1e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ac-item-meta{font-size:12px;color:#8e8e93;font-weight:500;margin-top:1px}
.ac-item-type{font-size:11px;font-weight:800;padding:3px 10px;border-radius:99px;background:var(--color-bg);color:#8e8e93;flex-shrink:0}
.ac-item-type.etf{background:#e8f8f0;color:#1a7f5a}
.ac-no-result{padding:16px;text-align:center}
.ac-manual-btn{margin-top:8px;padding:7px 14px;background:var(--color-bg);border:none;border-radius:10px;color:#1c1c1e;font-size:13px;font-weight:700;cursor:pointer;font-family:inherit}
.ac-manual-btn:hover{background:#ebebeb}
.ac-selected-badge{display:flex;align-items:center;justify-content:space-between;background:var(--color-bg);border-radius:14px;padding:12px 14px;margin-bottom:16px}
.ac-live-badge{font-size:10px;font-weight:800;background:#e8f8f0;color:#1a7f5a;padding:2px 7px;border-radius:99px;margin-left:6px}
.obj-wizard{display:flex;flex-direction:column;gap:14px}
.obj-step{background:#fff;border-radius:20px;padding:24px;box-shadow:0 2px 8px rgba(0,0,0,0.08),0 1px 3px rgba(0,0,0,0.05)}
.obj-step-header{display:flex;align-items:center;gap:14px;margin-bottom:20px}
.obj-step-num{width:36px;height:36px;border-radius:50%;background:#1c1c1e;color:#fff;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:800;flex-shrink:0}
.obj-step-title{font-size:17px;font-weight:800;color:#1c1c1e;letter-spacing:-0.3px}
.obj-step-sub{font-size:13px;color:#8e8e93;font-weight:500;margin-top:2px}
.risk-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.risk-card{background:var(--color-bg);border-radius:16px;padding:18px 14px;cursor:pointer;text-align:center;transition:all 0.2s;border:2px solid transparent}
.risk-card:hover{background:#ebebeb}
.risk-card.active{background:#fff;border-color:#1c1c1e;box-shadow:0 2px 12px rgba(0,0,0,0.1)}
.risk-card-icon{font-size:28px;margin-bottom:8px}
.risk-card-title{font-size:15px;font-weight:800;color:#1c1c1e;margin-bottom:4px;letter-spacing:-0.2px}
.risk-card-desc{font-size:12px;color:#8e8e93;font-weight:600;margin-bottom:4px}
.risk-card-detail{font-size:11px;color:#c7c7cc;font-weight:500}
.obj-progress-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:4px}
.obj-track-badge{padding:8px 16px;border-radius:99px;font-size:13px;font-weight:800;flex-shrink:0}
.obj-track-badge.on-track{background:rgba(74,222,128,0.2);color:#4ade80}
.obj-track-badge.off-track{background:rgba(251,191,36,0.2);color:#fbbf24}
.obj-simple-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-bottom:16px}
.obj-input-wrap{position:relative;display:flex;align-items:center}
.obj-input-wrap input{padding-right:60px;font-size:18px;font-weight:800;color:#1c1c1e}
.obj-unit{position:absolute;right:14px;font-size:13px;font-weight:700;color:#8e8e93;pointer-events:none;white-space:nowrap}
.risk-pills{display:flex;gap:8px;flex-wrap:wrap}
.risk-pill{flex:1;padding:12px 8px;background:var(--color-bg);border:2px solid transparent;border-radius:14px;cursor:pointer;font-family:inherit;font-size:14px;font-weight:700;color:#8e8e93;display:flex;flex-direction:column;align-items:center;gap:3px;transition:all 0.2s;min-width:90px}
.risk-pill span{font-size:11px;font-weight:600;color:#c7c7cc}
.risk-pill:hover{background:#ebebeb;color:#1c1c1e}
.risk-pill.active{background:#fff;border-color:#1c1c1e;color:#1c1c1e;box-shadow:0 2px 10px rgba(0,0,0,0.08)}
.risk-pill.active span{color:#8e8e93}
.btn-obj-generate{width:100%;padding:16px;background:#1c1c1e;border:none;border-radius:16px;color:#fff;font-size:16px;font-weight:800;cursor:pointer;font-family:inherit;display:flex;align-items:center;justify-content:center;gap:10px;transition:opacity 0.2s;letter-spacing:-0.3px;margin-top:8px}
.btn-obj-generate:hover{opacity:0.85}
.obj-summary-card{background:linear-gradient(135deg,#1c1c1e 0%,#2c2c2e 100%);color:#fff}
.obj-summary-card .obj-track-badge.on-track{background:rgba(255,255,255,0.15);color:#fff}
.obj-summary-card .obj-track-badge.off-track{background:rgba(255,165,0,0.2);color:#ffa500}
.obj-summary-card .obj-bar-bg{background:rgba(255,255,255,0.15)}
.obj-summary-card .obj-bar-fill{background:#fff}
.obj-wizard-progress{display:flex;align-items:center;margin-bottom:24px;padding:0 8px}
.obj-wp-step{display:flex;flex-direction:column;align-items:center;gap:4px}
.obj-wp-num{width:36px;height:36px;border-radius:50%;background:#e5e5ea;color:#8e8e93;display:flex;align-items:center;justify-content:center;font-size:15px;font-weight:800;transition:all 0.3s}
.obj-wp-label{font-size:11px;font-weight:700;color:#8e8e93;transition:all 0.3s}
.obj-wp-step.active .obj-wp-num{background:#1c1c1e;color:#fff}
.obj-wp-step.active .obj-wp-label{color:#1c1c1e}
.obj-wp-step.done .obj-wp-num{background:#1a7f5a;color:#fff}
.obj-wp-line{flex:1;height:2px;background:#e5e5ea;margin:0 8px;margin-bottom:20px}
.obj-step-card{background:#fff;border-radius:20px;padding:32px;box-shadow:0 2px 8px rgba(0,0,0,0.08),0 1px 3px rgba(0,0,0,0.05);text-align:center}
.obj-step-emoji{font-size:52px;margin-bottom:14px}
.obj-step-icon{width:60px;height:60px;border-radius:18px;margin:0 auto 14px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#0f172a,#1e293b);color:#4ade80;box-shadow:0 10px 26px rgba(15,23,42,0.2)}
.obj-step-kicker{font-size:11px;font-weight:800;color:#16a34a;text-transform:uppercase;letter-spacing:.1em;margin-bottom:8px}
.risk-card-icon{width:44px;height:44px;border-radius:14px;margin:0 auto 10px;display:flex;align-items:center;justify-content:center;font-size:0}
.risk-card.active{box-shadow:0 8px 24px rgba(0,0,0,0.12)}
.obj-step-h2{font-size:24px;font-weight:800;color:#1c1c1e;letter-spacing:-0.6px;margin-bottom:8px}
.obj-step-p{font-size:15px;color:#8e8e93;font-weight:500;margin-bottom:4px}
.obj-step-card .form-grid{text-align:left}
.obj-step-card .field{text-align:left}
.obj-step-btns{display:flex;gap:10px;justify-content:center}
.btn-obj-next{padding:14px 32px;background:#1c1c1e;border:none;border-radius:14px;color:#fff;font-size:15px;font-weight:800;cursor:pointer;font-family:inherit;transition:opacity 0.2s}
.btn-obj-next:hover{opacity:0.8}
.obj-result-hero{background:#1c1c1e;color:#fff;border-radius:20px}
.obj-result-hero .obj-bar-bg{background:rgba(255,255,255,0.15)}
.obj-result-hero .obj-bar-fill{background:#fff}
.obj-result-hero .obj-track-badge.on-track{background:rgba(255,255,255,0.15);color:#fff}
.obj-result-hero .obj-track-badge.off-track{background:rgba(255,165,0,0.2);color:#ffd700}
.obj-chart-card{background:linear-gradient(145deg,#1a1a2e 0%,#16213e 50%,#0f3460 100%);border-radius:20px;padding:24px;color:#fff;overflow:hidden}
.obj-chart-header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:20px;flex-wrap:wrap;gap:12px}
.obj-chart-amount{font-size:40px;font-weight:800;color:#fff;letter-spacing:-1.5px;line-height:1;transition:all 0.3s}
.obj-chart-label{font-size:14px;color:rgba(255,255,255,0.6);font-weight:500;margin-top:4px;transition:all 0.3s}
.obj-chart-wrap{height:160px;position:relative;margin:0 -4px}
.obj-slider-wrap{margin-top:12px}
.obj-slider{width:100%;-webkit-appearance:none;height:3px;border-radius:99px;background:rgba(255,255,255,0.2);outline:none;cursor:pointer}
.obj-slider::-webkit-slider-thumb{-webkit-appearance:none;width:22px;height:22px;border-radius:50%;background:#fff;cursor:pointer;border:3px solid rgba(255,255,255,0.3);box-shadow:0 2px 8px rgba(0,0,0,0.3);transition:transform 0.15s}
.obj-slider::-webkit-slider-thumb:hover{transform:scale(1.2)}
.obj-slider-labels{display:flex;justify-content:space-between;font-size:11px;color:rgba(255,255,255,0.5);margin-top:6px;font-weight:600}
.obj-real-progress{display:flex;align-items:center;gap:12px;margin-top:20px;padding-top:16px;border-top:1px solid rgba(255,255,255,0.1)}
.obj-real-label{font-size:10px;color:rgba(255,255,255,0.5);font-weight:700;text-transform:uppercase;letter-spacing:0.5px;margin-bottom:3px}
.obj-real-val{font-size:15px;font-weight:800;color:#fff}
.obj-real-bar-wrap{flex:1;display:flex;align-items:center;gap:8px}
.obj-real-bar-bg{flex:1;height:6px;background:rgba(255,255,255,0.15);border-radius:99px;position:relative;overflow:visible}
.obj-real-bar-fill{height:100%;background:#4ade80;border-radius:99px;transition:width 0.8s cubic-bezier(0.4,0,0.2,1)}
.obj-real-bar-marker{position:absolute;top:50%;transform:translate(-50%,-50%);width:14px;height:14px;background:#fff;border-radius:50%;border:3px solid #4ade80;transition:left 0.8s cubic-bezier(0.4,0,0.2,1);z-index:2}
.obj-real-pct{font-size:13px;font-weight:800;color:rgba(255,255,255,0.7);min-width:40px}
.obj-real-left,.obj-real-right{flex-shrink:0;min-width:60px}
.obj-real-right{text-align:right}
.btn-obj-validate{padding:14px 32px;background:#1c1c1e;border:none;border-radius:14px;color:#fff;font-size:15px;font-weight:800;cursor:pointer;font-family:inherit;transition:all 0.2s;letter-spacing:-0.2px}
.btn-obj-validate:hover{background:#1a7f5a;box-shadow:0 6px 20px rgba(26,127,90,0.3)}
.btn-obj-validate:disabled{opacity:0.8;cursor:default;transform:none}
.d-intent-btn{padding:10px 16px;border-radius:12px;border:2px solid #e5e5ea;background:#fff;font-size:13px;font-weight:600;color:#3c3c43;cursor:pointer;transition:all 0.2s}
.d-intent-btn:hover{border-color:#1c1c1e}
.d-intent-btn.active{background:#1c1c1e;border-color:#1c1c1e;color:#fff}
.d-intent-icon{transition:stroke 0.2s ease,opacity 0.2s ease;opacity:0.85}
.d-intent-btn:hover .d-intent-icon{opacity:1}
.d-intent-btn.active .d-intent-icon{stroke:#fff !important;opacity:1}
.ob-prog-bar{flex:1;height:4px;border-radius:2px;background:#e5e5ea;transition:background 0.3s}
.ob-prog-bar.active{background:#1c1c1e}
.ob-goal-card,.ob-risk-card{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:14px;border:2px solid #e5e5ea;background:#fff;cursor:pointer;transition:all 0.2s}
.ob-goal-card:hover,.ob-risk-card:hover{border-color:#1c1c1e}
.ob-profile-card{padding:12px 14px;background:#fff;border:1.5px solid #e5e5ea;border-radius:12px;cursor:pointer;transition:all 0.15s}
.ob-profile-card:hover{border-color:#8e8e93;background:#fafafa}
.ob-profile-check{font-size:16px;font-weight:700;color:#8e8e93;flex-shrink:0}
.bloomberg-ticker{display:flex;flex-wrap:nowrap;white-space:nowrap;animation:ticker-scroll 35s linear infinite;will-change:transform}
.bloomberg-ticker:hover{animation-play-state:paused}
@keyframes ticker-scroll{0%{transform:translateX(0)}100%{transform:translateX(-50%)}}
.dca-preset-card{transition:all 0.2s}
.dca-preset-card.active{border-color:var(--color-primary,#16a34a) !important;background:rgba(22,163,74,0.06) !important}
.dca-preset-card:hover{border-color:var(--color-primary,#16a34a)}
[data-theme="dark"] .dca-preset-card.active{background:rgba(22,163,74,0.12) !important}
.skeleton{background:linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%);background-size:400px 100%;animation:shimmer 1.2s infinite;border-radius:6px}
@keyframes shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}
.card{transition:box-shadow 0.2s ease,transform 0.15s ease}
.metric-card{transition:transform 0.15s ease,box-shadow 0.15s ease}
.metric-card:hover{box-shadow:0 6px 20px rgba(0,0,0,0.08)}
.pos-card{transition:box-shadow 0.2s ease}
.nav-btn{transition:background 0.15s ease,color 0.15s ease}
.btn-primary{transition:transform 0.15s ease,box-shadow 0.15s ease}
.btn-primary:hover{box-shadow:0 4px 16px rgba(0,0,0,0.15)}
.btn-primary:active{opacity:0.9}
.toast{animation:toastIn 0.3s cubic-bezier(0.16,1,0.3,1)}
@keyframes toastIn{from{opacity:0;transform:translateY(20px) translateX(-50%) scale(0.95)}to{opacity:1;transform:translateY(0) translateX(-50%) scale(1)}}
#home-tv-counter{min-width:120px;display:inline-block}

/* ===== RESPONSIVE DESKTOP ===== */
@media(min-width:768px){
  #bottom-nav{display:none !important}
  .sidebar{left:0;display:flex !important}
  .sidebar-overlay{display:none !important}
  .menu-btn{display:none}
  /* Contenu fluide : suit la largeur de l'écran (plafonné à 1560 px et centré à droite du menu sur très grands écrans) */
  .main{margin-left:max(180px, calc(90px + (100vw - 1560px) / 2));width:auto;box-sizing:border-box;padding:32px clamp(24px, 3vw, 48px);max-width:1560px;padding-bottom:32px !important}
  .metrics-grid{grid-template-columns:repeat(4,1fr)}
  .cards-row{grid-template-columns:2fr 1fr}
  .crisis-grid{grid-template-columns:repeat(4,1fr)}
  .form-grid.three{grid-template-columns:repeat(3,1fr)}
}

/* ===== RESPONSIVE MOBILE ===== */
@media(max-width:767px){
  #bottom-nav{display:block !important}
  .main{padding-bottom:76px !important;margin-left:0 !important;padding:16px 14px 76px}
  .sidebar{display:flex !important;left:-180px}
  .sidebar.open{left:0;display:flex !important}
  .menu-btn{display:flex !important}
  .topbar{height:50px;padding:0 12px}
  #topbar-email{max-width:80px;font-size:11px}
  .page-header{margin-bottom:16px}
  .page-header h1{font-size:22px}
  .card{padding:14px;border-radius:14px}
  .metrics-grid{grid-template-columns:repeat(2,1fr);gap:8px}
  .metric-card{padding:12px;border-radius:12px}
  .metric-val{font-size:20px}
  .pos-card-head{padding:12px}
  .pos-avatar{width:34px;height:34px;font-size:12px}
  .pos-name{font-size:13px}
  .pos-val{font-size:13px}
  .pos-actions{gap:5px}
  .btn-sm{padding:6px 10px;font-size:11px}
  .modal-card{max-width:100% !important;width:100% !important;border-radius:20px 20px 0 0 !important;margin:0 !important;position:fixed;bottom:0;left:0;right:0;max-height:92vh !important}
  .modal-overlay{align-items:flex-end !important;padding:0 !important}
  .chat-messages{max-height:45vh}
  .slider-row label{min-width:80px;font-size:11px}
  .crisis-grid{grid-template-columns:repeat(2,1fr)}
  .notif-panel{width:100%}
  .toast{bottom:72px}
  .price-ticker{display:none}
  .obj-step-card{padding:20px 14px}
  .risk-cards{grid-template-columns:1fr}
  input,select,textarea{font-size:16px !important}
}

@media(max-width:480px){
  .form-grid{grid-template-columns:1fr}
  .form-grid.three{grid-template-columns:1fr 1fr}
  .obj-simple-grid{grid-template-columns:1fr}
  .risk-pills{flex-direction:column}
  .risk-pill{flex-direction:row;justify-content:space-between}
  .risk-cards{grid-template-columns:1fr}
  .page-header h1{font-size:20px}
  .metric-val{font-size:18px}
}

@media(max-width:380px){
  .bnav-btn span{display:none}
  .bnav-center{margin:8px 2px}
}

/* ===== BOTTOM NAV ===== */
.bnav-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;background:transparent;border:none;cursor:pointer;color:#8e8e93;font-family:inherit;font-size:10px;font-weight:600;transition:color 0.15s;padding:4px 0}
.bnav-btn svg{flex-shrink:0;transition:transform 0.15s}
.bnav-btn.active{color:#1c1c1e}
.bnav-btn.active svg{transform:scale(1.1)}
.bnav-center{background:#1c1c1e;border-radius:16px;color:#fff !important;margin:6px 4px;height:48px}
.bnav-center svg{stroke:#fff}

/* ===== OBJECTIF TABS ===== */
.obj-tab-btn{display:flex;align-items:center;gap:6px;padding:7px 12px;border-radius:99px;border:1.5px solid #e5e5ea;background:#fff;font-size:12px;font-weight:700;color:#8e8e93;cursor:pointer;white-space:nowrap;transition:all 0.15s;font-family:inherit}
.obj-tab-btn.active{color:#fff;border-color:transparent}
.obj-tab-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.obj-tab-del{background:none;border:none;cursor:pointer;font-size:16px;line-height:1;padding:0 0 0 4px;color:inherit;opacity:0.6}
.obj-tab-del:hover{opacity:1}
.obj-tab-new{padding:7px 12px;border-radius:99px;border:1.5px dashed #e5e5ea;background:transparent;font-size:12px;font-weight:700;color:#8e8e93;cursor:pointer;white-space:nowrap;font-family:inherit}
.obj-tab-new:hover{border-color:#1c1c1e;color:#1c1c1e}

/* ===== PREMIUM MINIMAL OVERRIDES ===== */

/* Scrollbar ultra fine */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 99px; }

/* Sélection texte */
::selection { background: rgba(22,163,74,0.15); color: var(--color-text); }

/* Focus rings — style Apple */
*:focus-visible {
  outline: 2px solid var(--color-green-mid);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Card hover subtil */
.card:hover { border-color: var(--color-border-strong); }

/* Metric card hover */
.metric-card:hover { 
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}

/* Pos name — typo serrée */
.pos-name { letter-spacing: var(--tracking-tight); }
.pos-val { letter-spacing: var(--tracking-tight); }

/* Nav group label — plus discret */
.nav-group-label { 
  font-size: 9px; 
  letter-spacing: 0.1em; 
  color: var(--color-text-disabled);
  font-weight: 600;
}

/* Sidebar logo */
.sidebar-logo { opacity: 0.9; }

/* Bubble bot — fond plus propre */
.bubble.bot { 
  background: var(--color-bg-subtle); 
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text);
}
.bubble.user { 
  background: var(--color-primary);
  color: #fff;
}

/* Input focus — style Apple */
input:focus, select:focus { 
  background: var(--color-surface) !important;
  box-shadow: 0 0 0 3px rgba(22,163,74,0.12) !important;
  border: 1px solid var(--color-green-mid) !important;
  outline: none;
}

/* BTN small — plus propres */
.btn-sm {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  color: var(--color-text);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.btn-sm:hover { 
  background: var(--color-border-subtle); 
  border-color: var(--color-border-strong);
}
.btn-sm.buy { 
  background: var(--color-green-light); 
  color: var(--color-green); 
  border-color: var(--color-green-border);
}
.btn-sm.sell { 
  background: var(--color-red-light); 
  color: var(--color-red); 
  border-color: var(--color-red-border);
}

/* Pills couleurs mises à jour */
.pill-green { background: var(--color-green-light); color: var(--color-green); }
.pill-red { background: var(--color-red-light); color: var(--color-red); }
.pill-amber { background: var(--color-amber-light); color: var(--color-amber); }
.pill-blue { background: var(--color-blue-light); color: var(--color-blue); }
.pill-dark { background: var(--color-primary); color: #fff; }
.pill-gray { background: var(--color-bg-subtle); color: var(--color-text-secondary); border: 1px solid var(--color-border); }

/* Card title */
.card-title { 
  font-size: 13px; 
  font-weight: 600; 
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

/* Metric val colors */
.metric-val.green { color: var(--color-green); }
.metric-val.red { color: var(--color-red); }

/* Port tabs */
.port-tab.active { 
  color: var(--color-text); 
  box-shadow: var(--shadow-xs);
}

/* ===== ONBOARDING ANIMATIONS ===== */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@keyframes obFadeIn {
  from { opacity:0; transform:translateY(8px); }
  to { opacity:1; transform:translateY(0); }
}
.onboard-step { animation: obFadeIn 0.25s ease; }
.ob-profile-card { transition: all 0.18s cubic-bezier(0.16,1,0.3,1); }

.ob-goal-card { transition: all 0.15s ease; }
.ob-risk-card { transition: all 0.15s ease; }

/* ===== MOTION DESIGN PREMIUM ===== */
/* Transitions globales sur les éléments interactifs */
a, button, [onclick] { transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }

/* Hover lift sur les cards cliquables */
[onclick].card:hover, .metric-card[onclick]:hover { box-shadow: var(--shadow-md); }

/* Loading skeleton premium */
.skeleton-pulse { animation: skeleton-wave 1.4s ease infinite; background: linear-gradient(90deg, var(--color-bg-subtle) 0%, var(--color-border-subtle) 50%, var(--color-bg-subtle) 100%); background-size: 200% 100%; }
@keyframes skeleton-wave { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Pulse indicator */
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-green); display: inline-block; animation: pulse-green 2s ease infinite; }
@keyframes pulse-green { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.5; transform:scale(0.75); } }

/* Shimmer sur les nombres qui chargent */
.num-loading { opacity: 0.4; animation: num-blink 1s ease infinite; }
@keyframes num-blink { 0%,100% { opacity:0.4; } 50% { opacity:0.8; } }

/* Apparition staggerée — classe utilitaire */
.stagger-in { opacity: 0; transform: translateY(8px); transition: opacity 0.28s ease, transform 0.28s ease; }
.stagger-in.visible { opacity: 1; transform: translateY(0); }

/* Courbe graphique — stroke-dashoffset animation */
.chart-line-anim { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: chart-draw 1.2s ease-out forwards; }
@keyframes chart-draw { to { stroke-dashoffset: 0; } }

/* Notification pop */
@keyframes notif-pop { 0% { opacity:0; transform:translateY(-8px) scale(0.96); } 100% { opacity:1; transform:translateY(0) scale(1); } }
.notif-pop { animation: notif-pop 0.3s cubic-bezier(0.16,1,0.3,1); }

/* Page active — transition */
.sec.active { animation: page-enter 0.25s ease; }
@keyframes page-enter { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

/* ===== DARK MODE — Fintech Premium Noir ===== */
[data-theme="dark"] {
  --color-bg: #080c10;
  --color-bg-subtle: #0d1117;
  --color-surface: #131920;
  --color-surface-raised: #1a2230;
  --color-border: #1e2d3d;
  --color-border-subtle: #162030;
  --color-border-strong: #2a3d52;
  --color-text: #e6edf3;
  --color-text-secondary: #7d8590;
  --color-text-tertiary: #484f58;
  --color-text-disabled: #30363d;
  --color-primary: #e6edf3;
  --color-primary-hover: #ffffff;
  --color-green: #3fb950;
  --color-green-light: rgba(63,185,80,0.1);
  --color-green-border: rgba(63,185,80,0.25);
}

[data-theme="dark"] body {
  background: var(--color-bg);
  color: var(--color-text);
}

[data-theme="dark"] .card {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

[data-theme="dark"] .metric-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .pos-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .news-item {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .topbar {
  background: rgba(8,12,16,0.95);
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .sidebar {
  background: #0d1117;
  border-right-color: var(--color-border);
}

[data-theme="dark"] .nav-btn {
  color: var(--color-text-secondary);
}

[data-theme="dark"] .nav-btn:hover,
[data-theme="dark"] .nav-btn.active {
  background: rgba(255,255,255,0.06);
  color: var(--color-text);
}

[data-theme="dark"] .nav-group-label {
  color: var(--color-text-tertiary);
}

[data-theme="dark"] .profile-pill {
  background: rgba(255,255,255,0.06);
}

[data-theme="dark"] .profile-pill:hover {
  background: rgba(255,255,255,0.1);
}

[data-theme="dark"] #topbar-email {
  color: var(--color-text);
}

[data-theme="dark"] .page-header h1 {
  color: var(--color-text);
}

[data-theme="dark"] .page-sub {
  color: var(--color-text-secondary);
}

[data-theme="dark"] .card-title {
  color: var(--color-text);
}

[data-theme="dark"] .metric-val {
  color: var(--color-text);
}

[data-theme="dark"] .metric-label {
  color: var(--color-text-tertiary);
}

[data-theme="dark"] .pos-name {
  color: var(--color-text);
}

[data-theme="dark"] .pos-val {
  color: var(--color-text);
}

[data-theme="dark"] .pos-meta {
  color: var(--color-text-secondary);
}

[data-theme="dark"] .btn-secondary {
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

[data-theme="dark"] .btn-secondary:hover {
  background: rgba(255,255,255,0.06);
}

[data-theme="dark"] .btn-add {
  background: var(--color-text);
  color: #0a0a0f;
}

[data-theme="dark"] .filter-pill {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

[data-theme="dark"] .filter-pill.active {
  background: var(--color-text);
  color: #0a0a0f;
  border-color: var(--color-text);
}

[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] input,
[data-theme="dark"] select {
  background: var(--color-surface-raised);
  color: var(--color-text);
  border-color: var(--color-border);
}

[data-theme="dark"] input::placeholder {
  color: var(--color-text-tertiary);
}

[data-theme="dark"] .bubble.bot {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .notif-panel {
  background: #0d0d12;
  border-left-color: var(--color-border);
}

[data-theme="dark"] .port-tab {
  color: var(--color-text-secondary);
}

[data-theme="dark"] .port-tab.active {
  background: var(--color-surface-raised);
  color: var(--color-text);
}

[data-theme="dark"] .port-tabs {
  background: var(--color-surface);
}

[data-theme="dark"] .slider-row {
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .slider-row label {
  color: var(--color-text-secondary);
}

[data-theme="dark"] .slider-row span {
  color: var(--color-text);
}

[data-theme="dark"] .news-title {
  color: var(--color-text);
}

[data-theme="dark"] .news-summary {
  color: var(--color-text-secondary);
}

[data-theme="dark"] .search-box {
  background: var(--color-surface);
}

[data-theme="dark"] .search-box input {
  color: var(--color-text);
  background: transparent;
}

[data-theme="dark"] .ac-box {
  background: var(--color-surface);
}

[data-theme="dark"] .ac-box input {
  background: transparent;
  color: var(--color-text);
}

[data-theme="dark"] .ac-drop {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
}

[data-theme="dark"] .ac-item:hover {
  background: rgba(255,255,255,0.05);
}

[data-theme="dark"] .ac-item-name {
  color: var(--color-text);
}

[data-theme="dark"] .watchlist-chip {
  background: var(--color-surface);
}

[data-theme="dark"] .wchip-name {
  color: var(--color-text);
}

[data-theme="dark"] .popular-chip {
  background: var(--color-surface);
}

[data-theme="dark"] .popular-name {
  color: var(--color-text);
}

[data-theme="dark"] .tx-item {
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .tx-name {
  color: var(--color-text);
}

[data-theme="dark"] .score-row {
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .bar-bg {
  background: var(--color-border);
}

[data-theme="dark"] .obj-bar-bg {
  background: var(--color-border);
}

[data-theme="dark"] .modal-card {
  background: #0d0d12;
}

[data-theme="dark"] .ob-profile-card {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .ob-profile-card:hover {
  background: var(--color-surface-raised);
  border-color: var(--color-border-strong);
}

[data-theme="dark"] .ob-goal-card,
[data-theme="dark"] .ob-risk-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .btn-sm {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

[data-theme="dark"] .dca-preset-card {
  background: var(--color-surface) !important;
}

[data-theme="dark"] .risk-card {
  background: var(--color-surface);
}

[data-theme="dark"] .risk-card.active {
  background: var(--color-surface-raised);
  border-color: var(--color-text);
}

/* Transition douce */
body, .card, .metric-card, .pos-card, .news-item, .topbar, .sidebar,
.modal-card, .notif-panel, input, select, .btn-secondary, .filter-pill {
  transition: background 0.2s ease, border-color 0.2s ease, color 0.15s ease !important;
}

[data-theme="dark"] .main {
  background: var(--color-bg);
}

/* Hero card en dark — fond très sombre avec glow vert */
[data-theme="dark"] #home-metrics > div:first-child {
  background: linear-gradient(135deg, #060e08, #0a1a0c) !important;
  border-color: rgba(255,255,255,0.06) !important;
  box-shadow: 0 0 40px rgba(0,0,0,0.4) !important;
}

/* Cards métriques dark */
[data-theme="dark"] #home-score > div {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
}

/* Sidebar active nav — teinte verte */
[data-theme="dark"] .nav-btn.active {
  background: rgba(255,255,255,0.06) !important;
  color: #4ade80 !important;
}
[data-theme="dark"] .nav-btn.active svg {
  stroke: #4ade80;
}

/* Topbar logo dark */
[data-theme="dark"] .topbar-logo span { color: var(--color-text) !important; }

/* Hexagone logo — vert plus vif en dark */
[data-theme="dark"] .logo-name { color: var(--color-text) !important; }

/* Inputs dark */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--color-surface-raised) !important;
  color: var(--color-text) !important;
  border: 1px solid var(--color-border) !important;
}

/* Pos card hover dark */
[data-theme="dark"] .pos-card:hover {
  border-color: rgba(34,197,94,0.3) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

/* Filter pills dark */
[data-theme="dark"] .filter-pill {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text-secondary) !important;
}
[data-theme="dark"] .filter-pill.active {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(34,197,94,0.4) !important;
  color: #4ade80 !important;
}

/* Btn primary dark */
[data-theme="dark"] .btn-primary {
  background: #16a34a !important;
  color: #fff !important;
}
[data-theme="dark"] .btn-add {
  background: #16a34a !important;
  color: #fff !important;
  border: none !important;
}

/* Score card dark */
[data-theme="dark"] .score-ring {
  border-color: rgba(74,222,128,0.4) !important;
}

/* Chat dark */
[data-theme="dark"] #ai-chat {
  background: var(--color-bg) !important;
}
[data-theme="dark"] .chat-input-row input {
  background: var(--color-surface-raised) !important;
}

/* News item hover dark */
[data-theme="dark"] .news-item-head:hover {
  background: rgba(34,197,94,0.04) !important;
}

/* Metric val green en dark */
[data-theme="dark"] .metric-val.green { color: #4ade80 !important; }
[data-theme="dark"] .metric-val.red { color: #f87171 !important; }

/* Port tabs dark */
[data-theme="dark"] .port-tabs { background: var(--color-surface) !important; }
[data-theme="dark"] .port-tab.active { background: rgba(255,255,255,0.06) !important; color: #4ade80 !important; }

/* Scrollbar dark */
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--color-border-strong); }

/* Modal dark */
[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.7); }
[data-theme="dark"] .modal-card { background: #0d1117 !important; }

/* Toggle button dark */
[data-theme="dark"] #theme-toggle {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(34,197,94,0.2) !important;
  color: #4ade80 !important;
}

/* ===== DARK MODE — ZERO BLANC ===== */
[data-theme="dark"] .card,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .pos-card,
[data-theme="dark"] .news-item,
[data-theme="dark"] .watchlist-chip,
[data-theme="dark"] .popular-chip,
[data-theme="dark"] .opp-strip,
[data-theme="dark"] .obj-step,
[data-theme="dark"] .obj-step-card,
[data-theme="dark"] .risk-card,
[data-theme="dark"] .ob-profile-card,
[data-theme="dark"] .ob-goal-card,
[data-theme="dark"] .ob-risk-card,
[data-theme="dark"] .dca-preset-card,
[data-theme="dark"] .search-box,
[data-theme="dark"] .ac-selected-badge,
[data-theme="dark"] .prefill-notice,
[data-theme="dark"] .score-wrap,
[data-theme="dark"] .notif-item,
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background:rgb(255,255,255)"] {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}

/* Cards inline style background blanc */
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background: white"] {
  background: var(--color-surface) !important;
}

/* Textes inline noirs */
[data-theme="dark"] [style*="color:#1c1c1e"],
[data-theme="dark"] [style*="color: #1c1c1e"],
[data-theme="dark"] [style*="color:#09090b"],
[data-theme="dark"] [style*="color: #09090b"] {
  color: var(--color-text) !important;
}

[data-theme="dark"] [style*="color:#8e8e93"],
[data-theme="dark"] [style*="color: #8e8e93"],
[data-theme="dark"] [style*="color:#71717a"] {
  color: var(--color-text-secondary) !important;
}

/* Bordures inline */
[data-theme="dark"] [style*="border:1.5px solid #f0f0f0"],
[data-theme="dark"] [style*="border:1px solid #f0f0f0"],
[data-theme="dark"] [style*="border: 1px solid #e4e4e7"],
[data-theme="dark"] [style*="border:1px solid #e4e4e7"] {
  border-color: var(--color-border) !important;
}

/* Section objectif — graphique card */
[data-theme="dark"] .obj-chart-card { background: linear-gradient(145deg, #060e08, #0a160a, #0d1f0d) !important; }

/* Obj result hero */
[data-theme="dark"] .obj-result-hero { background: #0d1117 !important; }
[data-theme="dark"] .obj-summary-card { background: linear-gradient(135deg, #060e08, #0a1208) !important; }

/* Tabs objectif */
[data-theme="dark"] .obj-tab-btn {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text-secondary) !important;
}
[data-theme="dark"] .obj-tab-btn.active {
  color: #fff !important;
}

/* Score bars */
[data-theme="dark"] .score-bar-bg { background: var(--color-border) !important; }
[data-theme="dark"] .score-row { border-bottom-color: var(--color-border) !important; }
[data-theme="dark"] .score-row-label { color: var(--color-text-secondary) !important; }

/* Portefeuille tabs */
[data-theme="dark"] .port-tabs { background: var(--color-surface) !important; }
[data-theme="dark"] .port-tab { color: var(--color-text-secondary) !important; }

/* Slider */
[data-theme="dark"] .slider::-webkit-slider-thumb { background: #4ade80 !important; }
[data-theme="dark"] .obj-slider::-webkit-slider-thumb { background: #4ade80 !important; }

/* Bar backgrounds */
[data-theme="dark"] .bar-bg,
[data-theme="dark"] .perf-bar-bg,
[data-theme="dark"] .score-bar-bg { background: var(--color-border) !important; }

/* Tx items */
[data-theme="dark"] .tx-item { border-bottom-color: var(--color-border) !important; }
[data-theme="dark"] .tx-name { color: var(--color-text) !important; }
[data-theme="dark"] .tx-meta { color: var(--color-text-secondary) !important; }

/* Quick questions */
[data-theme="dark"] .quick-questions button {
  background: var(--color-surface-raised) !important;
  color: var(--color-text-secondary) !important;
}

/* Chat input */
[data-theme="dark"] #ai-chat { background: transparent !important; }
[data-theme="dark"] .chat-input-row input {
  background: var(--color-surface-raised) !important;
  color: var(--color-text) !important;
}

/* News expand */
[data-theme="dark"] .news-reco { background: var(--color-surface-raised) !important; }

/* Btn row */
[data-theme="dark"] .btn-sm.buy { background: rgba(63,185,80,0.12) !important; color: #3fb950 !important; border-color: rgba(63,185,80,0.25) !important; }
[data-theme="dark"] .btn-sm.sell { background: rgba(220,38,38,0.15) !important; color: #f87171 !important; border-color: rgba(220,38,38,0.3) !important; }
[data-theme="dark"] .btn-sm { background: var(--color-surface-raised) !important; color: var(--color-text-secondary) !important; border-color: var(--color-border) !important; }
[data-theme="dark"] .btn-danger { background: rgba(220,38,38,0.12) !important; color: #f87171 !important; }
[data-theme="dark"] .btn-refresh { background: var(--color-surface-raised) !important; color: var(--color-text) !important; }

/* Alerts */
[data-theme="dark"] .alert-ok { background: rgba(63,185,80,0.1) !important; border-color: rgba(63,185,80,0.2) !important; color: #3fb950 !important; }
[data-theme="dark"] .alert-warn { background: rgba(217,119,6,0.1) !important; border-color: rgba(217,119,6,0.2) !important; color: #fbbf24 !important; }
[data-theme="dark"] .alert-err { background: rgba(220,38,38,0.1) !important; border-color: rgba(220,38,38,0.2) !important; color: #f87171 !important; }
[data-theme="dark"] .alert-info { background: rgba(37,99,235,0.1) !important; border-color: rgba(37,99,235,0.2) !important; color: #93c5fd !important; }

/* ===== DARK MODE — LISIBILITÉ CHAT & BOUTONS ===== */

/* Boutons actions rapides agent */
[data-theme="dark"] #agent-quick-actions button {
  background: var(--color-surface-raised) !important;
  color: var(--color-text-secondary) !important;
  border: 1px solid var(--color-border) !important;
}
[data-theme="dark"] #agent-quick-actions button:hover {
  background: rgba(255,255,255,0.06) !important;
  color: #e6edf3 !important;
  border-color: rgba(255,255,255,0.15) !important;
}

/* Bulles chat user */
[data-theme="dark"] .bubble.user {
  background: rgba(22,163,74,0.2) !important;
  color: #e6edf3 !important;
  border: 1px solid rgba(22,163,74,0.3) !important;
}

/* Bulles chat bot */
[data-theme="dark"] .bubble.bot {
  background: var(--color-surface-raised) !important;
  color: var(--color-text) !important;
  border: 1px solid var(--color-border) !important;
}

/* Markdown dans les bulles */
[data-theme="dark"] .bubble strong { color: #e6edf3 !important; }
[data-theme="dark"] .bubble em { color: var(--color-text-secondary) !important; }

/* Input chat */
[data-theme="dark"] #ai-in {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  border: 1px solid var(--color-border) !important;
}
[data-theme="dark"] #ai-in::placeholder {
  color: var(--color-text-tertiary) !important;
}

/* Bouton envoyer */
[data-theme="dark"] #ai-send-btn {
  background: #16a34a !important;
}

/* Quick questions */
[data-theme="dark"] .quick-questions button {
  background: var(--color-surface-raised) !important;
  color: var(--color-text-secondary) !important;
  border: 1px solid var(--color-border) !important;
}

/* Briefing quotidien — déjà sombre, juste vérifier le texte */
[data-theme="dark"] #agent-brief-content span {
  color: rgba(232,245,232,0.85) !important;
}

/* Bouton actualiser briefing */
[data-theme="dark"] #brief-refresh-btn {
  background: rgba(255,255,255,0.06) !important;
  color: rgba(232,245,232,0.5) !important;
  border-color: rgba(255,255,255,0.1) !important;
}

/* Section agent-context-bar */
[data-theme="dark"] #agent-context-bar > div {
  background: var(--color-surface-raised) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text-secondary) !important;
}

/* Agent suggestions */
[data-theme="dark"] #agent-suggestions button,
[data-theme="dark"] #agent-suggestions > div {
  background: var(--color-surface) !important;
  color: var(--color-text-secondary) !important;
  border-color: var(--color-border) !important;
}

/* Chat card wrapper */
[data-theme="dark"] .chat-card {
  background: transparent !important;
}
[data-theme="dark"] .chat-card > div[style*="border-top"] {
  border-top-color: var(--color-border) !important;
  background: var(--color-surface) !important;
}

/* Textes génériques dans les bulles markdown */
[data-theme="dark"] #ai-chat * {
  color: inherit;
}
[data-theme="dark"] #ai-chat .bubble.bot * {
  color: var(--color-text) !important;
}
[data-theme="dark"] #ai-chat .bubble.user * {
  color: #e6edf3 !important;
}

/* ===== HOME HOVER CARDS ===== */
.home-hover-card {
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
  cursor: pointer;
}
.home-hover-card:hover {
  transform: translateY(-1px) !important;
  box-shadow: var(--shadow-md) !important;
  border-color: var(--color-border-strong) !important;
}
[data-theme="dark"] .home-hover-card:hover {
  background: var(--color-surface-raised) !important;
  border-color: var(--color-border-strong) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
}
/* S'assurer que le background ne devient jamais blanc en dark */
[data-theme="dark"] .home-hover-card {
  background: var(--color-surface) !important;
}
[data-theme="dark"] .home-hover-card[style*="background:linear-gradient"] {
  background: linear-gradient(135deg, #080c10, #0d1520) !important;
}

/* ===== DARK MODE — PAGE SANTÉ ===== */
[data-theme="dark"] .score-wrap,
[data-theme="dark"] .score-items,
[data-theme="dark"] .score-row {
  background: transparent !important;
}

/* Barres de score */
[data-theme="dark"] .score-bar-bg {
  background: rgba(255,255,255,0.08) !important;
}

/* Composition du portefeuille — metric cards */
[data-theme="dark"] [style*="background:#fff"][style*="border-radius:12px"],
[data-theme="dark"] [style*="background: #fff"][style*="border-radius:12px"],
[data-theme="dark"] [style*="background:#fff"][style*="border-radius:14px"],
[data-theme="dark"] [style*="background:#fff"][style*="border-radius:16px"],
[data-theme="dark"] [style*="background:#fafafa"],
[data-theme="dark"] [style*="background: #fafafa"] {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}

/* Barres d'allocation */
[data-theme="dark"] [style*="background:#f0f0f0"],
[data-theme="dark"] [style*="background:#f0f0f2"],
[data-theme="dark"] [style*="background:#e5e5ea"],
[data-theme="dark"] [style*="background: #f0f0f0"],
[data-theme="dark"] [style*="background: #e5e5ea"] {
  background: rgba(255,255,255,0.06) !important;
}

/* Textes noirs dans la santé */
[data-theme="dark"] .score-num { color: var(--color-text) !important; }
[data-theme="dark"] .score-max { color: var(--color-text-tertiary) !important; }
[data-theme="dark"] .score-val { color: var(--color-text) !important; }
[data-theme="dark"] .score-row-label { color: var(--color-text-secondary) !important; }

/* Section composition */
[data-theme="dark"] #sante-alloc {
  background: transparent !important;
}
[data-theme="dark"] #sante-alloc > div {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
}

/* ── Onboarding cards — propre clair/sombre ── */
.ob-profile-card,
.ob-goal-card,
.ob-risk-card {
  background: #fff;
  border: 1.5px solid #e5e5ea;
  color: #1c1c1e;
}
.ob-profile-card.selected,
.ob-goal-card.selected,
.ob-risk-card.selected {
  border-color: #1c1c1e !important;
  background: #f5f5f5 !important;
}
.ob-profile-check, .ob-check {
  color: #c7c7cc;
  font-size: 18px;
  font-weight: 700;
}
.ob-profile-card.selected .ob-profile-check,
.ob-goal-card.selected .ob-check,
.ob-risk-card.selected .ob-check {
  color: #1c1c1e;
}

/* Dark mode */
[data-theme="dark"] .ob-profile-card,
[data-theme="dark"] .ob-goal-card,
[data-theme="dark"] .ob-risk-card {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}
[data-theme="dark"] .ob-profile-card.selected,
[data-theme="dark"] .ob-goal-card.selected,
[data-theme="dark"] .ob-risk-card.selected {
  border-color: #4ade80 !important;
  background: rgba(74,222,128,0.1) !important;
}
[data-theme="dark"] .ob-profile-check,
[data-theme="dark"] .ob-check {
  color: rgba(255,255,255,0.25);
}
[data-theme="dark"] .ob-profile-card.selected .ob-profile-check,
[data-theme="dark"] .ob-goal-card.selected .ob-check,
[data-theme="dark"] .ob-risk-card.selected .ob-check {
  color: #4ade80;
}

/* Onboarding modal bottom section */
#onboarding-modal .onboard-step > div:last-child {
  background: #fff;
  color: #1c1c1e;
}
[data-theme="dark"] #onboarding-modal .onboard-step > div:last-child {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
}
[data-theme="dark"] #onboarding-modal label,
[data-theme="dark"] #onboarding-modal .field label {
  color: var(--color-text-secondary) !important;
}
[data-theme="dark"] #onboarding-modal input[type="number"],
[data-theme="dark"] #onboarding-modal input[type="text"] {
  background: var(--color-surface-raised) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}

/* ═══════════════════════════════════════════════════
   DARK MODE — Adaptation auto des fonds clairs en dur
   (inline styles JS : #fef2f2, #f0fdf4, #eef2ff, #fffbeb...)
   ═══════════════════════════════════════════════════ */

/* Fonds pastel rouges (alertes) */
[data-theme="dark"] [style*="background:#fef2f2"],
[data-theme="dark"] [style*="background: #fef2f2"] {
  background: rgba(220, 38, 38, 0.12) !important;
}
/* Fonds pastel verts (succès/opportunités) */
[data-theme="dark"] [style*="background:#f0fdf4"],
[data-theme="dark"] [style*="background: #f0fdf4"] {
  background: rgba(22, 163, 74, 0.12) !important;
}
/* Fonds pastel indigo */
[data-theme="dark"] [style*="background:#eef2ff"],
[data-theme="dark"] [style*="background: #eef2ff"] {
  background: rgba(99, 102, 241, 0.12) !important;
}
/* Fonds pastel ambre */
[data-theme="dark"] [style*="background:#fffbeb"],
[data-theme="dark"] [style*="background: #fffbeb"] {
  background: rgba(245, 158, 11, 0.12) !important;
}
/* Fonds gris clair génériques */
[data-theme="dark"] [style*="background:#f9fafb"],
[data-theme="dark"] [style*="background: #f9fafb"],
[data-theme="dark"] [style*="background:#f5f5f5"],
[data-theme="dark"] [style*="background:#f2f2f7"],
[data-theme="dark"] [style*="background:#f0f0f0"] {
  background: var(--color-surface-raised, #1a1f2e) !important;
}
/* Fonds blancs en dur (";" évite de matcher #fffbeb) */
[data-theme="dark"] [style*="background:#fff;"],
[data-theme="dark"] [style*="background:#ffffff"] {
  background: var(--color-surface-raised, #1a1f2e) !important;
}
/* Textes noirs en dur → clairs */
[data-theme="dark"] [style*="color:#09090b"],
[data-theme="dark"] [style*="color:#1c1c1e"],
[data-theme="dark"] [style*="color:#3c3c43"] {
  color: var(--color-text, #e6edf3) !important;
}
/* Bordures claires en dur */
[data-theme="dark"] [style*="border:1px solid #e4e4e7"],
[data-theme="dark"] [style*="border: 1px solid #e4e4e7"] {
  border-color: var(--color-border, #2a2f3e) !important;
}
/* Pastels de fonds verts clairs (bbf7d0, etc) en bordures */
[data-theme="dark"] [style*="border:1px solid #bbf7d0"] { border-color: rgba(22,163,74,0.35) !important; }
[data-theme="dark"] [style*="border:1px solid #fecaca"] { border-color: rgba(220,38,38,0.35) !important; }
[data-theme="dark"] [style*="border:1px solid #fde68a"] { border-color: rgba(245,158,11,0.35) !important; }

/* ═══ RESPONSIVE — Page Agent IA ═══ */
@media (max-width: 980px) {
  #agent-layout { grid-template-columns: 1fr !important; }
  #agent-right { position: static !important; }
}
@media (max-width: 720px) {
  #agent-bottom { grid-template-columns: 1fr !important; }
  /* "Depuis hier" : 2 colonnes au lieu de 4 sur mobile */
  #agent-hier > div > div[style*="repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ═══ AIDE À LA DÉCISION — refonte ═══ */
.d-intent-btn { background: var(--color-bg-subtle, #f7f7f8); border: 2px solid var(--color-border, #e5e5ea); color: var(--color-text-secondary, #3c3c43); }
.d-intent-btn:hover { border-color: var(--color-primary, #16a34a); }
.d-intent-btn.active { background: var(--color-primary, #16a34a); border-color: var(--color-primary, #16a34a); color: #fff; }
[data-theme="dark"] .d-intent-btn { background: var(--color-surface-raised); border-color: var(--color-border); color: var(--color-text-secondary); }
[data-theme="dark"] .d-intent-btn.active { background: var(--color-primary, #16a34a); border-color: var(--color-primary, #16a34a); color: #fff; }

/* Dark mode : couleurs du résultat d'analyse (fonds pastel en dur dans le JS) */
[data-theme="dark"] [style*="background:#e8f8f0"] { background: rgba(26,127,90,0.15) !important; }
[data-theme="dark"] [style*="background:#fff0f0"] { background: rgba(204,47,38,0.13) !important; }
[data-theme="dark"] [style*="background:#fff9e6"] { background: rgba(245,158,11,0.13) !important; }


/* ═══════════════════════════════════════════════════
   DOCUMENTS JURIDIQUES — présentation officielle
   Noir sur blanc, empattements, numérotation d'articles
   ═══════════════════════════════════════════════════ */

/* Liens vers les documents (page Paramètres) */
.legal-link {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 13px 4px; background: none; border: none;
  border-bottom: 1px solid var(--color-border, #f0f0f0);
  font-size: 13.5px; font-weight: 600; color: var(--color-text, #1c1c1e);
  cursor: pointer; font-family: inherit; text-align: left; transition: opacity 0.15s;
}
.legal-link:last-child { border-bottom: none; }
.legal-link:hover { opacity: 0.6; }
.legal-link span { color: #8e8e93; font-size: 18px; }

/* ── Le document lui-même ── */
.legal-doc {
  font-family: Georgia, 'Times New Roman', 'Droid Serif', serif;
  color: #111;
  border-radius: 3px;
  overflow: hidden;
}

.legal-doc-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 26px 44px 18px;
  border-bottom: 2px solid #111;
  background: #fff;
}
.legal-doc-brand {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: #666; margin-bottom: 7px;
}
.legal-doc-title {
  font-size: 21px; font-weight: 700; letter-spacing: -0.01em;
  line-height: 1.25; color: #111;
}
.legal-doc-close {
  background: none; border: none; font-size: 26px; line-height: 1;
  color: #999; cursor: pointer; padding: 0 2px; font-family: inherit;
  transition: color 0.15s; flex-shrink: 0;
}
.legal-doc-close:hover { color: #111; }

.legal-doc-body {
  padding: 26px 44px 32px;
  overflow-y: auto;
  font-size: 14.5px;
  line-height: 1.75;
  color: #2a2a2a;
  text-align: justify;
  hyphens: auto;
  counter-reset: legal-article;
}

/* Titres d'articles */
.legal-doc-body h3 {
  font-size: 14px; font-weight: 700; color: #111;
  margin: 28px 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #ddd;
  text-align: left;
  letter-spacing: 0.01em;
}
.legal-doc-body h3:first-child { margin-top: 0; }

.legal-doc-body p { margin: 0 0 13px; }
.legal-doc-body ul {
  margin: 0 0 15px; padding-left: 0; list-style: none;
}
.legal-doc-body li {
  position: relative; padding-left: 20px; margin-bottom: 8px;
}
.legal-doc-body li::before {
  content: "—"; position: absolute; left: 2px; color: #999;
}
.legal-doc-body strong { font-weight: 700; color: #000; }
.legal-doc-body em { font-style: italic; color: #444; }

/* Date de mise à jour */
.legal-doc-body .legal-date {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px; color: #777; font-style: normal;
  letter-spacing: 0.03em; text-align: right;
  padding-bottom: 16px; margin-bottom: 22px !important;
  border-bottom: 1px solid #eee;
}

/* Encadré d'avertissement */
.legal-doc-body .legal-warning {
  border: 1px solid #111; border-left: 4px solid #111;
  padding: 16px 20px; margin: 0 0 24px;
  background: #fafafa;
}
.legal-doc-body .legal-warning p { margin: 0; font-size: 14px; }

/* Pied de page */
.legal-doc-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 44px;
  border-top: 1px solid #ddd;
  background: #fafafa;
}
.legal-doc-foot span {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 10.5px; color: #888; letter-spacing: 0.04em;
}
.legal-doc-foot button {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding: 9px 26px; background: #111; color: #fff;
  border: none; border-radius: 3px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.legal-doc-foot button:hover { background: #333; }

/* Mobile */
@media (max-width: 620px) {
  .legal-doc-head { padding: 20px 22px 15px; }
  .legal-doc-body { padding: 20px 22px 26px; font-size: 14px; text-align: left; }
  .legal-doc-foot { padding: 13px 22px; }
  .legal-doc-title { font-size: 18px; }
}

/* Formulaires de connexion/inscription (fond sombre) : le style global input:focus
   forçait un fond clair sous un texte blanc → saisie invisible. On garde le fond
   sombre au focus et on neutralise le fond clair de l'autofill Chrome. */
#auth-login input:focus, #auth-signup input:focus {
  background: rgba(255,255,255,0.07) !important;
  color: #fff !important;
  border: 1.5px solid rgba(26,127,90,0.6) !important;
}
#auth-login input:-webkit-autofill,
#auth-signup input:-webkit-autofill {
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff;
  transition: background-color 9999s ease-out 0s;
  box-shadow: 0 0 0 1000px #1c2320 inset !important;
}

/* ── Comparatif des offres (sobre) ── */
.plans-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:14px;align-items:stretch}
.plan-card{background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.1);border-radius:18px;display:flex;flex-direction:column;overflow:hidden}
.plan-premium{border-color:rgba(255,255,255,0.28)}
.plan-top{padding:20px 20px 18px;display:flex;flex-direction:column}
.plan-name{font-size:19px;font-weight:800;color:#fff;letter-spacing:-0.02em}
.plan-desc{font-size:12.5px;color:rgba(255,255,255,0.55);margin:2px 0 16px;line-height:1.4}
.plan-price{display:flex;align-items:baseline;gap:6px;color:#fff}
.plan-price b{font-size:28px;font-weight:800;letter-spacing:-0.03em}
.plan-price span{font-size:12px;color:rgba(255,255,255,0.5)}
.plan-note{font-size:11.5px;color:rgba(255,255,255,0.45);margin:2px 0 0}
.plan-save{font-size:12px;font-weight:700;color:#4ade80;margin-top:8px}
.plan-save-link{color:rgba(255,255,255,0.7);cursor:pointer;font-weight:600}
.plan-save-link:hover{color:#fff}
.plan-btn{margin-top:16px;width:100%;padding:12px;border-radius:10px;font:inherit;font-size:13.5px;font-weight:700;text-align:center;box-sizing:border-box}
.plan-btn-main{background:#fff;color:#0b1220;border:none;cursor:pointer}
.plan-btn-main:hover{background:#e5e7eb}
.plan-btn-ghost{border:1px solid rgba(255,255,255,0.15);color:rgba(255,255,255,0.5);font-weight:600}
.plan-foot{font-size:11px;color:rgba(255,255,255,0.4);text-align:center;margin-top:8px}
.plan-seg-wrap{display:flex;gap:2px;background:rgba(255,255,255,0.07);border-radius:9px;padding:3px;margin-bottom:14px}
.plan-seg{flex:1;padding:7px 6px;border:none;border-radius:7px;background:transparent;color:rgba(255,255,255,0.55);font:inherit;font-size:12px;font-weight:700;cursor:pointer}
.plan-seg.on{background:rgba(255,255,255,0.14);color:#fff}
.plan-badge{background:#4ade80;color:#052e16;font-size:9.5px;font-weight:800;padding:1px 6px;border-radius:99px;margin-left:5px}
.plan-list{border-top:1px solid rgba(255,255,255,0.08);padding:16px 20px 20px;flex:1}
.plan-list-title{font-size:12px;color:rgba(255,255,255,0.6);margin-bottom:10px}
.plan-list ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.plan-list li{display:flex;gap:9px;align-items:flex-start;font-size:12.5px;line-height:1.45;color:rgba(255,255,255,0.8)}
.plan-list li svg{flex-shrink:0;margin-top:2px;color:rgba(255,255,255,0.5)}
.plan-premium .plan-list li svg{color:#4ade80}
@media (max-width:640px){
  .plans-grid{grid-template-columns:1fr}
  .plan-premium{order:-1}          /* Premium (avec le bouton) d'abord sur téléphone */
  .plan-list{display:none}
  .plan-premium .plan-list{display:block}
  #plans-modal{padding:10px 8px !important}
}

/* Agent IA : aperçu d'exemple (portefeuille fictif) — lisible mais non interactif */
.agent-sample{pointer-events:none;user-select:none;-webkit-user-select:none}

/* Cases à cocher et boutons radio : la règle globale « input{width:100%} » ne doit pas les étirer */
input[type="radio"], input[type="checkbox"] { width: auto; padding: 0; background: none; border-radius: 0; }

/* Première visite : point rouge « nouveau » sur les onglets pas encore ouverts */
.nav-btn, .bnav-btn { position: relative; }
.nav-dot { position: absolute; top: 50%; right: 9px; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px var(--color-surface, #fff); animation: navDotPulse 1.8s ease-in-out infinite; pointer-events: none; }
.bnav-btn .nav-dot { top: 6px; right: calc(50% - 17px); margin-top: 0; }
@keyframes navDotPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
