:root {
    --primary: #7C3AED;
    --primary-600: #6D28D9;
    --primary-700: #5B21B6;
    --primary-300: #C4B5FD;
    --primary-50: #F5F3FF;
    --grad: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 55%, #6D28D9 100%);
    --grad-soft: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);

    --bg: #F6F5FB;
    --surface: #FFFFFF;
    --border: #ECEAF3;
    --border-strong: #E0DCEE;

    --text: #1B1530;
    --text-muted: #6B6680;
    --text-subtle: #9D98AC;

    --green: #16A34A;
    --green-bg: #E9F8EF;
    --red: #DC2626;
    --red-bg: #FDECEC;
    --amber: #D97706;
    --amber-bg: #FEF3E2;
    --slate: #64748B;
    --slate-bg: #EEF1F6;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(27,21,48,.05), 0 1px 3px rgba(27,21,48,.04);
    --shadow-md: 0 4px 16px rgba(27,21,48,.06), 0 2px 6px rgba(27,21,48,.04);
    --shadow-lg: 0 12px 40px rgba(91,33,182,.14);
    --sidebar-w: 264px;

    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; }
  body {
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
  }
  button { font-family: inherit; cursor: pointer; border: none; background: none; }
  a { color: inherit; text-decoration: none; }
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb { background: #DDD8EA; border-radius: 8px; border: 3px solid var(--bg); }
  ::-webkit-scrollbar-thumb:hover { background: #CBC4DE; }

  .app { display: flex; height: 100vh; overflow: hidden; }

  /* ============ SIDEBAR ============ */
  .sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  .logo {
    display: flex; align-items: center; gap: 11px;
    padding: 22px 20px 18px;
  }
  .logo-mark {
    width: 38px; height: 38px; border-radius: 11px;
    background: var(--grad);
    display: grid; place-items: center;
    box-shadow: 0 4px 12px rgba(124,58,237,.32);
    flex-shrink: 0;
  }
  .logo-mark svg { width: 21px; height: 21px; color: #fff; }
  .logo-name { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
  .logo-name b { color: var(--primary); }

  .nav {
    flex: 1;
    overflow-y: auto;
    padding: 6px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .nav-label {
    font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    color: var(--text-subtle);
    padding: 14px 12px 6px;
  }
  .nav-item {
    display: flex; align-items: center; gap: 11px;
    width: 100%;
    padding: 9.5px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px; font-weight: 600;
    text-align: left;
    position: relative;
    transition: background .14s, color .14s;
  }
  .nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
  .nav-item .chev { margin-left: auto; width: 15px; height: 15px; transition: transform .2s; color: var(--text-subtle); }
  .nav-item:hover { background: var(--primary-50); color: var(--text); }
  .nav-item.active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(124,58,237,.28); }
  .nav-item.active .chev { color: rgba(255,255,255,.85); }
  .nav-item.open .chev { transform: rotate(180deg); }

  .subnav {
    display: none;
    flex-direction: column;
    gap: 1px;
    margin: 2px 0 4px 0;
    padding-left: 30px;
  }
  .subnav.show { display: flex; }
  .subnav-item {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 13px; font-weight: 500;
    text-align: left;
    position: relative;
  }
  .subnav-item::before {
    content: ""; position: absolute; left: -16px; top: 0; bottom: 0;
    width: 1.5px; background: var(--border-strong);
  }
  .subnav-item:hover { background: var(--primary-50); color: var(--text); }
  .subnav-item.active { color: var(--primary); background: var(--primary-50); font-weight: 600; }
  .subnav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .4; }
  .subnav-item.active .dot { opacity: 1; }

  .sidebar-bottom { padding: 12px 14px 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
  .credit-card {
    margin: 10px 4px 4px;
    padding: 15px;
    border-radius: var(--radius);
    background: var(--grad);
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
  }
  .credit-card::after {
    content: ""; position: absolute; right: -28px; top: -28px;
    width: 90px; height: 90px; border-radius: 50%;
    background: rgba(255,255,255,.12);
  }
  .credit-card .cc-label { font-size: 12px; font-weight: 500; opacity: .85; display: flex; align-items: center; gap: 6px; }
  .credit-card .cc-num { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 3px 0 12px; }
  .credit-card .cc-btn {
    width: 100%; padding: 9px; border-radius: 9px;
    background: #fff; color: var(--primary-700);
    font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: transform .12s, box-shadow .12s;
  }
  .credit-card .cc-btn svg { width: 15px; height: 15px; }
  .credit-card .cc-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.18); }
  .credit-card .cc-btn:active { transform: translateY(0); }

  /* ============ MAIN ============ */
  .main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100%; }

  .topbar {
    height: 66px; flex-shrink: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px;
    padding: 0 44px;
    position: sticky; top: 0; z-index: 30;
  }
  .page-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
  .page-sub { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-top: 1px; white-space: nowrap; }
  .topbar > div:first-child { flex-shrink: 0; }

  .search {
    margin-left: 20px;
    flex: 1; max-width: 420px;
    display: flex; align-items: center; gap: 9px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 13px;
    color: var(--text-subtle);
  }
  .search svg { width: 16px; height: 16px; }
  .search input { border: none; background: none; outline: none; flex: 1; font-family: inherit; font-size: 13.5px; color: var(--text); }
  .search kbd { font-size: 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; font-family: inherit; color: var(--text-subtle); }

  .topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
  .icon-btn {
    width: 40px; height: 40px; border-radius: 11px;
    display: grid; place-items: center;
    color: var(--text-muted);
    position: relative;
    transition: background .14s, color .14s;
  }
  .icon-btn svg { width: 19px; height: 19px; }
  .icon-btn:hover { background: var(--primary-50); color: var(--primary); }
  .icon-btn .badge {
    position: absolute; top: 7px; right: 8px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--red); border: 2px solid var(--surface);
  }

  .profile {
    display: flex; align-items: center; gap: 9px;
    padding: 5px 9px 5px 6px;
    border-radius: 12px;
    transition: background .14s;
  }
  .profile:hover { background: var(--primary-50); }
  .avatar {
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--grad);
    display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: 13px;
    flex-shrink: 0;
  }
  .profile-meta { line-height: 1.25; text-align: left; }
  .profile-meta .pn { font-size: 13.5px; font-weight: 700; }
  .profile-meta .pe { font-size: 11.5px; color: var(--text-muted); }
  .profile .chev { width: 16px; height: 16px; color: var(--text-subtle); }

  .dropdown {
    position: absolute; top: 60px; right: 0;
    width: 248px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 7px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .16s, transform .16s, visibility .16s;
    z-index: 50;
  }
  .dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
  .dd-head { padding: 11px 12px 12px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
  .dd-head .avatar { width: 40px; height: 40px; border-radius: 11px; font-size: 15px; }
  .dd-head .pn { font-size: 14px; font-weight: 700; }
  .dd-head .pe { font-size: 12px; color: var(--text-muted); }
  .dd-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; border-radius: 9px; color: var(--text-muted); font-size: 13.5px; font-weight: 600; text-align: left; }
  .dd-item svg { width: 17px; height: 17px; }
  .dd-item:hover { background: var(--primary-50); color: var(--text); }
  .dd-item.danger:hover { background: var(--red-bg); color: var(--red); }
  .dd-sep { height: 1px; background: var(--border); margin: 6px 4px; }

  .notif-panel {
    position: absolute; top: 60px; right: 56px;
    width: 340px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .16s, transform .16s, visibility .16s;
    z-index: 50;
    overflow: hidden;
  }
  .notif-panel.show { opacity: 1; visibility: visible; transform: translateY(0); }
  .notif-head { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
  .notif-head h4 { font-size: 14px; font-weight: 700; }
  .notif-head span { font-size: 12px; color: var(--primary); font-weight: 600; cursor: pointer; }
  .notif-list { max-height: 340px; overflow-y: auto; }
  .notif { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
  .notif:hover { background: var(--bg); }
  .notif .ni { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
  .notif .ni svg { width: 16px; height: 16px; }
  .ni.g { background: var(--green-bg); color: var(--green); }
  .ni.p { background: var(--primary-50); color: var(--primary); }
  .ni.a { background: var(--amber-bg); color: var(--amber); }
  .notif .nt { font-size: 13px; font-weight: 600; line-height: 1.4; }
  .notif .nm { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
  .notif .ns { font-size: 11px; color: var(--text-subtle); margin-top: 4px; }

  /* ============ CONTENT ============ */
  .content { flex: 1; overflow-y: auto; padding: 28px 44px; }
  .view { display: none; animation: fade .25s ease; }
  .view.active { display: block; }
  @keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

  .row { display: flex; align-items: center; gap: 12px; }
  .btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 10px;
    font-weight: 700; font-size: 13.5px;
    transition: transform .12s, box-shadow .12s, background .14s;
  }
  .btn svg { width: 16px; height: 16px; }
  .btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(124,58,237,.26); }
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(124,58,237,.32); }
  .btn-primary:active { transform: translateY(0); }
  .btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
  .btn-ghost:hover { background: var(--bg); border-color: var(--primary-300); color: var(--primary); }

  /* stat cards */
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
  .stat {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
  }
  .stat .top { display: flex; align-items: center; justify-content: space-between; }
  .stat .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
  .stat .ic svg { width: 19px; height: 19px; }
  .stat .delta { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 20px; }
  .delta.up { background: var(--green-bg); color: var(--green); }
  .delta.down { background: var(--red-bg); color: var(--red); }
  .stat .num { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 14px; }
  .stat .lab { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

  .card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
  }
  .card-head { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
  .card-head h3 { font-size: 15.5px; font-weight: 700; }
  .card-head p { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
  .grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }

  /* table */
  table { width: 100%; border-collapse: collapse; }
  thead th {
    text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-subtle); padding: 12px 20px; border-bottom: 1px solid var(--border);
  }
  tbody td { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
  tbody tr:last-child td { border-bottom: none; }
  tbody tr:hover { background: var(--bg); }
  .email-cell { font-weight: 600; }
  .pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 700; }
  .pill svg { width: 13px; height: 13px; }
  .pill.valid { background: var(--green-bg); color: var(--green); }
  .pill.invalid { background: var(--red-bg); color: var(--red); }
  .pill.catchall { background: var(--amber-bg); color: var(--amber); }
  .pill.unknown { background: var(--slate-bg); color: var(--slate); }
  .muted { color: var(--text-muted); }

  /* tabs */
  .tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 5px; margin-bottom: 20px; width: fit-content; box-shadow: var(--shadow-sm); }
  .tab { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); }
  .tab svg { width: 16px; height: 16px; }
  .tab:hover { color: var(--text); background: var(--bg); }
  .tab.active { background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,.24); }
  .tabpane { display: none; }
  .tabpane.active { display: block; animation: fade .2s ease; }

  /* verify single */
  .verify-box { max-width: 720px; }
  .verify-input-row { display: flex; gap: 12px; }
  .field {
    flex: 1; display: flex; align-items: center; gap: 11px;
    background: var(--surface); border: 1.5px solid var(--border-strong);
    border-radius: 12px; padding: 13px 16px;
    transition: border-color .14s, box-shadow .14s;
  }
  .field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
  .field svg { width: 18px; height: 18px; color: var(--text-subtle); }
  .field input { border: none; outline: none; background: none; flex: 1; font-family: inherit; font-size: 15px; color: var(--text); }

  /* result detail */
  .result-detail { margin-top: 20px; max-width: 720px; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow-md); }
  .rd-top { padding: 20px; display: flex; align-items: center; gap: 16px; background: var(--grad-soft); border-bottom: 1px solid var(--border); }
  .rd-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(22,163,74,.3); }
  .rd-icon svg { width: 26px; height: 26px; }
  .rd-top .em { font-size: 18px; font-weight: 800; }
  .rd-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
  .rd-cell { padding: 16px 20px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
  .rd-cell:nth-child(2n) { border-right: none; }
  .rd-cell .k { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); }
  .rd-cell .v { font-size: 14.5px; font-weight: 600; margin-top: 5px; display: flex; align-items: center; gap: 7px; }
  .check-ic { color: var(--green); }
  .x-ic { color: var(--red); }

  /* upload */
  .dropzone {
    max-width: 720px;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius); padding: 48px 30px;
    text-align: center; background: var(--surface);
    transition: border-color .16s, background .16s;
  }
  .dropzone:hover { border-color: var(--primary-300); background: var(--primary-50); }
  .dz-icon { width: 60px; height: 60px; border-radius: 16px; background: var(--grad-soft); display: grid; place-items: center; margin: 0 auto 16px; }
  .dz-icon svg { width: 28px; height: 28px; color: var(--primary); }
  .dropzone h3 { font-size: 17px; font-weight: 700; }
  .dropzone p { font-size: 13.5px; color: var(--text-muted); margin: 6px 0 18px; }
  .dz-formats { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
  .fmt { font-size: 11.5px; font-weight: 700; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: 5px 10px; display: flex; align-items: center; gap: 6px; }
  .fmt svg { width: 13px; height: 13px; color: var(--primary); }

  /* progress for catch-all */
  .progress-card { max-width: 720px; }
  .progressbar { height: 8px; background: var(--bg); border-radius: 20px; overflow: hidden; }
  .progressbar i { display: block; height: 100%; width: 68%; background: var(--grad); border-radius: 20px; }

  .empty-soon { max-width: 720px; padding: 50px; text-align: center; }
  .empty-soon .si { width: 56px; height: 56px; border-radius: 15px; background: var(--grad-soft); display: grid; place-items: center; margin: 0 auto 14px; }
  .empty-soon .si svg { width: 26px; height: 26px; color: var(--primary); }
  .empty-soon h3 { font-size: 17px; font-weight: 700; }
  .empty-soon p { font-size: 13.5px; color: var(--text-muted); margin-top: 6px; }
  .tbl-empty { text-align: center; padding: 44px 24px; }
  .tbl-empty .te-ic { width: 54px; height: 54px; border-radius: 15px; background: var(--grad-soft); display: grid; place-items: center; margin: 0 auto 14px; }
  .tbl-empty .te-ic svg { width: 25px; height: 25px; color: var(--primary); }
  .tbl-empty .te-t { font-size: 16px; font-weight: 700; }
  .tbl-empty .te-s { font-size: 13px; color: var(--text-muted); margin-top: 6px; max-width: 380px; margin-left: auto; margin-right: auto; line-height: 1.55; }

  .seg { display: flex; gap: 7px; }

  /* bulk upload flow */
  .flow-steps { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 18px; }
  .flow-bar { height: 3px; background: var(--grad); }
  .stepper { display: flex; align-items: center; padding: 16px 22px; }
  .step { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text-subtle); white-space: nowrap; }
  .step-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--text-subtle); font-weight: 700; font-size: 13px; border: 1.5px solid var(--border-strong); }
  .step.active { color: var(--primary); }
  .step.active .step-num { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 10px rgba(124,58,237,.3); }
  .step-line { flex: 1; height: 2px; background: var(--border-strong); margin: 0 18px; border-radius: 2px; min-width: 30px; }

  .uc-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
  .uc-ic svg { width: 19px; height: 19px; }

  .dropzone-lg { border: 2px dashed var(--primary-300); border-radius: 14px; background: var(--primary-50); padding: 44px 30px; text-align: center; transition: background .15s, border-color .15s; cursor: pointer; }
  .dropzone-lg:hover { background: #EFEAFE; border-color: var(--primary); }
  .dz-up { width: 58px; height: 58px; border-radius: 14px; background: #fff; display: grid; place-items: center; margin: 0 auto 16px; box-shadow: var(--shadow-sm); }
  .dz-up svg { width: 24px; height: 24px; color: var(--primary); }
  .dropzone-lg h3 { font-size: 18px; font-weight: 700; }
  .dropzone-lg .sub { color: var(--text-muted); font-size: 13.5px; margin-top: 5px; }
  .dz-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center; margin-top: 18px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }

  .info-banner { display: flex; align-items: center; gap: 10px; background: var(--primary-50); border: 1px solid #E4DCFB; border-radius: 12px; padding: 13px 16px; margin-top: 16px; font-size: 13px; font-weight: 500; color: var(--primary-700); }
  .info-banner svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--primary); }

  .hist-table th { white-space: nowrap; }
  .status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; padding: 4px 11px; border-radius: 20px; }
  .status .sdot { width: 7px; height: 7px; border-radius: 50%; }
  .status.g { background: var(--green-bg); color: var(--green); }
  .status.g .sdot { background: var(--green); }
  .status.p { background: var(--primary-50); color: var(--primary); }
  .status.p .sdot { background: var(--primary); }
  .actions { display: flex; align-items: center; gap: 7px; justify-content: flex-end; }
  .btn-dl { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 12.5px; font-weight: 700; color: var(--text); }
  .btn-dl svg { width: 14px; height: 14px; }
  .btn-dl:hover { border-color: var(--primary-300); color: var(--primary); background: var(--primary-50); }
  .eye { width: 34px; height: 34px; border: 1px solid var(--border-strong); border-radius: 9px; }

  /* download dropdown */
  .dl-wrap { position: relative; display: inline-block; }
  .dl-toggle { cursor: pointer; }
  .dl-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 184px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 45; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .14s, transform .14s, visibility .14s; }
  .dl-wrap.open .dl-menu { opacity: 1; visibility: visible; transform: none; }
  .dl-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 11px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); text-align: left; }
  .dl-menu button:hover { background: var(--primary-50); color: var(--text); }
  .dl-menu .mdot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .dl-menu .sep { height: 1px; background: var(--border); margin: 5px 6px; }
  .btn-view { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 12.5px; font-weight: 700; color: var(--text); cursor: pointer; }
  .btn-view svg { width: 14px; height: 14px; }
  .btn-view:hover { border-color: var(--primary-300); color: var(--primary); background: var(--primary-50); }

  /* history search */
  .hist-search { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; color: var(--text-subtle); width: 240px; }
  .hist-search svg { width: 15px; height: 15px; }
  .hist-search input { border: none; background: none; outline: none; flex: 1; font-family: inherit; font-size: 13px; color: var(--text); }
  .hist-search:focus-within { border-color: var(--primary-300); }

  /* simple single verdict */
  .verdict-row { display: flex; gap: 12px; padding: 18px 20px; }
  .verdict { flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 15px; border-radius: 12px; border: 1.5px solid var(--border); font-weight: 700; font-size: 14.5px; color: var(--text-subtle); background: var(--surface); }
  .verdict svg { width: 18px; height: 18px; }
  .verdict.dim { opacity: .4; }
  .verdict.on-valid { border-color: var(--green); background: var(--green-bg); color: var(--green); }
  .verdict.on-invalid { border-color: var(--red); background: var(--red-bg); color: var(--red); }
  .verdict.on-catchall { border-color: var(--amber); background: var(--amber-bg); color: var(--amber); }

  /* buy credits */
  .rate-chip { display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--border-strong); border-radius: 22px; padding: 8px 14px; font-size: 12.5px; font-weight: 700; }
  .rate-chip svg { width: 15px; height: 15px; color: var(--primary); }
  .rate-chip.ca svg { color: var(--amber); }
  .pkg { padding: 0; display: flex; flex-direction: column; }
  .pkg-rows { border-top: 1px solid var(--border); padding: 16px 22px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); flex: 1; }
  .pkg-rows-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); }
  .pkg-or { display: flex; align-items: center; gap: 10px; color: var(--text-subtle); font-size: 10.5px; font-weight: 800; letter-spacing: .08em; }
  .pkg-or::before, .pkg-or::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
  .pkg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .pkg-row .pl { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
  .pkg-row .pl svg { width: 15px; height: 15px; }
  .pkg-row .pl .ev-i { color: var(--primary); }
  .pkg-row .pl .ca-i { color: var(--amber); }
  .pkg-row .pv { font-size: 14px; font-weight: 800; text-align: right; white-space: nowrap; }
  .pkg-row .pv small { display: block; font-size: 10.5px; font-weight: 600; color: var(--text-subtle); }

  /* category pill */
  .cat-pill { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
  .cat-pill.ev { background: var(--primary-50); color: var(--primary); }
  .cat-pill.ca { background: var(--amber-bg); color: var(--amber); }

  /* paused status + progress + pause btn */
  .status.s { background: var(--slate-bg); color: var(--slate); }
  .status.s .sdot { background: var(--slate); }
  .run-prog { font-size: 11.5px; color: var(--text-muted); font-weight: 600; margin-top: 5px; white-space: nowrap; }
  .btn-pause { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 12.5px; font-weight: 700; color: var(--amber); cursor: pointer; }
  .btn-pause svg { width: 14px; height: 14px; }
  .btn-pause:hover { background: var(--amber-bg); border-color: var(--amber); }

  /* dropzone states */
  .dropzone-lg { cursor: pointer; }
  .dropzone-lg .dz-selected { display: none; }
  .dropzone-lg.has-file { background: var(--surface); border-style: solid; border-color: var(--green); }
  .dropzone-lg.has-file .dz-default { display: none; }
  .dropzone-lg.has-file .dz-selected { display: block; }
  .dropzone-lg.drag { background: #EFEAFE; border-color: var(--primary); }
  .dz-file { display: flex; align-items: center; gap: 14px; }
  .dz-fic { width: 48px; height: 48px; border-radius: 12px; background: var(--green-bg); display: grid; place-items: center; box-shadow: var(--shadow-sm); flex-shrink: 0; }
  .dz-fic svg { width: 24px; height: 24px; color: var(--green); }
  .dz-fmeta { text-align: left; flex: 1; }
  .dz-fmeta .fn { font-weight: 700; font-size: 15px; }
  .dz-fmeta .fs { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
  .dz-remove { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; color: var(--text-muted); cursor: pointer; flex-shrink: 0; }
  .dz-remove svg { width: 16px; height: 16px; }
  .dz-remove:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }
  .btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

  /* report modal */
  .modal-overlay { position: fixed; inset: 0; background: rgba(27,21,48,.45); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 100; opacity: 0; visibility: hidden; transition: opacity .18s, visibility .18s; padding: 24px; }
  .modal-overlay.show { opacity: 1; visibility: visible; }
  .modal { width: 760px; max-width: 100%; max-height: 88vh; background: var(--surface); border-radius: 18px; box-shadow: 0 30px 80px rgba(27,21,48,.32); display: flex; flex-direction: column; overflow: hidden; transform: translateY(10px) scale(.985); transition: transform .18s; }
  .modal-overlay.show .modal { transform: none; }
  .modal-head { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
  .modal-head h3 { font-size: 17px; font-weight: 800; }
  .modal-head p { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
  .modal-body { padding: 20px 22px; overflow-y: auto; }
  .modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--bg); }
  .rm-stats { display: flex; gap: 12px; margin-bottom: 22px; }
  .rm-stat { flex: 1; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
  .rm-stat .n { font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
  .rm-stat .l { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-top: 2px; }
  .rm-bars { display: flex; flex-direction: column; gap: 13px; margin-bottom: 24px; }
  .rm-tablehd { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); margin-bottom: 6px; }

  .run-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
  .mini-bar { width: 96px; height: 6px; background: var(--bg); border-radius: 20px; overflow: hidden; }
  .mini-bar i { display: block; height: 100%; background: var(--grad); border-radius: 20px; }
  .run-pct { font-size: 11.5px; font-weight: 800; color: var(--primary); }

  .cm-input { flex: 1; border: 1.5px solid var(--border-strong); border-radius: 10px; padding: 12px 14px; font-family: inherit; font-size: 17px; font-weight: 800; color: var(--text); outline: none; min-width: 0; }
  .cm-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
  #cmRange { width: 100%; accent-color: var(--primary); height: 6px; margin-top: 4px; }
  .cm-label { font-size: 12px; font-weight: 700; color: var(--text-subtle); text-transform: uppercase; letter-spacing: .05em; }
  .cm-or { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-subtle); font-size: 10.5px; font-weight: 800; letter-spacing: .08em; padding: 0 4px; }
  .cm-coupon { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
  .cm-coupon .cm-input { font-size: 14px; font-weight: 700; letter-spacing: .04em; }
  .cm-summary { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 9px; }
  .cm-sum-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; color: var(--text-muted); }
  .cm-sum-row span:last-child { font-weight: 700; color: var(--text); }
  .cm-sum-total { padding-top: 11px; border-top: 1px dashed var(--border-strong); font-size: 16px; }
  .cm-sum-total span { font-weight: 800 !important; color: var(--text) !important; }
  .cm-sum-total span:last-child { font-size: 20px; }

  .pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
  .pager .info { font-size: 13px; color: var(--text-muted); font-weight: 600; }
  .pager .pages { display: flex; gap: 5px; }
  .pager .pg { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
  .pager .pg svg { width: 16px; height: 16px; }
  .pager .pg:hover:not(:disabled):not(.active) { border-color: var(--primary-300); color: var(--primary); background: var(--primary-50); }
  .pager .pg.active { background: var(--grad); color: #fff; border-color: transparent; }
  .pager .pg:disabled { opacity: .4; cursor: not-allowed; }

  .inv-act { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 12.5px; font-weight: 700; color: var(--text); cursor: pointer; }
  .inv-act svg { width: 14px; height: 14px; }
  .inv-act:hover { border-color: var(--primary-300); color: var(--primary); background: var(--primary-50); }
  .inv-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); margin-bottom: 5px; }
  .inv-sub { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin-top: 3px; }
  .inv-trow { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-muted); padding: 5px 0; }
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .fld label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--text-subtle); margin-bottom: 6px; }
  .fld input { width: 100%; border: 1.5px solid var(--border-strong); border-radius: 10px; padding: 11px 13px; font-family: inherit; font-size: 14px; color: var(--text); outline: none; }
  .fld input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
  .fld input:disabled { background: var(--bg); color: var(--text-muted); cursor: not-allowed; }
  .lockpill { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; color: var(--text-subtle); background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px; text-transform: none; letter-spacing: 0; }
  .lockpill svg { width: 11px; height: 11px; }

  .help-hero { background: linear-gradient(135deg,#8B5CF6 0%,#6D28D9 100%); color: #fff; border: none; }
  .help-channels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .help-channel { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 13px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); color: #fff; text-decoration: none; transition: background .14s; }
  .help-channel:hover { background: rgba(255,255,255,.2); }
  .help-channel .hc-ic { width: 44px; height: 44px; border-radius: 12px; background: #fff; display: grid; place-items: center; flex-shrink: 0; }
  .help-channel .hc-ic svg { width: 22px; height: 22px; }
  .help-channel .hc-t { font-weight: 700; font-size: 14.5px; }
  .help-channel .hc-s { font-size: 12.5px; opacity: .85; margin-top: 1px; }
  .fld select, .fld textarea { width: 100%; border: 1.5px solid var(--border-strong); border-radius: 10px; padding: 11px 13px; font-family: inherit; font-size: 14px; color: var(--text); outline: none; background: var(--surface); }
  .fld textarea { resize: vertical; min-height: 120px; }
  .fld select:focus, .fld textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
  .faq { border-bottom: 1px solid var(--border); }
  .faq summary { cursor: pointer; padding: 15px 2px; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary .chev { flex-shrink: 0; width: 18px; height: 18px; color: var(--text-subtle); transition: transform .2s; }
  .faq[open] summary .chev { transform: rotate(180deg); }
  .faq p { padding: 0 2px 16px; margin: 0; color: var(--text-muted); font-size: 13.5px; line-height: 1.65; }

  .attach-zone { border: 1.5px dashed var(--border-strong); border-radius: 10px; padding: 12px 14px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-muted); transition: border-color .14s, background .14s; }
  .attach-zone:hover { border-color: var(--primary-300); background: var(--primary-50); }
  .attach-empty { display: flex; align-items: center; gap: 9px; }
  .attach-empty svg { width: 17px; height: 17px; color: var(--primary); }
  .attach-file { display: flex; align-items: center; gap: 10px; color: var(--text); }
  .attach-file > svg { width: 17px; height: 17px; color: var(--green); }
  .attach-file .af-name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .af-x { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; color: var(--text-muted); cursor: pointer; flex-shrink: 0; }
  .af-x svg { width: 14px; height: 14px; }
  .af-x:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }
  .pill.prog { background: var(--primary-50); color: var(--primary); }

  .tk-msg { display: flex; gap: 11px; margin-bottom: 16px; }
  .tk-msg .av { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
  .tk-msg.you .av { background: var(--grad); color: #fff; }
  .tk-msg.support .av { background: var(--primary-50); color: var(--primary); }
  .tk-who { font-size: 12.5px; font-weight: 700; }
  .tk-time { font-size: 11px; color: var(--text-subtle); font-weight: 600; }
  .tk-bubble { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; margin-top: 5px; }
  .tk-msg.you .tk-bubble { background: var(--primary-50); border-color: #E4DCFB; }
  .tk-text { font-size: 13.5px; color: var(--text); line-height: 1.55; }
  .tk-reply { width: 100%; border: 1.5px solid var(--border-strong); border-radius: 10px; padding: 11px 13px; font-family: inherit; font-size: 14px; color: var(--text); resize: vertical; min-height: 72px; outline: none; }
  .tk-reply:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }

  .tk-attach-chip { display: flex; align-items: center; gap: 9px; background: var(--primary-50); border: 1px solid #E4DCFB; border-radius: 9px; padding: 8px 11px; font-size: 13px; font-weight: 700; color: var(--text); }
  .tk-attach-chip > svg { width: 16px; height: 16px; color: var(--primary); }
  .tk-attach-chip .ac-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tk-att { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 700; color: var(--primary); }
  .tk-att svg { width: 13px; height: 13px; }

  .api-key { display: flex; align-items: center; gap: 14px; padding: 15px 16px; border: 1px solid var(--border); border-radius: 13px; background: var(--bg); margin-top: 12px; }
  .api-key .k-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
  .api-key .k-name { font-weight: 700; font-size: 13px; }
  .api-key .k-mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; font-size: 14px; color: var(--text); margin: 2px 0; word-break: break-all; }
  .api-key .k-edit { font-size: 12px; color: var(--primary); font-weight: 700; cursor: pointer; }
  .api-key .k-name-input { font-family: inherit; font-size: 13px; font-weight: 700; border: 1.5px solid var(--primary); border-radius: 7px; padding: 3px 7px; outline: none; }
  .k-copy { margin-left: auto; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; color: var(--text-muted); cursor: pointer; flex-shrink: 0; }
  .k-copy svg { width: 17px; height: 17px; }
  .k-copy:hover { border-color: var(--primary-300); color: var(--primary); background: var(--primary-50); }
  .api-method { font-family: ui-monospace, monospace; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
  .api-verb { background: var(--green-bg); color: var(--green); padding: 2px 9px; border-radius: 6px; font-size: 12px; }
  .url-build { background: var(--bg); border: 1px solid var(--border); border-radius: 11px; padding: 14px; font-family: ui-monospace, monospace; font-size: 13px; line-height: 2.1; word-break: break-all; color: var(--text-muted); }
  .url-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 7px; font-weight: 700; font-size: 12px; }
  .url-chip svg { width: 13px; height: 13px; }
  .url-chip.key { background: #FCE7F0; color: #DB2777; }
  .url-chip.email { background: var(--green-bg); color: var(--green); }
  .url-chip.to { background: var(--primary-50); color: var(--primary); }
  .code-panel { background: #1B1530; border-radius: 13px; padding: 16px 18px; overflow: auto; }
  .code-head { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #B7AEDC; margin-bottom: 12px; }
  .resp-dot { width: 8px; height: 8px; border-radius: 50%; background: #34D399; }
  .code-panel pre { margin: 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; line-height: 1.75; color: #E6E1F5; white-space: pre-wrap; word-break: break-word; }
  .j-key { color: #C4B5FD; }
  .j-str { color: #86EFAC; }
  .j-num { color: #FCD34D; }
  .j-bool { color: #7DD3FC; }
  .res-row { display: flex; align-items: flex-start; gap: 15px; padding: 18px 0; border-bottom: 1px solid var(--border); }
  .res-row .r-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
  .res-row .r-ic svg { width: 21px; height: 21px; }
  .res-row .r-body { flex: 1; }
  .res-row .r-body h4 { font-size: 15px; font-weight: 700; }
  .res-row .r-body p { font-size: 13px; color: var(--text-muted); margin-top: 4px; line-height: 1.55; max-width: 560px; }
  .res-row .btn { flex-shrink: 0; }

  .avatar-lg { width: 64px; height: 64px; border-radius: 16px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 22px; flex-shrink: 0; }
  .team-select { border: 1.5px solid var(--border-strong); border-radius: 10px; padding: 0 12px; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text); background: var(--surface); outline: none; }
  .team-select:focus { border-color: var(--primary); }
  .team-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
  .team-row:last-child { border-bottom: none; }
  .team-av { width: 40px; height: 40px; border-radius: 11px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
  .team-name { font-weight: 700; font-size: 14px; }
  .team-email { font-size: 12.5px; color: var(--text-muted); }
  .team-role { font-size: 11.5px; font-weight: 700; padding: 3px 11px; border-radius: 20px; background: var(--primary-50); color: var(--primary); }
  .team-role.owner { background: var(--amber-bg); color: var(--amber); }
  .team-x { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; color: var(--text-muted); cursor: pointer; }
  .team-x svg { width: 15px; height: 15px; }
  .team-x:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }

  .role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .role-card { border: 1px solid var(--border); border-radius: 13px; padding: 16px; background: var(--bg); }
  .role-card .rc-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 10px; }
  .role-card .rc-ic svg { width: 19px; height: 19px; }
  .rc-ic.admin { background: var(--primary-50); color: var(--primary); }
  .rc-ic.member { background: var(--green-bg); color: var(--green); }
  .rc-ic.viewer { background: var(--slate-bg); color: var(--slate); }
  .role-card h4 { font-size: 14px; font-weight: 700; }
  .role-card p { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; line-height: 1.5; }

  /* ===== dark mode ===== */
  body.dark {
    --bg: #15121F; --surface: #1E1A2C; --border: #2C2640; --border-strong: #3A3352;
    --text: #F2EFFA; --text-muted: #A79FC0; --text-subtle: #7C7596;
    --primary-50: #271E42; --primary-300: #8B5CF6;
    --green-bg: #102A1C; --red-bg: #2C1620; --amber-bg: #2C2110; --slate-bg: #1E2433;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 4px 16px rgba(0,0,0,.5); --shadow-lg: 0 14px 44px rgba(0,0,0,.6);
  }
  body.dark .topbar { background: rgba(30,26,44,.9); }
  body.dark .search kbd { background: var(--surface); }
  body.dark ::-webkit-scrollbar-thumb { background: #3A3352; border-color: var(--bg); }
  body.dark .dz-fic, body.dark .dz-up { background: var(--surface); }

  .menu-btn { display: none; }
  .tbl-wrap { overflow: visible; }
  @media (max-width: 860px) {
    .menu-btn { display: grid !important; }
    .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 0 50px rgba(0,0,0,.35); }
    .sidebar.open { transform: none; }
    .sb-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; opacity: 0; visibility: hidden; transition: opacity .2s; }
    .sb-backdrop.show { opacity: 1; visibility: visible; }
    .topbar { padding: 0 14px; gap: 10px; }
    .search { display: none; }
    .page-sub { display: none; }
    .page-title { font-size: 17px; }
    .profile-meta { display: none; }
    .profile { padding: 5px; gap: 0; }
    .content { padding: 18px 14px 90px; }
    .dropdown { right: 8px; }
    .notif-panel { right: 8px; left: 8px; width: auto; }
    .stats { grid-template-columns: 1fr 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .role-cards { grid-template-columns: 1fr; }
    .help-channels { grid-template-columns: 1fr; }
    .step-cards { grid-template-columns: 1fr; }
    .rm-stats { flex-wrap: wrap; }
    .rm-stat { min-width: 120px; }
    .verify-input-row { flex-wrap: wrap; }
    .verify-input-row .btn { width: 100%; justify-content: center; }
    .tabs { overflow-x: auto; }
    .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tbl-wrap table { min-width: 620px; }
    #view-buy > div[style*="repeat(3"] { grid-template-columns: 1fr !important; }
    [style*="grid-template-columns:repeat(4,1fr)"] { grid-template-columns: 1fr 1fr !important; }
    #view-api [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
    #view-buy [style*="align-items:stretch"] { flex-direction: column; align-items: stretch !important; }
    #view-buy [style*="align-items:stretch"] > [style*="width:1px"] { width: auto !important; height: 1px; margin: 4px 0 !important; }
  }
  @media (max-width: 520px) { .stats { grid-template-columns: 1fr; } }
