:root {
    --primary: var(--brand-primary);
    --primary-600: var(--brand-primary-600);
    --primary-700: var(--brand-primary-700);
    --primary-300: var(--brand-primary-300);
    --primary-50: var(--brand-primary-50);
    --grad: var(--brand-gradient);
    --grad-soft: var(--brand-gradient-soft);

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

    --text: var(--brand-ink);
    --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(0,0,0,.05), 0 1px 3px rgba(0,0,0,.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.04);
    --shadow-lg: 0 12px 40px rgba(46,15,157,.14);
    --sidebar-w: 264px;

    font-family: var(--font-brand), "Poppins", 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;
  }
  .legacy-boot-splash {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(246,245,251,.96), rgba(246,245,251,.985));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
    z-index: 2000;
  }
  .legacy-boot-card {
    min-width: 220px;
    padding: 22px 24px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.92);
    box-shadow: 0 24px 60px rgba(46,15,157,.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .legacy-boot-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid #E9E2FB;
    border-top-color: var(--primary);
    animation: legacy-spin .8s linear infinite;
  }
  .legacy-boot-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.01em;
  }
  @keyframes legacy-spin {
    to { transform: rotate(360deg); }
  }
  body.legacy-booting [data-legacy-page="dashboard"] .app {
    visibility: hidden;
  }
  body.legacy-booting [data-legacy-page="dashboard"] .legacy-boot-splash {
    opacity: 1;
    visibility: visible;
  }
  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;
  }
  .sidebar-logo-img { display: block; width: auto; height: 44px; max-width: 100%; object-fit: contain; }
  .logo-mark {
    width: 38px; height: 38px; border-radius: 11px;
    background: var(--grad);
    display: grid; place-items: center;
    box-shadow: 0 4px 12px rgba(74,27,240,.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 .badge-n { margin-left: auto; padding: 1px 7px; border-radius: 20px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 1.5; }
  .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(74,27,240,.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; }

  .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.admin-return { color: var(--primary); }
  .dd-item.admin-return:hover { background: var(--primary-50); color: var(--primary); }
  .dd-item[hidden], .dd-sep[hidden] { display: none !important; }
  .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 24px; }
  .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(74,27,240,.26); }
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(74,27,240,.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; gap: 12px; border-bottom: 1px solid var(--border); }
  .card-head > * { min-width: 0; }
  .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(74,27,240,.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;
    min-width: 0; max-width: 100%;
  }
  .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; min-width: 0; width: 100%; 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; }
  .rd-extra { padding: 16px 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; background: var(--surface); }
  .rd-chip { border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; font-size: 12.5px; color: var(--text-muted); }
  .rd-chip strong { display: block; color: var(--text); font-size: 13.5px; margin-top: 3px; }
  .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(74,27,240,.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); }
  .info-banner.error { background: var(--red-bg); border-color: #F5C6D2; color: var(--red); }
  .info-banner.error svg { color: var(--red); }
  .info-banner.success { background: var(--green-bg); border-color: #C9EBD5; color: var(--green); }
  .info-banner.success svg { color: var(--green); }
  .upload-estimate { flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .upload-estimate span { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #E4DCFB; background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 10px; font-size: 12.5px; font-weight: 700; }
  .upload-estimate strong { color: var(--primary); font-weight: 800; }

  .hist-table th { white-space: nowrap; }
  .hist-table { min-width: 1080px; }
  .hist-table th:last-child, .hist-table td:last-child { min-width: 232px; }
  .file-id-cell {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--primary-50);
    color: var(--primary);
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12.5px;
    font-weight: 800;
    white-space: nowrap;
  }
  .history-scroll {
    max-height: clamp(360px, 52vh, 660px);
    overflow-x: scroll;
    overflow-y: auto;
    scrollbar-gutter: stable;
    scrollbar-color: #C7BEDD var(--bg);
    scrollbar-width: auto;
    overscroll-behavior: contain;
  }
  .history-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--surface);
  }
  .history-scroll::-webkit-scrollbar { width: 11px; height: 13px; }
  .history-scroll::-webkit-scrollbar-track { background: var(--bg); border-top: 1px solid var(--border); }
  .history-scroll::-webkit-scrollbar-thumb { background: #C7BEDD; border: 3px solid var(--bg); border-radius: 10px; }
  .history-scroll::-webkit-scrollbar-thumb:hover { background: #AFA3CB; }
  .history-scroll .verify-history-table { min-width: 1600px; }
  .history-scroll .catchall-history-table { min-width: 1440px; }
  .history-scroll .verify-history-table :is(th, td):first-child,
  .history-scroll .catchall-history-table :is(th, td):first-child {
    width: 120px;
    min-width: 120px;
    white-space: nowrap;
  }
  .history-scroll .hist-table :is(th, td):last-child {
    width: 245px;
    min-width: 245px;
    white-space: nowrap;
  }
  .history-scroll .verify-history-table :is(th, td):nth-child(2),
  .history-scroll .catchall-history-table :is(th, td):nth-child(2) {
    width: 190px;
    min-width: 190px;
    white-space: nowrap;
  }
  .history-scroll .verify-history-table :is(th, td):nth-child(9),
  .history-scroll .catchall-history-table :is(th, td):nth-child(7) {
    width: 180px;
    min-width: 180px;
    white-space: nowrap;
  }
  .history-scroll .actions {
    min-width: max-content;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
  }
  .history-scroll .history-actions-heading { text-align: center; }
  .history-scroll .actions :is(.btn-view, .btn-dl, .dl-wrap, .dl-toggle) {
    width: auto;
    flex: 0 0 auto;
  }
  .sort-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 700; color: inherit; }
  .sort-btn:hover { color: var(--primary); }
  .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); }
  .status.r { background: var(--red-bg); color: var(--red); }
  .status.r .sdot { background: var(--red); }
  .actions { display: flex; align-items: center; gap: 7px; justify-content: flex-end; flex-wrap: wrap; min-width: 210px; }
  .btn-dl { display: inline-flex; align-items: center; justify-content: 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); white-space: nowrap; }
  .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: 224px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 7px; z-index: 45; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .14s, transform .14s, visibility .14s; }
  .dl-menu.dl-menu-floating { position: fixed; z-index: 120; transform: none; }
  .dl-wrap.open .dl-menu { opacity: 1; visibility: visible; transform: none; }
  .dl-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border-radius: 10px; 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 button:disabled { cursor: wait; opacity: .74; }
  .dl-menu button > span:not(.mdot) { display: grid; gap: 1px; min-width: 0; }
  .dl-menu button strong { color: var(--text); font-size: 13px; line-height: 1.2; }
  .dl-menu button small { color: var(--text-subtle); font-size: 11px; line-height: 1.25; }
  .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-dl.is-loading svg, .dl-menu button.is-loading svg, .download-toast.info svg { animation: legacy-spin .8s linear infinite; }
  .download-toast { position: fixed; right: 24px; bottom: 24px; z-index: 1500; display: flex; align-items: flex-start; gap: 12px; width: min(390px, calc(100vw - 32px)); padding: 14px 15px; border: 1px solid var(--border); border-radius: 18px; background: rgba(255,255,255,.96); color: var(--text); box-shadow: 0 24px 70px rgba(46,15,157,.18); opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(12px) scale(.98); transition: opacity .18s ease, transform .18s ease, visibility .18s ease; backdrop-filter: blur(12px); }
  .download-toast.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
  .download-toast-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 13px; color: #fff; background: var(--grad); box-shadow: 0 10px 24px rgba(139,0,248,.24); }
  .download-toast-icon svg { width: 18px; height: 18px; }
  .download-toast-copy { display: grid; gap: 3px; min-width: 0; padding-top: 1px; }
  .download-toast-copy strong { font-size: 14px; line-height: 1.25; color: var(--text); }
  .download-toast-copy span { font-size: 12.5px; line-height: 1.4; color: var(--text-muted); overflow-wrap: anywhere; }
  .download-toast.success { border-color: rgba(22,163,74,.22); }
  .download-toast.success .download-toast-icon { background: linear-gradient(135deg, #16A34A, #22C55E); box-shadow: 0 10px 24px rgba(22,163,74,.18); }
  .download-toast.error { border-color: rgba(220,38,38,.22); }
  .download-toast.error .download-toast-icon { background: linear-gradient(135deg, #DC2626, #FB7185); box-shadow: 0 10px 24px rgba(220,38,38,.18); }
  .btn-view { display: inline-flex; align-items: center; justify-content: 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; white-space: nowrap; }
  .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); }

  /* verification job status */
  .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; }
  .run-progressbar { position: relative; width: min(220px, 100%); height: 10px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(245,236,255,.9)); border: 1px solid rgba(157, 78, 221, .22); box-shadow: inset 0 1px 2px rgba(49, 8, 78, .08), 0 1px 0 rgba(255,255,255,.9); }
  .run-progressbar span { position: relative; display: block; height: 100%; overflow: hidden; border-radius: inherit; background: linear-gradient(90deg, #8B00F8 0%, #AE5BFF 48%, #00C853 100%); background-size: 180% 100%; box-shadow: 0 0 12px rgba(160, 0, 255, .28); transition: width .45s cubic-bezier(.22,.61,.36,1), background-position .45s ease; animation: install-progress-glow 2.6s ease-in-out infinite; }
  .run-progressbar span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.62) 46%, transparent 88%); transform: translateX(-115%); animation: install-progress-sheen 1.75s linear infinite; }
  .run-progressbar.cancelled span { background: linear-gradient(90deg, #EF4444 0%, #F87171 50%, #FB7185 100%); box-shadow: 0 0 12px rgba(239, 68, 68, .22); animation: none; }
  .run-progressbar.cancelled span::after { display: none; }
  .run-progressbar em { position: absolute; inset: 0; display: grid; place-items: center; color: #1B082D; font-size: 8.5px; font-style: normal; font-weight: 900; line-height: 1; text-shadow: 0 1px 0 rgba(255,255,255,.75); }
  @keyframes install-progress-glow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
  @keyframes install-progress-sheen { 0% { transform: translateX(-115%); } 100% { transform: translateX(115%); } }
  .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(0,0,0,.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(0,0,0,.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); }
  .report-modal { width: 640px; }
  #rmReport { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
  #rmReport .modal-head { flex: 0 0 auto; }
  #rmReport .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .report-modal .modal-head > .row { min-width: 0; }
  .report-modal .modal-head h3 { overflow-wrap: anywhere; }
  .report-modal .modal-foot { flex: 0 0 auto; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .rm-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 22px; }
  .rm-cell { min-width: 0; padding: 13px 16px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .rm-cell:nth-child(2n) { border-right: 0; }
  .rm-cell:nth-last-child(-n+2) { border-bottom: 0; }
  .rm-cell .k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); }
  .rm-cell .v { display: flex; align-items: center; min-height: 24px; margin-top: 4px; font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; }
  .rm-section-title { margin-bottom: 12px; color: var(--text); font-size: 13px; font-weight: 800; }
  .rm-bars { display: flex; flex-direction: column; gap: 13px; }
  .rm-refresh-error { min-height: 18px; margin-top: 14px; color: var(--red); font-size: 12px; font-weight: 650; }
  .report-download-foot { background: linear-gradient(90deg, var(--primary-50), var(--surface)); gap: 14px; }
  .download-foot-copy { display: flex; flex: 1 1 260px; min-width: 0; flex-direction: column; gap: 3px; }
  .download-foot-copy span { color: var(--primary); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
  .download-foot-copy strong { color: var(--text); font-size: 13px; font-weight: 700; line-height: 1.35; }
  .rm-foot-note { color: var(--text-muted); font-size: 12px; font-weight: 600; }
  .rm-foot-actions, .download-foot-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
  .rm-foot-actions .btn, .download-foot-actions .btn, .download-foot-actions .a-btn { white-space: nowrap; }
  .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-usage-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 10px; margin-bottom: 22px; }
  .cm-usage-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px 15px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%); box-shadow: var(--shadow-sm); }
  .cm-usage-card-ev { border-color: rgba(151, 0, 255, .16); }
  .cm-usage-card-ca { border-color: rgba(226, 124, 0, .18); }
  .cm-usage-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; }
  .cm-usage-card-ev .cm-usage-icon { background: var(--primary-50); color: var(--primary); }
  .cm-usage-card-ca .cm-usage-icon { background: var(--amber-bg); color: var(--amber); }
  .cm-usage-icon svg { width: 19px; height: 19px; }
  .cm-usage-copy { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
  .cm-usage-number { font-size: 20px; line-height: 1.05; font-weight: 850; letter-spacing: -.02em; color: var(--text); overflow-wrap: anywhere; }
  .cm-usage-card-ev .cm-usage-number { color: var(--primary); }
  .cm-usage-card-ca .cm-usage-number { color: var(--amber); }
  .cm-usage-label { color: var(--text-muted); font-size: 12px; font-weight: 700; line-height: 1.25; }
  .cm-usage-or { position: relative; display: flex; align-items: center; justify-content: center; min-width: 34px; color: var(--text-subtle); font-size: 10px; font-weight: 850; letter-spacing: .08em; }
  .cm-usage-or::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 50%; width: 1px; transform: translateX(-50%); background: var(--border-strong); }
  .cm-usage-or span { position: relative; z-index: 1; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
  .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: flex-end; 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; align-items: center; gap: 6px; }
  .pager .pg { min-width: 30px; height: 30px; padding: 0 7px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: 0 6px 16px rgba(20, 2, 42, .05); font-size: 12px; font-weight: 700; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: .18s ease; }
  .pager .pg svg { width: 13px; height: 13px; }
  .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; }
  .pager .pg-input { width: 48px; height: 30px; border-radius: 9px; border: 1px solid var(--primary-300); background: var(--surface); color: var(--text); box-shadow: 0 6px 16px rgba(20, 2, 42, .05); font: inherit; font-size: 14px; font-weight: 800; text-align: center; outline: none; transition: .18s ease; }
  .pager .pg-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-50), 0 8px 20px rgba(20, 2, 42, .08); }

  .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; }
  .invoice-party { min-width: 0; line-height: 1.45; }
  .invoice-party-right { text-align: right; }
  .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,#6F4AF5 0%,#3B13C4 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); }

  /* Keep the support conversation compact while giving the reply composer room. */
  #ticketModal .modal-head { padding: 13px 18px; }
  #ticketModal .modal-head > .row { min-width: 0; gap: 10px; }
  #ticketModal .modal-head .uc-ic { width: 38px; height: 38px; min-width: 38px; border-radius: 11px; }
  #ticketModal .modal-head .uc-ic svg { width: 18px; height: 18px; }
  #ticketModal .modal-head h3 { font-size: 16px; line-height: 1.25; }
  #ticketModal .modal-head p { font-size: 11.5px; line-height: 1.3; margin-top: 1px; }
  #ticketModal .modal-head > .icon-btn { width: 34px; height: 34px; min-width: 34px; }
  #ticketModal #tkReplyComposer { padding: 12px 18px 14px; gap: 8px !important; }
  #ticketModal #tkReply { min-height: 120px; padding: 13px 14px; line-height: 1.55; }
  #ticketModal #tkAttachBtn,
  #ticketModal #tkCloseBtn,
  #ticketModal #tkSend,
  #ticketModal #tkResolvedClose {
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 9px;
    font-size: 12.5px;
  }
  #ticketModal #tkAttachBtn svg,
  #ticketModal #tkSend svg { width: 15px; height: 15px; }

  .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.revoked { opacity: .72; background: var(--surface); }
  .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-status { display: inline-flex; align-items: center; margin-left: 7px; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; vertical-align: middle; }
  .k-status.active { background: var(--green-bg); color: var(--green); }
  .k-status.revoked { background: var(--red-bg); color: var(--red); }
  .k-mode { display: inline-flex; align-items: center; margin-left: 7px; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; vertical-align: middle; }
  .k-mode.live { background: var(--blue-bg); color: var(--blue); }
  .k-mode.sandbox { background: var(--amber-bg); color: var(--amber); }
  .api-key .k-meta { font-size: 11.5px; color: var(--text-muted); margin: 4px 0; }
  .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); }
  .k-manage { height: 38px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-muted); font-weight: 800; cursor: pointer; flex-shrink: 0; }
  .k-manage:hover { border-color: var(--primary-300); color: var(--primary); background: var(--primary-50); }
  .api-mode-switch { display: inline-flex; align-items: center; gap: 6px; padding: 5px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); box-shadow: var(--shadow-soft); }
  .api-mode { border: 0; background: transparent; color: var(--text-muted); border-radius: 10px; padding: 9px 13px; font-family: inherit; font-size: 12px; font-weight: 800; cursor: pointer; white-space: nowrap; }
  .api-mode:hover { color: var(--primary); background: var(--primary-50); }
  .api-mode.active { color: #fff; background: var(--grad); box-shadow: var(--shadow-purple); }
  .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: #000000; 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; }
  .resp-dot.bad { background: #F87171; }
  .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: #AFA0FA; }
  .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; }
  .avatar.has-img, .avatar-lg.has-img { background-size: cover; background-position: center; color: transparent; }
  .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-identity { flex: 1; min-width: 180px; }
  .team-name { font-weight: 700; font-size: 14px; }
  .team-email { font-size: 12.5px; color: var(--text-muted); }
  .team-status { display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; padding: 3px 9px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); font-size: 10.5px; font-weight: 800; }
  .team-status.accepted { background: var(--green-bg); color: var(--green); }
  .team-status.expired, .team-status.revoked, .team-status.failed { background: var(--red-bg); color: var(--red); }
  .team-actions { display: flex; align-items: center; gap: 7px; }
  .team-action { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 9px; padding: 7px 10px; color: var(--text); background: var(--surface); font-family: inherit; font-size: 11.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
  .team-action svg { width: 14px; height: 14px; }
  .team-action:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
  .team-action.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-bg); }
  .team-action:disabled { cursor: wait; opacity: .65; }
  .team-message { display: none; margin: -5px 0 12px; font-size: 12.5px; font-weight: 700; }
  .dropzone.workspace-readonly { opacity: .58; pointer-events: none; }
  .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-owner-row { background: color-mix(in srgb, var(--amber-bg) 34%, transparent); border-radius: 12px; padding-inline: 10px; }
  .team-protected { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
  .team-protected svg { width: 14px; height: 14px; }
  .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; }

  /* Account settings */
  .settings-card { width: 100%; max-width: none; }
  .settings-card-spaced { margin-top: 16px; }
  .settings-card-bottom { margin-bottom: 16px; }
  .settings-card-body { padding: 20px; }
  .settings-photo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
  .settings-photo-actions { min-width: 0; }
  .settings-action-row { display: flex; justify-content: flex-end; margin-top: 18px; }
  .team-invite-row { display: flex; align-items: stretch; gap: 10px; margin-bottom: 18px; }
  .team-invite-row .field { flex: 1; min-width: 0; }

  /* ===== dark mode ===== */
  body.dark {
    --bg: #0D0B14;
    --surface: #17131F;
    --surface-elevated: #211A2C;
    --dark-hover: #2A2041;
    --border: #332A43;
    --border-strong: #4B3E60;
    --text: #FFFFFF;
    --text-muted: #FFFFFF;
    --text-subtle: #FFFFFF;
    --primary-50: #241750;
    --primary-300: #8F72FF;
    --green-bg: #123421;
    --red-bg: #3A1721;
    --amber-bg: #38280F;
    --slate-bg: #242B39;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.45);
    --shadow-md: 0 4px 18px rgba(0,0,0,.52);
    --shadow-lg: 0 14px 44px rgba(0,0,0,.65);
    color-scheme: dark;
  }
  body.dark .app { color: #fff; }
  body.dark .topbar { background: rgba(23,19,31,.94); }
  body.dark .content { background: var(--bg); }
  body.dark ::-webkit-scrollbar-thumb { background: #4B3E60; border-color: var(--bg); }
  body.dark ::-webkit-scrollbar-thumb:hover { background: #65537F; }
  body.dark .history-scroll::-webkit-scrollbar-track { background: var(--bg); border-color: var(--border); }
  body.dark .history-scroll::-webkit-scrollbar-thumb { background: #65537F; border-color: var(--bg); }
  body.dark .history-scroll::-webkit-scrollbar-thumb:hover { background: #806AA0; }
  body.dark .history-scroll { scrollbar-color: #65537F var(--bg); }

  /* Keep customer-facing dark-mode typography consistently legible. */
  body.dark .app :where(
    h1, h2, h3, h4, h5, h6, p, div, span, strong, small,
    label, legend, summary, li, th, td, a, button, code, pre, option
  ) {
    color: #fff !important;
  }
  body.dark .avatar.has-img,
  body.dark .avatar-lg.has-img { color: transparent !important; }

  body.dark :is(input, select, textarea) {
    color: #fff !important;
    caret-color: #fff;
  }
  body.dark :is(input, textarea)::placeholder {
    color: #fff !important;
    opacity: 1;
  }
  body.dark :is(
    .cm-input, .fld input, .fld select, .fld textarea, .tk-reply,
    .team-select, .api-key .k-name-input
  ) {
    background: var(--surface-elevated) !important;
    border-color: var(--border-strong);
  }
  body.dark :is(.field input, .hist-search input) {
    background: transparent !important;
  }
  body.dark select option {
    background: var(--surface-elevated);
    color: #fff;
  }
  body.dark input:disabled {
    background: var(--bg) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff;
    opacity: 1;
  }

  body.dark :is(
    .rate-chip, .dz-up, .dz-fic, .help-channel .hc-ic,
    #invoiceSheet
  ) {
    background: var(--surface-elevated) !important;
  }
  body.dark .credit-card .cc-btn {
    background: rgba(13,11,20,.78);
    color: #fff;
    border: 1px solid rgba(255,255,255,.28);
  }
  body.dark [style*="background:#fff"],
  body.dark [style*="background: #fff"],
  body.dark [style*="background:#FFFFFF"],
  body.dark [style*="background: #FFFFFF"] {
    background: var(--surface-elevated) !important;
  }
  body.dark [style*="#FBFAFF"],
  body.dark [style*="#F1ECFC"] {
    background: var(--surface) !important;
  }
  body.dark [style*="background:#fee2e2"] {
    background: var(--red-bg) !important;
    border-color: rgba(220,38,38,.45) !important;
  }
  body.dark #cmApplied {
    background: var(--green-bg) !important;
    border-color: rgba(22,163,74,.45) !important;
  }

  body.dark .dropzone-lg:hover,
  body.dark .dropzone-lg.drag {
    background: var(--dark-hover) !important;
    border-color: var(--primary-300);
  }
  body.dark .dropzone-lg.has-file { background: var(--surface-elevated); }
  body.dark :is(
    .nav-item:not(.active), .subnav-item:not(.active), .icon-btn, .profile,
    .dd-item:not(.danger), .notif, tbody tr, .tab:not(.active),
    .btn-ghost, .dropzone, .btn-dl, .dl-menu button, .btn-view,
    .pager .pg:not(.active), .inv-act, .attach-zone, .k-copy, .k-manage
  ):hover {
    background: var(--dark-hover) !important;
    color: #fff !important;
  }
  body.dark :is(.dd-item.danger, .team-x, .dz-remove, .af-x):hover {
    background: var(--red-bg) !important;
    color: #fff !important;
  }
  body.dark .btn-pause:hover {
    background: var(--amber-bg) !important;
    color: #fff !important;
  }
  body.dark .help-channel:hover { background: rgba(13,11,20,.3) !important; }

  body.dark :is(.info-banner, .tk-msg.you .tk-bubble, .tk-attach-chip) {
    border-color: var(--border-strong);
  }
  body.dark .upload-estimate span {
    background: var(--surface-elevated);
    border-color: var(--border-strong);
    color: #fff;
  }
  body.dark .dl-menu button strong,
  body.dark .download-toast-copy strong {
    color: #fff;
  }
  body.dark .dl-menu button small,
  body.dark .download-toast-copy span {
    color: rgba(255,255,255,.72);
  }
  body.dark .download-toast {
    background: rgba(23,19,31,.96);
    border-color: var(--border-strong);
    box-shadow: 0 24px 70px rgba(0,0,0,.36);
  }
  body.dark .info-banner.error { border-color: rgba(220,38,38,.45); }
  body.dark .info-banner.success { border-color: rgba(22,163,74,.45); }

  .billing-hero-card { position: relative; }
  .billing-hero-content { display: flex; align-items: center; gap: 18px; min-width: 0; padding: 24px 220px 24px 28px; }
  .billing-hero-copy { min-width: 0; }
  .billing-edit-button { position: absolute; top: 24px; right: 28px; white-space: nowrap; }

  .menu-btn { display: none; }
  .tbl-wrap { width: 100%; max-width: 100%; overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; }
  .tbl-wrap table { width: 100%; }
  @media (max-width: 860px) {
    .menu-btn { display: grid !important; flex-shrink: 0; }
    .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; }
    .topbar > div:first-of-type { min-width: 0; }
    .topbar-right, .topbar-right .icon-btn, .profile { flex-shrink: 0; }
    .page-sub { display: none; }
    .page-title { font-size: 17px; }
    .profile-meta { display: none; }
    .profile { padding: 5px; gap: 0; }
    .content { padding: 18px 14px 90px; overflow-x: hidden; }
    .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; }
    .rd-extra { grid-template-columns: 1fr; }
    .verify-input-row { flex-wrap: wrap; }
    .verify-input-row .field { flex-basis: 100%; width: 100%; }
    .verify-input-row .btn { width: 100%; justify-content: center; }
    #view-api .card-head { align-items: stretch; flex-direction: column; }
    #view-api .card-head > .row { width: 100%; flex-wrap: wrap; }
    .tabs { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .settings-card { max-width: 100%; }
    .tbl-wrap table { min-width: 900px; }
    #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) {
    .topbar { padding: 0 10px; gap: 6px; }
    .page-title { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
    .profile .chev { display: none; }
    .topbar-right { gap: 2px; }
    .topbar-right > .icon-btn[title="Settings"] { display: none; }
    .content { padding: 14px 10px 80px; }
    .billing-hero-content { align-items: flex-start; padding: 18px; }
    .billing-hero-copy h2 { font-size: 19px !important; }
    .billing-edit-button { position: static; width: calc(100% - 36px); margin: 0 18px 18px; justify-content: center; }
    .stats { grid-template-columns: 1fr; }
    .card { min-width: 0; max-width: 100%; }
    .card-head { align-items: stretch; flex-direction: column; padding: 16px; }
    .card-head > div:first-child { width: 100%; }
    .card-head p { overflow-wrap: anywhere; }
    .card-head > .row { width: 100%; flex-wrap: wrap; }
    .card-head .hist-search { width: 100%; }
    .card-head .hist-search input { min-width: 0; }
    .card-head .btn { width: 100%; justify-content: center; }
    #invoiceSheet > div:first-child { align-items: flex-start !important; flex-direction: column; }
    #invoiceSheet > div:nth-child(2) { grid-template-columns: 1fr !important; }
    #invoiceSheet .invoice-party-right { text-align: left; }
    .card-head .dl-wrap { width: 100%; }
    .card-head .dl-wrap .btn { width: 100%; }
    .tabs { width: 100%; margin-bottom: 16px; }
    .tab { flex: 1 0 auto; justify-content: center; min-height: 44px; padding: 9px 12px; text-align: center; white-space: normal; }
    .settings-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; }
    .settings-tabs .tab { min-width: 0; padding: 9px 6px; gap: 6px; white-space: nowrap; }
    .settings-card-body { padding: 16px; }
    .settings-action-row .btn { width: 100%; justify-content: center; }
    .settings-photo-row { align-items: flex-start; gap: 12px; }
    .settings-photo-actions .btn { width: 100%; justify-content: center; }
    .settings-photo-actions .muted { line-height: 1.45; }
    .tbl-wrap { overflow-x: scroll; scrollbar-gutter: stable; }
    .tbl-wrap table { min-width: 760px; }
    .pager { justify-content: center; padding: 12px 14px; }
    .pager .pages { max-width: 100%; overflow-x: auto; padding: 2px; }
    .pager .pg { min-width: 28px; height: 28px; border-radius: 8px; }
    .pager .pg-input { width: 44px; height: 28px; border-radius: 8px; font-size: 13px; }
    .actions { flex-direction: column; align-items: stretch; min-width: 150px; }
    .actions .btn-view, .actions .btn-dl, .actions .dl-wrap { width: 100%; }
    .actions .dl-toggle { width: 100%; }
    .dl-menu { right: auto; left: 0; min-width: 210px; }
    .download-toast { right: 12px; bottom: 14px; width: calc(100vw - 24px); padding: 13px; border-radius: 16px; }
    .download-toast-icon { width: 36px; height: 36px; border-radius: 12px; }
    #apiKeyList { padding-left: 16px !important; padding-right: 16px !important; }
    .api-key { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; padding: 14px; gap: 10px; }
    .api-key .k-ic { width: 34px; height: 34px; }
    .api-key > div:nth-child(2) { grid-column: 2; min-width: 0; }
    .api-key .k-name, .api-key .k-meta, .api-key .k-mono { overflow-wrap: anywhere; word-break: break-word; }
    .k-copy { grid-column: 1; margin-left: 0; }
    .k-copy, .k-manage { width: 100%; min-width: 0; justify-content: center; }
    .team-invite-row { flex-direction: column; align-items: stretch; }
    .team-invite-row .field, .team-invite-row .team-select, .team-invite-row .btn { width: 100%; flex: none; }
    .stepper { padding: 14px; gap: 8px; }
    .step { flex: 1; min-width: 0; gap: 7px; white-space: normal; font-size: 12.5px; line-height: 1.25; }
    .step-num { flex-shrink: 0; }
    .step-line { min-width: 14px; margin: 0; }
    #resultFilters { overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
    #resultFilters .btn { flex: 0 0 auto; white-space: nowrap; }
    .tbl-wrap .tbl-empty { width: calc(100vw - 64px); max-width: 360px; margin: 0; box-sizing: border-box; }
    .rd-top { align-items: flex-start; padding: 16px; }
    .rd-top .em { font-size: 15px; overflow-wrap: anywhere; }
    .rd-grid { grid-template-columns: 1fr; }
    .rd-cell { border-right: 0; }
    .dropzone { padding: 34px 18px; }
    .dz-formats { flex-wrap: wrap; }
    .help-hero > div { padding: 22px !important; }
    .help-channel { padding: 14px; }
    .help-channel > div:nth-child(2) { min-width: 0; }
    .help-channel .hc-s { overflow-wrap: anywhere; }
    .res-row { flex-direction: column; gap: 12px; }
    .res-row .btn { width: 100%; justify-content: center; }
    .team-row { align-items: flex-start; flex-wrap: wrap; }
    .team-row > div:nth-child(2) { flex-basis: calc(100% - 54px) !important; }
    .team-email { overflow-wrap: anywhere; }
    .team-select { min-height: 40px; flex: 1; }
    .team-actions { width: 100%; }
    .team-action { flex: 1; min-height: 40px; }
    .team-protected { width: 100%; justify-content: flex-end; }
    #view-settings .team-row .team-role { align-self: center; }
    .modal-overlay { align-items: flex-end; padding: 10px; }
    .modal { width: 100%; max-height: calc(100dvh - 20px); border-radius: 18px 18px 12px 12px; }
    .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
    .modal-foot .btn { flex: 1; justify-content: center; }
    .report-modal .modal-head { padding-top: 15px; padding-bottom: 15px; }
    .report-modal .modal-body { padding-top: 16px; padding-bottom: 12px; }
    .rm-stats { grid-template-columns: 1fr; }
    .rm-cell { border-right: 0; border-bottom: 1px solid var(--border) !important; }
    .rm-cell:last-child { border-bottom: 0 !important; }
    .report-download-foot { align-items: stretch; }
    .download-foot-copy { flex-basis: 100%; text-align: center; }
    .rm-foot-note { width: 100%; text-align: center; }
    .rm-foot-actions, .download-foot-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    .rm-foot-actions .btn, .download-foot-actions .btn, .download-foot-actions .a-btn { width: 100%; min-width: 0; justify-content: center; padding-left: 8px; padding-right: 8px; font-size: 12px; }
    .rm-foot-actions #rmDownloadResults { grid-column: 1 / -1; }
    .cm-usage-grid { grid-template-columns: 1fr; gap: 8px; }
    .cm-usage-card { padding: 12px; }
    .cm-usage-or { min-height: 28px; }
    .cm-usage-or::before { top: 50%; bottom: auto; left: 16px; right: 16px; width: auto; height: 1px; transform: translateY(-50%); }
    .cm-usage-or span { width: 38px; height: 24px; }
    #ticketModal .modal-head { padding: 11px 14px; }
    #ticketModal #tkReplyComposer { padding: 10px 14px 12px; }
    #ticketModal #tkReply { min-height: 132px; }
    #ticketModal #tkAttachBtn,
    #ticketModal #tkCloseBtn,
    #ticketModal #tkSend,
    #ticketModal #tkResolvedClose {
      min-height: 34px;
      padding: 6px 9px;
      font-size: 12px;
    }
  }
  @media (max-width: 360px) {
    .page-title { max-width: 42vw; font-size: 15px; }
    .topbar-right > .icon-btn { width: 38px; }
    .avatar { width: 32px; height: 32px; }
    .card-head { padding: 14px; }
    .content { padding-left: 8px; padding-right: 8px; }
  }
