[hidden] { display: none !important; }
:root {
  --bg: #0b0f14; --panel: #121821; --panel2: #1a2330; --line: #243042;
  --tx: #e6edf5; --tx2: #93a3b5; --acc: #3b82f6; --green: #22c55e; --yellow: #f59e0b; --red: #ef4444;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--tx); font-family: -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14px; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { background: var(--panel2); border: 1px solid var(--line); color: var(--tx); border-radius: 8px; padding: 9px 12px; font-size: 14px; width: 100%; font-family: inherit; }
input:focus, textarea:focus, select:focus { outline: 1px solid var(--acc); }
label { display: block; font-size: 12px; color: var(--tx2); margin: 12px 0 4px; }
code { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; }

/* LOGIN */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 36px 28px; width: 360px; text-align: center; }
.login-logo { font-size: 42px; }
.login-card h1 { margin: 8px 0 4px; }
.login-sub { color: var(--tx2); font-size: 13px; margin-bottom: 20px; }
.login-card input { margin-bottom: 12px; text-align: center; }
.err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }
.opt { font-weight: 400; }

/* APP */
.app { max-width: 1100px; margin: 0 auto; padding: 16px 20px 60px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.tb-left { display: flex; align-items: center; gap: 10px; }
.tb-logo { font-size: 24px; }
.tb-title { font-weight: 700; font-size: 17px; }
.tb-me { color: var(--tx2); font-size: 13px; }
.tb-right { display: flex; align-items: center; gap: 8px; }
.chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 20px; padding: 5px 12px; font-size: 12.5px; }
.chip-green { border-color: var(--green); color: var(--green); }
.chip-yellow { border-color: var(--yellow); color: var(--yellow); }
.btn { border: none; border-radius: 8px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; }
.btn-primary { background: var(--acc); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--tx2); }

.filters { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { background: var(--panel); border: 1px solid var(--line); color: var(--tx2); border-radius: 20px; padding: 6px 13px; font-size: 13px; }
.tab.active { background: var(--acc); border-color: var(--acc); color: #fff; }
.search { width: 260px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.row { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; display: flex; justify-content: space-between; gap: 10px; transition: border-color .15s; }
.row:hover { border-color: var(--acc); }
.row-main { flex: 1; cursor: pointer; }
.row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.username { font-weight: 700; font-size: 15px; }
.who { color: var(--tx2); font-size: 12px; }
.status { border-radius: 20px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.st-hunting { background: rgba(245,158,11,.15); color: var(--yellow); }
.st-solved { background: rgba(34,197,94,.15); color: var(--green); }
.st-dead { background: rgba(239,68,68,.15); color: var(--red); }
.st-phone { background: rgba(59,130,246,.15); color: #60a5fa; }
.st-dropped { background: rgba(147,163,181,.15); color: var(--tx2); }
.row-mask { margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mb { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; font-size: 11.5px; color: var(--tx2); }
.mb-hint { border-color: #334155; color: #93c5fd; }
.solved-email { margin-top: 6px; color: var(--green); font-size: 13.5px; }
.row-meta { margin-top: 6px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--tx2); }
.exp { border-radius: 6px; padding: 2px 7px; font-size: 11.5px; }
.exp-ok { background: var(--panel2); color: var(--tx2); }
.exp-soon { background: rgba(245,158,11,.15); color: var(--yellow); }
.exp-dead { background: rgba(239,68,68,.15); color: var(--red); }
.cand { color: var(--tx2); }
.row-actions { display: flex; flex-direction: column; gap: 6px; }
.mini { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 13px; }
.empty { text-align: center; color: var(--tx2); padding: 50px 0; }

/* MODAL */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; z-index: 50; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; width: 440px; max-height: 85vh; overflow: auto; }
.modal-card h2 { margin-bottom: 4px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.mask-hint { margin-top: 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; color: var(--tx2); }
.sug { margin-top: 4px; color: #93c5fd; }

/* DRAWER */
.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; justify-content: flex-end; z-index: 50; }
.drawer-card { background: var(--panel); border-left: 1px solid var(--line); width: 520px; max-width: 95vw; height: 100%; overflow: auto; padding: 20px 22px; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.drawer-head h2 { font-size: 19px; }
.drawer-head a { color: var(--acc); font-size: 13px; text-decoration: none; }
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.d-field { margin-bottom: 6px; }
.d-field label { font-size: 11.5px; margin-top: 10px; }
.cand-add { display: flex; gap: 6px; margin-top: 8px; }
.cand-add input { flex: 1; }
.cand-row { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; margin-top: 6px; flex-wrap: wrap; }
.cand-result { font-size: 12px; border-radius: 12px; padding: 2px 8px; background: rgba(147,163,181,.15); color: var(--tx2); }
.logs { margin-top: 6px; }
.log-row { font-size: 12.5px; color: var(--tx2); border-bottom: 1px solid var(--line); padding: 6px 0; }
.log-at { color: #64748b; margin-right: 6px; }
.muted { color: var(--tx2); font-size: 13px; }
h3 { margin: 18px 0 6px; font-size: 14.5px; }
#dSave { margin-top: 14px; }

/* ---- v2 additions ---- */
.select { width: auto; min-width: 130px; padding: 8px 12px; }
.copybtn { background: transparent; border: none; color: var(--tx2); font-size: 13px; padding: 1px 5px; border-radius: 5px; }
.copybtn:hover { background: var(--panel2); color: #93c5fd; }
.via { color: var(--tx2); font-size: 12px; margin-left: 6px; }
.btn-danger { background: var(--red); color: #fff; }
.confirm-card { width: 360px; }
#liveDot { color: var(--green); font-size: 11.5px; opacity: .9; }
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--acc); border-radius: 10px; padding: 11px 16px; font-size: 13.5px; z-index: 100; box-shadow: 0 6px 24px rgba(0,0,0,.5); animation: slidein .2s ease; max-width: 340px; }
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .3s; }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.d-code { display: flex; align-items: center; gap: 6px; }
.cand-result.r-match { background: rgba(34,197,94,.15); color: var(--green); }
.cand-result.r-kc { background: rgba(59,130,246,.15); color: #60a5fa; }
.cand-result.r-nf { background: rgba(239,68,68,.15); color: var(--red); }
.cand-result.r-rl { background: rgba(245,158,11,.15); color: var(--yellow); }
.cand-result.r-other { background: rgba(147,163,181,.15); color: var(--tx2); }
@media (max-width: 720px) {
  .app { padding: 10px 12px 40px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .tb-right { width: 100%; flex-wrap: wrap; }
  .search { width: 100%; }
  .d-grid { grid-template-columns: 1fr; }
}
