:root {
  --bg: #0b0f1a;
  --bg2: #101627;
  --card: #161d30;
  --card2: #1c2540;
  --accent: #f5c542;
  --accent2: #38b6ff;
  --text: #eef2ff;
  --muted: #8b94b0;
  --ok: #35d07f;
  --bad: #ff5c5c;
  --warn: #ffb020;
  --radius: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; overflow-x: hidden;
}
.hidden { display: none !important; }

/* Splash */
#splash {
  position: fixed; inset: 0; z-index: 50;
  background: radial-gradient(120% 120% at 50% 0%, #1a2440 0%, var(--bg) 60%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity .5s ease;
}
#splash.gone { opacity: 0; pointer-events: none; }
.splash-logo { text-align: center; animation: pop .6s ease; }
.logo-mark {
  width: 96px; height: 96px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 54px; font-weight: 900; color: #141414;
  background: linear-gradient(160deg, var(--accent), #e8a020);
  border-radius: 24px; box-shadow: 0 12px 40px rgba(245,197,66,.35);
}
.logo-text { font-size: 30px; font-weight: 900; letter-spacing: 2px; line-height: 1.05;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.splash-sub { margin-top: 14px; color: var(--muted); font-size: 13px; letter-spacing: 1px; }
@keyframes pop { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

/* Layout */
main { padding: 16px 16px 30px; max-width: 560px; margin: 0 auto; }
.view { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px);} to { opacity:1; transform:none;} }

.top { display: flex; align-items: center; gap: 12px; padding: 8px 0 16px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.top-title { font-size: 20px; font-weight: 800; flex: 1; }
.top-sub { color: var(--muted); font-size: 13px; }
.back { background: var(--card); color: var(--text); border: none; padding: 8px 12px; border-radius: 10px; font-size: 14px; }

/* Grid catégories */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cat-card {
  background: linear-gradient(160deg, var(--card), var(--card2));
  border: 1px solid rgba(255,255,255,.06); border-radius: var(--radius);
  padding: 18px 14px; cursor: pointer; transition: transform .12s;
}
.cat-card:active { transform: scale(.97); }
.cat-emoji { font-size: 30px; }
.cat-name { font-weight: 700; margin-top: 10px; font-size: 15px; }
.cat-count { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* Tool list */
.tool-list { display: flex; flex-direction: column; gap: 10px; }
.tool-item {
  background: var(--card); border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius); padding: 14px 16px; cursor: pointer; display: flex; align-items: center; gap: 12px;
}
.tool-item:active { background: var(--card2); }
.ti-icon { font-size: 22px; }
.ti-body { flex: 1; }
.ti-name { font-weight: 700; font-size: 15px; }
.ti-hint { color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.35; }
.ti-tag { font-size: 11px; padding: 3px 8px; border-radius: 20px; font-weight: 700; }
.tag-native { background: rgba(53,208,127,.16); color: var(--ok); }
.tag-web { background: rgba(56,182,255,.16); color: var(--accent2); }
.tag-cli { background: rgba(255,176,32,.16); color: var(--warn); }

/* Search */
.search-card { background: var(--card); border-radius: var(--radius); padding: 20px 16px; border: 1px solid rgba(255,255,255,.06); }
.tool-hint { color: var(--muted); font-size: 14px; line-height: 1.5; margin-bottom: 14px; }
.key-note { font-size: 12px; margin-bottom: 12px; }
.key-note.present { color: var(--ok); }
.key-note.missing { color: var(--warn); }
input {
  width: 100%; background: var(--bg2); border: 1px solid rgba(255,255,255,.1);
  color: var(--text); padding: 14px; border-radius: 12px; font-size: 16px; outline: none;
}
input:focus { border-color: var(--accent); }
.primary {
  width: 100%; margin-top: 14px; padding: 15px; border: none; border-radius: 12px;
  background: linear-gradient(90deg, var(--accent), #e8a020); color: #141414;
  font-weight: 800; font-size: 16px; cursor: pointer;
}
.primary:active { opacity: .85; }

/* Progress */
.progress { margin: 6px 0 16px; }
.bar { height: 10px; background: var(--card2); border-radius: 10px; overflow: hidden; }
#progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .4s ease; }
.progress-label { text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; }

/* Result */
.result { word-break: break-word; line-height: 1.5; font-size: 14px; }
.result .block { margin-bottom: 16px; }
.result pre { white-space: pre-wrap; font-family: inherit; }
.result .badge { display: inline-block; font-size: 11px; }
.result a { color: var(--accent2); }
.result-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.result-actions .btn2 {
  background: var(--card); color: var(--text); border: 1px solid rgba(255,255,255,.1);
  padding: 11px 16px; border-radius: 12px; font-size: 14px; cursor: pointer; flex: 1; text-align: center;
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--card2); color: var(--text); padding: 12px 18px; border-radius: 12px;
  font-size: 14px; opacity: 0; transition: .25s ease; z-index: 60; max-width: 90%; text-align: center;
  border: 1px solid rgba(255,255,255,.1);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
