:root{
  --bg:#0b0f17;
  --card: rgba(17,24,39,.78);
  --muted:#94a3b8;
  --text:#e5e7eb;
  --line: rgba(148,163,184,.18);
  --line2: rgba(148,163,184,.26);
  --accent:#7dd3fc;
  --bad:#fb7185;
  --good:#86efac;
  --shadow: 0 18px 50px rgba(0,0,0,.18);
  --field: rgba(0,0,0,.22);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1100px 700px at 15% 10%, #0f1b3a 0%, var(--bg) 58%) fixed;
  color:var(--text);
}
.wrap{max-width:1180px;margin:0 auto;padding:18px}
.header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:4px}
.brand{display:flex; gap:12px; align-items:center}
.brandmark{
  width:46px;height:46px;border-radius:14px;
  display:grid;place-items:center;
  background: rgba(255,255,255,.04);
  border:1px solid var(--line2);
  overflow:hidden;
}
.brandmark img{width:100%;height:100%;object-fit:cover}
h1{margin:0;font-size:20px;line-height:1.2;letter-spacing:.2px}
.sub{margin:4px 0 0;color:var(--muted);font-size:13px}
.status{
  padding:9px 10px;border-radius:12px;border:1px solid var(--line2);
  color:var(--muted); font-size:13px; white-space:nowrap;
  background: rgba(255,255,255,.03);
}
.status.good{border-color: rgba(134,239,172,.26); color: var(--good);}
.status.bad{border-color: rgba(251,113,133,.26); color: var(--bad);}

.overview{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:14px;
  margin: 12px 0 16px;
}
.ov-card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  padding:12px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.ov-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.ov-title{font-size:12px;color:var(--muted);font-weight:500;letter-spacing:.35px;text-transform:uppercase}
.ov-more{color:rgba(148,163,184,.85);font-weight:500;font-size:12px}
.ov-list{display:flex;flex-direction:column;gap:9px}
.ov-row{
  display:flex;align-items:center;justify-content:space-between;
  padding:9px 10px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(148,163,184,.16);
  border-radius:14px;
  cursor:pointer;
  transition: transform .08s ease, border-color .12s ease;
}
.ov-row:hover{transform: translateY(-1px); border-color: rgba(125,211,252,.22)}
.ov-left{display:flex;gap:10px;align-items:center}
.icon{
  width:26px;height:26px;border-radius:9px;
  border:1px solid rgba(148,163,184,.18);
  background: rgba(0,0,0,.18);
}
.ov-sym{font-weight:500;letter-spacing:.12px;font-size:12px} /* thinner */
.ov-right{display:flex;gap:12px;align-items:baseline}
.ov-price{color:var(--text);font-variant-numeric:tabular-nums;font-weight:520}
.ov-chg{font-variant-numeric:tabular-nums;font-weight:560;font-size:12px}
.ov-chg.pos{color:var(--good)}
.ov-chg.neg{color:var(--bad)}

.card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius:20px;
  overflow:hidden;
  box-shadow: var(--shadow);
  margin-bottom:16px;
  backdrop-filter: blur(8px);
}
.card-head{
  padding:14px 16px 10px;
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
  flex-wrap:wrap;
}
.card-head h2{margin:0;font-size:16px;letter-spacing:.2px}
.hint{color:var(--muted);font-size:12px;margin-top:2px}
.head-left{display:flex;flex-direction:column;gap:2px}

