/*
 * KeyMint — feuille de style commune (téléphone + PC).
 * Palette inspirée d'OKX : noir pur, blanc, échelle de gris, aucune couleur
 * décorative. La couleur n'est utilisée que pour porter une INFORMATION
 * (le niveau d'entropie), jamais pour décorer.
 */

:root{
  color-scheme:dark;
  --bg:#000000;
  --surface:#101010;
  --surface2:#181818;
  --border:#1f1f1f;
  --border-strong:#2e2e2e;
  --text:#ffffff;
  --text2:#6b6b6b;
  --text3:#a8a8a8;
  --green:#00d094;
  --amber:#f5a623;
  --red:#ff4d4f;
}
*{box-sizing:border-box;margin:0;padding:0;}
::-webkit-scrollbar{width:6px;}
::-webkit-scrollbar-track{background:transparent;}
::-webkit-scrollbar-thumb{background:#2a2a2a;border-radius:3px;}
::-webkit-scrollbar-thumb:hover{background:#3a3a3a;}
html,body{height:100%;}
body{
  background:var(--bg);color:var(--text);
  font-family:'Segoe UI',system-ui,-apple-system,sans-serif;font-size:14px;line-height:1.5;
  overflow-x:hidden;-webkit-text-size-adjust:100%;
}

.wrap{
  position:relative;max-width:520px;margin:0 auto;
  padding:26px 18px calc(22px + env(safe-area-inset-bottom));
}

/* ---------------------------------------------------------------- header */
header{display:flex;align-items:center;gap:12px;margin-bottom:20px;}
.logo{width:40px;height:40px;border-radius:12px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  background:#fff;color:#000;}
.logo svg{width:26px;height:auto;}
header h1{font-size:20px;font-weight:700;letter-spacing:-0.3px;}

/* ------------------------------------------------------------------ cards */
.card{background:var(--surface);border:1px solid var(--border);border-radius:16px;
  padding:18px;margin-bottom:10px;}

/* ------------------------------------------------------------------- tabs */
.tabs{display:flex;gap:4px;background:var(--surface);border:1px solid var(--border);
  border-radius:14px;padding:4px;margin-bottom:10px;}
.tab{flex:1;border:none;background:none;color:var(--text2);font-family:inherit;font-size:13.5px;font-weight:600;
  padding:9px 8px;border-radius:10px;cursor:pointer;transition:background .18s,color .18s;}
.tab:hover{color:var(--text3);}
.tab.active{background:#fff;color:#000;}

/* ----------------------------------------------------------------- sortie */
.out-card{padding:16px;}
.out{
  display:block;width:100%;min-height:78px;
  font-family:'Cascadia Mono',ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:19px;line-height:1.5;letter-spacing:0.5px;word-break:break-all;
  color:#fff;background:var(--bg);border:1px solid var(--border);border-radius:12px;
  padding:14px;-webkit-user-select:all;user-select:all;
}
.out.phrase{word-break:normal;overflow-wrap:break-word;letter-spacing:0;font-size:18px;}
.out-actions{display:flex;gap:8px;margin-top:10px;}
.btn{flex:1;display:flex;align-items:center;justify-content:center;gap:7px;
  border:none;border-radius:12px;padding:12px;cursor:pointer;
  font-family:inherit;font-size:14px;font-weight:600;transition:background .18s,color .18s,border-color .18s;}
.btn svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;}
.btn.primary{background:#fff;color:#000;}
.btn.primary:hover{background:#d9d9d9;}
.btn.ghost{background:var(--surface2);border:1px solid var(--border-strong);color:var(--text3);}
.btn.ghost:hover{color:#fff;border-color:#454545;}
.btn:active{opacity:.85;}

/* ------------------------------------------------------------------ force */
.strength-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:10px;}
.bits{font-size:22px;font-weight:700;letter-spacing:-0.4px;
  font-family:ui-monospace,Consolas,monospace;}
.verdict{font-size:11.5px;font-weight:700;letter-spacing:1.2px;text-transform:uppercase;}
.meter{height:4px;border-radius:2px;background:#1f1f1f;overflow:hidden;}
.meter-fill{height:100%;width:0;border-radius:2px;background:#fff;
  transition:width .3s ease,background .3s ease;}
.crack{margin-top:11px;font-size:13px;color:var(--text3);}
.crack strong{color:#fff;font-weight:600;}
.quantum{margin-top:4px;}
.quantum span{font-weight:600;}
.hypo{margin-top:5px;font-size:11px;color:var(--text2);line-height:1.45;}

/* --------------------------------------------------------------- réglages */
.row{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;}
.row label{font-size:13.5px;font-weight:600;color:var(--text3);}
.value{font-family:ui-monospace,Consolas,monospace;font-size:15px;font-weight:700;color:#fff;}

input[type=range]{-webkit-appearance:none;appearance:none;width:100%;height:4px;border-radius:2px;
  background:#2a2a2a;outline:none;}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:18px;height:18px;border-radius:50%;
  background:#fff;cursor:pointer;border:none;}
input[type=range]::-moz-range-thumb{width:18px;height:18px;border-radius:50%;border:none;
  background:#fff;cursor:pointer;}

.sep-block{margin-top:18px;}
.chips{display:flex;gap:6px;flex-wrap:wrap;}
.chip{background:var(--surface2);border:1px solid var(--border-strong);color:var(--text2);
  font-family:inherit;font-size:12.5px;font-weight:600;padding:7px 13px;border-radius:9px;
  cursor:pointer;transition:background .16s,color .16s,border-color .16s;}
.chip:hover{color:var(--text3);}
.chip.active{background:#fff;border-color:#fff;color:#000;}

/* --------------------------------------------------------------- symboles */
.sym-block{margin-top:18px;border-top:1px solid var(--border);padding-top:15px;}
.disclosure{width:100%;display:flex;justify-content:space-between;align-items:center;
  background:none;border:none;color:var(--text3);font-family:inherit;font-size:13.5px;font-weight:600;
  cursor:pointer;padding:2px 0;}
.disclosure em{font-style:normal;color:var(--text2);font-size:12.5px;margin-left:6px;
  font-family:ui-monospace,Consolas,monospace;}
.disclosure svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2.2;transition:transform .2s;}
.disclosure[aria-expanded=true] svg{transform:rotate(180deg);}

.sym-panel{margin-top:14px;}
.sym-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:6px;}
/* Hauteur fixe plutôt que des cases carrées : une case carrée de 54 px pour un
   seul caractère gonflait la page de 80 px sans rien apporter à la lisibilité. */
.sym{height:34px;display:flex;align-items:center;justify-content:center;
  background:var(--surface2);border:1px solid var(--border-strong);border-radius:8px;
  font-family:ui-monospace,Consolas,monospace;font-size:15px;color:var(--text2);
  cursor:pointer;transition:background .14s,color .14s,border-color .14s;user-select:none;}
.sym:hover{color:var(--text3);border-color:#454545;}
.sym.on{background:#fff;border-color:#fff;color:#000;}
.sym-actions{display:flex;gap:6px;margin-top:10px;}
.mini{flex:1;background:none;border:1px solid var(--border-strong);color:var(--text2);
  font-family:inherit;font-size:12px;font-weight:600;padding:7px;border-radius:8px;
  cursor:pointer;transition:color .16s,border-color .16s;}
.mini:hover{color:#fff;border-color:#555;}

/* ------------------------------------------------------------------ divers */
.toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,16px);z-index:10;
  background:#fff;color:#000;
  padding:11px 18px;border-radius:11px;font-size:13px;font-weight:600;
  opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;max-width:88vw;text-align:center;}
.toast.show{opacity:1;transform:translate(-50%,0);}

/* Signature de marque : discrète, elle ne doit jamais concurrencer l'app. */
.brand{display:flex;justify-content:center;margin-top:22px;}
.brand img{height:15px;width:auto;display:block;opacity:.3;transition:opacity .25s;}
.brand img:hover{opacity:.55;}

[hidden]{display:none !important;}
