  :root{
    --bg:#0a0a0a;
    --surface:#141414;
    --surface-2:#1c1c1a;
    --border:#2a2a27;
    --fg:#f5f5f0;
    --muted:#8a8a82;
    --accent:#d4af37;
    --accent-dim:#8a7226;
    --accent-fg:#0a0a0a;
    --danger:#c65b4a;
    --good:#5a9b6a;
    --radius:10px;
    --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  }
  [data-theme="light"]{
    --bg:#faf9f6;
    --surface:#ffffff;
    --surface-2:#f2f1eb;
    --border:#e2e0d6;
    --fg:#0f0f0d;
    --muted:#6b6a62;
    --accent:#a3801a;
    --accent-dim:#c9a227;
    --accent-fg:#faf9f6;
  }
  *{box-sizing:border-box; margin:0; padding:0;}
  html,body{height:100%;}
  body{
    background:var(--bg);
    color:var(--fg);
    font-family:var(--sans);
    -webkit-font-smoothing:antialiased;
    transition:background .25s ease, color .25s ease;
    min-height:100vh;
  }
  .app{max-width:1400px; margin:0 auto; padding:28px 24px 60px;}

  /* ---------- HEADER ---------- */
  header{
    display:flex; align-items:flex-start; justify-content:space-between;
    padding-bottom:22px; border-bottom:1px solid var(--border); margin-bottom:26px;
    gap:16px; flex-wrap:wrap;
  }
  .brand{display:flex; align-items:center; gap:14px;}
  .brand .mark{
    width:46px; height:46px; border-radius:10px;
    background:linear-gradient(155deg, var(--accent), var(--accent-dim));
    display:flex; align-items:center; justify-content:center;
    font-weight:900; font-size:20px; color:var(--accent-fg); letter-spacing:-1px;
    flex-shrink:0;
  }
  .brand h1{
    font-size:26px; font-weight:900; letter-spacing:-0.02em; line-height:1;
  }
  .brand .sub{
    color:var(--muted); font-size:11.5px; font-weight:700; letter-spacing:.16em; text-transform:uppercase; margin-top:5px;
  }
  .theme-toggle{
    display:flex; align-items:center; gap:8px; background:var(--surface);
    border:1px solid var(--border); border-radius:999px; padding:5px; height:40px;
  }
  .theme-toggle button{
    border:none; background:transparent; color:var(--muted); font-weight:700; font-size:12px;
    padding:7px 14px; border-radius:999px; cursor:pointer; font-family:var(--sans);
    letter-spacing:.03em; transition:all .15s ease;
  }
  .theme-toggle button.active{ background:var(--accent); color:var(--accent-fg); }

  /* ---------- STATS ---------- */
  .stats{display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:22px;}
  .stat{
    background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
    padding:16px 18px;
  }
  .stat .num{font-size:30px; font-weight:900; letter-spacing:-0.02em; font-variant-numeric:tabular-nums;}
  .stat .lbl{color:var(--muted); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; margin-top:4px;}
  .stat.accent .num{color:var(--accent);}

  /* ---------- MAIN GRID ---------- */
  .grid{display:grid; grid-template-columns:1.3fr 1fr; gap:18px; margin-bottom:18px; align-items:start;}
  @media (max-width:920px){ .grid{grid-template-columns:1fr;} }

  .panel{
    background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
    overflow:hidden; display:flex; flex-direction:column;
  }
  .panel-head{
    display:flex; align-items:center; justify-content:space-between; padding:14px 18px;
    border-bottom:1px solid var(--border); gap:10px; flex-wrap:wrap;
  }
  .panel-head h2{font-size:13px; font-weight:800; text-transform:uppercase; letter-spacing:.09em;}
  .panel-head .hint{font-size:11px; color:var(--muted); font-weight:600;}
  .panel-body{padding:16px 18px;}

  textarea{
    width:100%; resize:vertical; background:var(--surface-2); border:1px solid var(--border);
    border-radius:8px; color:var(--fg); font-family:var(--mono); font-size:13px; line-height:1.6;
    padding:14px; min-height:260px; outline:none; transition:border-color .15s ease;
  }
  textarea:focus{border-color:var(--accent);}
  textarea::placeholder{color:var(--muted);}

  /* ---------- BUTTONS ---------- */
  .btn{
    font-family:var(--sans); font-weight:700; font-size:12.5px; letter-spacing:.02em;
    border-radius:8px; border:1px solid var(--border); background:var(--surface-2); color:var(--fg);
    padding:9px 14px; cursor:pointer; display:inline-flex; align-items:center; gap:7px;
    transition:all .12s ease; white-space:nowrap;
  }
  .btn:hover{border-color:var(--accent); color:var(--accent);}
  .btn:active{transform:scale(.97);}
  .btn.primary{background:var(--accent); color:var(--accent-fg); border-color:var(--accent);}
  .btn.primary:hover{filter:brightness(1.08); color:var(--accent-fg);}
  .btn.small{padding:6px 11px; font-size:11.5px;}
  .btn:disabled{opacity:.35; cursor:not-allowed; pointer-events:none;}
  .btn-row{display:flex; gap:8px; flex-wrap:wrap;}

  /* ---------- LEADERBOARD ---------- */
  .leader-controls{display:flex; gap:8px; align-items:center;}
  .leaderboard{max-height:430px; overflow-y:auto;}
  .lb-row{
    display:flex; align-items:center; gap:12px; padding:10px 18px; border-bottom:1px solid var(--border);
    cursor:pointer; transition:background .1s ease;
  }
  .lb-row:hover{background:var(--surface-2);}
  .lb-row:last-child{border-bottom:none;}
  .lb-rank{
    width:22px; text-align:right; font-family:var(--mono); font-weight:800; font-size:13px; color:var(--muted); flex-shrink:0;
  }
  .lb-row.top .lb-rank{color:var(--accent); font-size:15px;}
  .lb-check{
    width:17px; height:17px; border-radius:5px; border:1.5px solid var(--border); flex-shrink:0;
    display:flex; align-items:center; justify-content:center; background:var(--surface-2);
  }
  .lb-check.checked{background:var(--accent); border-color:var(--accent); color:var(--accent-fg); font-weight:900; font-size:11px;}
  .lb-domain{flex:1; font-weight:700; font-size:13.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .lb-count{
    font-family:var(--mono); font-weight:800; font-size:12.5px; color:var(--muted);
    background:var(--surface-2); border:1px solid var(--border); border-radius:999px; padding:2px 9px; flex-shrink:0;
  }
  .lb-row.top .lb-count{color:var(--accent); border-color:var(--accent-dim);}
  .empty-state{padding:40px 18px; text-align:center; color:var(--muted); font-size:13px; font-weight:600;}

  /* ---------- OUTPUT TOOLBAR ---------- */
  .toolbar{display:flex; gap:8px; flex-wrap:wrap; align-items:center;}
  .field{
    background:var(--surface-2); border:1px solid var(--border); border-radius:8px;
    padding:8px 12px; font-family:var(--sans); font-size:12.5px; color:var(--fg); outline:none;
    font-weight:600; min-width:200px;
  }
  .field:focus{border-color:var(--accent);}
  .field::placeholder{color:var(--muted);}
  .divider-v{width:1px; align-self:stretch; background:var(--border); margin:0 2px;}

  .output-box{
    background:var(--surface-2); border:1px solid var(--border); border-radius:8px; min-height:300px;
    max-height:460px; overflow-y:auto; font-family:var(--mono); font-size:13px;
  }
  .out-line{
    display:flex; padding:5px 14px; border-bottom:1px solid var(--border);
  }
  .out-line:last-child{border-bottom:none;}
  .out-idx{color:var(--muted); width:44px; flex-shrink:0; font-weight:700; text-align:right; margin-right:14px;}
  .out-email{word-break:break-all;}

  .toast{
    position:fixed; bottom:26px; left:50%; transform:translateX(-50%) translateY(20px);
    background:var(--accent); color:var(--accent-fg); font-weight:800; font-size:12.5px;
    padding:11px 22px; border-radius:999px; opacity:0; transition:all .25s ease; pointer-events:none;
    letter-spacing:.02em; box-shadow:0 8px 24px rgba(0,0,0,.3);
  }
  .toast.show{opacity:1; transform:translateX(-50%) translateY(0);}

  ::-webkit-scrollbar{width:9px;}
  ::-webkit-scrollbar-track{background:transparent;}
  ::-webkit-scrollbar-thumb{background:var(--border); border-radius:6px;}
  ::-webkit-scrollbar-thumb:hover{background:var(--accent-dim);}

  /* ---------- MOBILE RESPONSIVE ---------- */
  @media (max-width:640px){
    .app{padding:18px 14px 40px;}
    header{padding-bottom:16px; margin-bottom:18px;}
    .brand h1{font-size:21px;}
    .brand .mark{width:38px; height:38px; font-size:17px;}
    .stats{grid-template-columns:repeat(2,1fr); gap:9px;}
    .stat{padding:12px 14px;}
    .stat .num{font-size:24px;}
    .panel-head{padding:12px 14px;}
    .panel-body{padding:12px 14px;}
    textarea{min-height:200px; font-size:12.5px;}
    .toolbar{gap:6px;}
    .field{min-width:0; flex:1 1 140px;}
    .divider-v{display:none;}
    .btn{padding:8px 12px; font-size:12px;}
    .output-box{max-height:360px;}
    .lb-domain{font-size:12.5px;}
    .theme-toggle{height:36px;}
  }
  @media (max-width:400px){
    .stats{grid-template-columns:1fr 1fr;}
    .brand h1{font-size:19px;}
  }