.controls{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;justify-content:flex-end}
.ctl{display:flex;flex-direction:column;gap:6px;font-size:11px;color:var(--muted);font-weight:800;letter-spacing:.35px;text-transform:uppercase}
.ctl.inline{flex-direction:row;align-items:center;gap:10px}
select, input[type="search"]{
  -webkit-appearance:none;
  -moz-appearance:none;
  appearance:none;

  background: var(--field);
  border:1px solid var(--line2);
  color:var(--text);
  padding:10px 12px;border-radius:12px;
  outline:none;
  font-size:13px;
}
select{
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(148,163,184,.9) 50%),
    linear-gradient(135deg, rgba(148,163,184,.9) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
select option{background: #0b1220;color: #e5e7eb;}
input[type="search"]{min-width:200px}
select:focus, input[type="search"]:focus{border-color: rgba(125,211,252,.32)}
.mini-select{padding:8px 10px;font-size:12px;border-radius:12px}

.seg{display:flex;gap:6px}
.segbtn{
  padding:10px 12px;border-radius:12px;
  border:1px solid var(--line2);
  background: var(--field);
  color:rgba(148,163,184,.95);
  cursor:pointer;font-weight:750;font-size:12px;
  transition: border-color .12s ease, transform .08s ease;
}
.segbtn:hover{transform: translateY(-1px); border-color: rgba(125,211,252,.22)}
.segbtn.active{color:var(--text); border-color: rgba(125,211,252,.35); box-shadow: 0 0 0 3px rgba(125,211,252,.08) inset}

.toggle{position:relative;display:inline-flex;align-items:center}
.toggle input{display:none}
.toggle .pill{
  width:44px;height:26px;border-radius:999px;
  background: var(--field);
  border:1px solid var(--line2);
  position:relative;
  cursor:pointer;
}
.toggle .pill::after{
  content:"";
  width:20px;height:20px;border-radius:999px;
  background: rgba(148,163,184,.9);
  position:absolute;top:2px;left:2px;
  transition: transform .16s ease, background .16s ease;
}
.toggle input:checked + .pill{border-color: rgba(125,211,252,.35)}
.toggle input:checked + .pill::after{
  transform: translateX(18px);
  background: rgba(125,211,252,.95);
}

/* OHLC top bar */
.ohlcbar{
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;
  padding: 0 16px 10px;
  border-bottom: 1px solid rgba(148,163,184,.10);
}
.ohlc-left{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.pair{font-weight:300;letter-spacing:.2px}
.last{
  font-size:14px;
  font-weight:300;
  font-variant-numeric: tabular-nums;
}
.chg{font-weight:600;font-variant-numeric: tabular-nums}
.chg.pos{color: var(--good)}
.chg.neg{color: var(--bad)}

.ohlc-right{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;justify-content:flex-end}
.stat{color: rgba(148,163,184,.95); font-size:12px}
.stat strong{color: var(--text); font-weight:650; font-variant-numeric: tabular-nums; margin-left:4px}

.chartbar{
  display:flex;align-items:center;justify-content:space-between;
  gap:10px;
  padding: 10px 16px 0;
}
.chartbar-left{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.chartbar-right{display:flex;align-items:center}
.iconbtn{
  width:34px;height:34px;border-radius:12px;
  border:1px solid var(--line2);
  background: var(--field);
  color: var(--text);
  cursor:pointer;
  font-weight:780;
  transition: transform .08s ease, border-color .12s ease;
}
.iconbtn:hover{transform: translateY(-1px); border-color: rgba(125,211,252,.22)}
.slider{display:flex;align-items:center;gap:10px;padding:0 6px}
.slider input[type="range"]{width:150px}
.pan{display:flex;align-items:center;gap:8px}
.levels{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.small{font-size:12px}
.muted{color:var(--muted)}

.chart-wrap{padding:12px}
canvas{
  width:100%;
  height:auto;
  background: rgba(0,0,0,.14);
  border:1px solid rgba(148,163,184,.16);
  border-radius:16px;
}
.card-sub{
  display:flex; gap:18px; flex-wrap:wrap;
  padding:10px 16px 14px;
  border-top:1px solid var(--line);
}
.kv{display:flex;flex-direction:column;gap:4px}
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse;min-width:920px}
th, td{padding:12px 14px;border-top:1px solid var(--line);font-size:13px}
th{color:rgba(148,163,184,.9);text-align:left;font-weight:800;letter-spacing:.3px;text-transform:uppercase;background:rgba(0,0,0,.10);font-size:11px}
td.muted{color:var(--muted)}
.pos{color:var(--good);font-variant-numeric:tabular-nums}
.neg{color:var(--bad);font-variant-numeric:tabular-nums}
.foot{display:flex; justify-content:space-between; gap:12px;padding:12px 16px;border-top:1px solid var(--line); color:var(--muted)}

.row-asset{display:flex;align-items:center;gap:10px}
.row-asset img{width:22px;height:22px;border-radius:8px;border:1px solid rgba(148,163,184,.16);background: rgba(0,0,0,.18)}
.row-asset span{font-weight:520} /* thinner */

@media (max-width: 980px){
  .overview{grid-template-columns: repeat(2, minmax(0,1fr));}
}
@media (max-width: 560px){
  .wrap{padding:12px}
  .overview{grid-template-columns: 1fr;}
  .header{flex-direction:column; gap:12px}
  h1{font-size:18px}
  .sub{font-size:12px}

  .brandmark .logo{height:34px !important;}
  .brandmark .logo-sub{height:26px !important;}

  .controls{width:100%;justify-content:flex-start;gap:8px}
  .controls .ctl{flex:1 1 calc(50% - 8px); min-width:0;}
  .controls .ctl.inline{flex:1 1 calc(50% - 8px);}
  .controls .ctl:last-child{flex:1 1 100%;}

  input[type="search"]{width:100%; min-width:0;}
  select{width:100%;}

  .card-head{padding:12px 12px 8px}
  .ohlcbar{padding:0 12px 10px; gap:10px}
  .ohlc-right{gap:10px}
  .chartbar{padding:10px 12px 0}
  .chart-wrap{padding:8px}

  .seg{width:100%;}
  .segbtn{flex:1; padding:10px 10px;}

  .slider input[type="range"]{width:110px}

  .levels .muted.small{display:none}
  .foot{flex-direction:column; align-items:flex-start}
}

@media (max-width: 420px){
  #viewInfo{display:none}
  .iconbtn{width:32px;height:32px;border-radius:12px}
}

.right{display:flex;align-items:center;gap:10px}

.status.ident{
  cursor:pointer;
  color: rgba(255,230,200,.98);
  border-color: rgba(251,146,60,.35);
  background: rgba(251,146,60,.10);
}
.status.ident:hover{ border-color: rgba(251,146,60,.55); }

/* Modal */
.modal{position:fixed;inset:0;display:none;z-index:50}
.modal.open{display:block}
.modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.55);backdrop-filter: blur(2px)}
.modal-card{
  position:relative;
  width:min(520px, calc(100% - 28px));
  margin: 70px auto;
  background: rgba(17,24,39,.92);
  border:1px solid rgba(148,163,184,.18);
  border-radius:20px;
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
  padding:16px;
}
.modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.modal-head h3{margin:6px 0 0;font-size:16px;letter-spacing:.2px}
.modal-sub{margin:6px 0 0;color:var(--muted);font-size:12px}
.modal-pill{
  display:inline-flex;align-items:center;gap:8px;
  padding:6px 10px;border-radius:999px;
  font-size:11px;font-weight:800;letter-spacing:.35px;text-transform:uppercase;
  color: rgba(255,230,200,.98);
  border:1px solid rgba(251,146,60,.35);
  background: rgba(251,146,60,.10);
}
.modal-form{margin-top:14px;display:flex;flex-direction:column;gap:12px}
.field{display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:11px;font-weight:800;letter-spacing:.35px;text-transform:uppercase}
.field input{
  background: rgba(0,0,0,.22);
  border:1px solid rgba(148,163,184,.26);
  color:var(--text);
  padding:12px;border-radius:14px;
  font-size:13px;
}
.field input:focus{outline:none;border-color: rgba(251,146,60,.55)}
.modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:6px;flex-wrap:wrap}
.btn{
  padding:10px 12px;border-radius:12px;
  border:1px solid rgba(251,146,60,.45);
  background: rgba(251,146,60,.12);
  color: rgba(255,230,200,.98);
  font-weight:800;cursor:pointer;
}
.btn:hover{border-color: rgba(251,146,60,.65)}
.btn.ghost{
  border-color: rgba(148,163,184,.26);
  background: rgba(0,0,0,.18);
  color: rgba(148,163,184,.95);
}
.modal-foot{margin-top:8px;color:var(--muted)}
.modal-close{height:34px;width:34px}

.ov-more-btn{
  border:none;
  background: transparent;
  color: rgba(148,163,184,.85);
  font-weight:800;
  font-size:12px;
  cursor:pointer;
  padding:6px 8px;
  border-radius:10px;
  letter-spacing:.2px;
}
.ov-more-btn:hover{
  background: rgba(255,255,255,.04);
  color: rgba(226,232,240,.95);
}

.more-tools{margin-top:12px}
.more-tools input[type="search"]{width:100%}
.more-list{
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height: 52vh;
  overflow:auto;
  padding-right:4px;
}
.more-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 10px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(148,163,184,.16);
  border-radius:14px;
  cursor:pointer;
}
.more-row:hover{border-color: rgba(125,211,252,.24)}
.more-left{display:flex;align-items:center;gap:10px;min-width:0}
.more-left .label{font-weight:650;letter-spacing:.12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.more-mid{margin-left:auto;font-variant-numeric:tabular-nums;font-weight:650}
.more-chg{font-variant-numeric:tabular-nums;font-weight:700}
.more-chg.pos{color:var(--good)}
.more-chg.neg{color:var(--bad)}


/* PATCH: brandmark = 2 logos visibles */
.brandmark{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;

  width:auto !important;
  height:auto !important;
  padding:0 !important;

  overflow:visible !important;
  background:transparent !important;
  border:none !important;
  border-radius:0 !important;
}

/* Si tes images étaient forcées en absolute par l'ancien style */
.brandmark img{
  position:static !important;
  inset:auto !important;
  transform:none !important;

  display:block !important;
  width:auto !important;
  max-width:none !important;
  object-fit:contain !important;
}

.brandmark .logo{ height:44px; }
.brandmark .logo-sub{ height:34px; opacity:.95; }

/* ===== Controls: layout propre sur mobile uniquement ===== */
@media (max-width: 600px) {
  .card .card-head .controls{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
  }

  /* reset des marges / largeur */
  .card .card-head .controls .ctl{
    margin: 0;
    min-width: 0;
  }

  .card .card-head .controls .ctl > span{
    font-size: 11px;
    opacity: .85;
    margin-bottom: 6px;
  }

  .card .card-head .controls select,
  .card .card-head .controls input[type="search"]{
    width: 100%;
  }

  /* Segmented "Courbe / Bougies" */
  .card .card-head .controls .seg{
    width: 100%;
    display: flex;
  }
  .card .card-head .controls .segbtn{
    flex: 1 1 0;
    padding: 8px 0;
    font-size: 12px;
  }

  /* Toggles (Fibo / Ichi / Volume / RSI) alignés */
  .card .card-head .controls .ctl.inline{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;

    /* look "bouton" propre */
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148,163,184,0.14);
    background: rgba(255,255,255,0.03);
  }
  .card .card-head .controls .ctl.inline > span{
    margin: 0;
    font-size: 12px;
    opacity: .92;
  }
  .card .card-head .controls .ctl.inline .toggle{
    flex: 0 0 auto;
  }

  /* Le filtre prend toute la largeur (plus clean) */
  .card .card-head .controls .ctl:last-child{
    grid-column: 1 / -1;
  }
}



/* =========================================
   MOBILE CLEAN CONTROLS (compact, aligné)
   PC inchangé
========================================= */
@media (max-width: 560px){

  /* Block controls : grille propre */
  .card .card-head .controls{
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px 12px !important;
    align-items: center !important;
  }

  /* Tous les champs : même hauteur, moins de padding */
  .card .card-head .controls .ctl{
    min-width: 0 !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .card .card-head .controls .ctl > span{
    font-size: 11px !important;
    letter-spacing: .08em !important;
    opacity: .82 !important;
    margin: 0 0 6px 2px !important;
    line-height: 1.1 !important;
  }

  .card .card-head .controls select,
  .card .card-head .controls input[type="search"]{
    height: 40px !important;
    padding: 0 12px !important;
    border-radius: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* STYLE Courbe/Bougies : compact et aligné */
  .card .card-head .controls .seg{
    height: 40px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
  }
  .card .card-head .controls .segbtn{
    height: 40px !important;
    border-radius: 14px !important;
    padding: 0 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }

  /* ✅ TOGGLES : plus de pavés
     -> une seule ligne: label gauche / switch droite */
  .card .card-head .controls .ctl.inline{
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    align-items: center !important;

    height: 40px !important;
    padding: 0 10px !important;

    border-radius: 14px !important;
    border: 1px solid rgba(148,163,184,0.14) !important;
    background: rgba(255,255,255,0.03) !important;

    /* IMPORTANT: annule tout style "carte" hérité */
    box-shadow: none !important;
  }

  .card .card-head .controls .ctl.inline > span{
    margin: 0 !important;             /* supprime le label au-dessus */
    font-size: 12px !important;
    opacity: .88 !important;
    letter-spacing: .06em !important;
  }

  /* Switch plus petit, ne s’étire pas */
  .card .card-head .controls .ctl.inline .toggle{
    margin: 0 !important;
    transform: scale(0.90);
    transform-origin: right center;
  }

@media (max-width: 560px){
  /* Filtrer = dernier bloc DIRECT dans .controls */
  .card .card-head .controls > .ctl:last-child{
    grid-column: 1 / -1;
  }

  /* Sécurité: les 4 toggles restent en 2 colonnes */
  .card .card-head .controls .toggles4 > .ctl{
    grid-column: auto;
  }
}

/* ===== Bandeau défilant crypto ===== */
.ticker{
  margin: 10px 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.18);
  background: rgba(15,23,42,0.55);
  overflow: hidden;
}

.ticker__mask{
  overflow: hidden;
  padding: 10px 12px;
}

.ticker__track{
  --ticker-duration: 45s; /* + grand = + lent */
  display: flex;
  width: max-content;
  gap: 18px;
  align-items: center;
  will-change: transform;
  animation: tickerMove var(--ticker-duration) linear infinite;
}

.ticker:hover .ticker__track{
  animation-play-state: paused;
}

@keyframes tickerMove{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}

.ticker__run{
  display: inline-flex;
  gap: 18px;
  align-items: center;
}

.ticker__item{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(2,6,23,0.35);
  border: 1px solid rgba(148,163,184,0.16);
  white-space: nowrap;
}

.ticker__sym{
  font-weight: 800;
  letter-spacing: 0.2px;
  color: rgba(226,232,240,0.92);
}

.ticker__price{
  font-variant-numeric: tabular-nums;
  color: rgba(226,232,240,0.88);
}

.ticker__chg{
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.ticker__chg.pos{ color: rgba(134,239,172,0.95); }
.ticker__chg.neg{ color: rgba(251,113,133,0.95); }

@media (max-width: 900px){
  .ticker__mask{ padding: 8px 10px; }
  .ticker__item{ padding: 6px 8px; }
  .ticker{ border-radius: 12px; }
}
/* ===== Bandeau défilant crypto (FORCE horizontal) ===== */
.ticker{
  margin: 10px 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.18);
  background: rgba(15,23,42,0.55);
  overflow: hidden;
}

.ticker__mask{
  overflow: hidden;
  padding: 10px 12px;
}

/* IMPORTANT : pas de wrap */
.ticker__track{
  --ticker-duration: 40s;
  --ticker-shift: 600px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  white-space: nowrap;
  width: max-content;
  align-items: center;
  will-change: transform;
  animation: tickerMove var(--ticker-duration) linear infinite;
}

.ticker__run{
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: center;
  gap: 12px;
  padding-right: 12px;
}

/* IMPORTANT : item ne doit jamais s’étirer */
.ticker__item{
  display: inline-flex;
  flex: 0 0 auto;
  width: auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(2,6,23,0.35);
  border: 1px solid rgba(148,163,184,0.16);
  white-space: nowrap;
}

.ticker__sym{
  font-weight: 800;
  letter-spacing: 0.2px;
  color: rgba(226,232,240,0.92);
}

.ticker__price{
  font-variant-numeric: tabular-nums;
  color: rgba(226,232,240,0.88);
}

.ticker__chg{
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.ticker__chg.pos{ color: rgba(134,239,172,0.95); }
.ticker__chg.neg{ color: rgba(251,113,133,0.95); }

.ticker:hover .ticker__track{ animation-play-state: paused; }

@keyframes tickerMove{
  from{ transform: translateX(0); }
  to{ transform: translateX(calc(-1 * var(--ticker-shift))); }
}



