/* =====================================================================
   NFTPER Client V2
   Every class is prefixed with "np-".
   ===================================================================== */

/* full page layout */
body:has(.np-app) {
    position: static;
    transform: none;
    top: auto;
    left: auto;
    width: auto;
    height: auto;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    background: #181a1b;
}

/* browser-drawn parts (scrollbars, dropdown lists, number spinners) in dark mode */
html { color-scheme: dark; background-color: #181a1b; }
::-webkit-scrollbar { background-color: #202324; }
::-webkit-scrollbar-thumb { background-color: #454a4d; }
::-webkit-scrollbar-thumb:hover { background-color: #575e62; }
::-webkit-scrollbar-corner { background-color: #181a1b; }

.np-app {
    --np-bg: #181a1b;
    --np-surface: #1c1f20;
    --np-surface-2: #222628;
    --np-input: #161a19;
    --np-line: #2e3335;
    --np-line-strong: #43494c;
    --np-line-input: #363d3b;
    --np-text: #d1cdc7;
    --np-text-bright: #e8e6e3;
    --np-text-dim: #9e9689;
    --np-text-faint: #6f6a63;
    --np-green: #008042;
    --np-green-hover: #00703a;
    --np-green-bright: #00db5f;
    --np-green-soft: rgba(0, 219, 95, 0.12);
    --np-red: #d93a2b;
    --np-red-bright: #ff6b5e;
    --np-red-soft: rgba(217, 58, 43, 0.14);
    --np-yellow: #e5c400;
    --np-amber: #e8a838;
    --np-orange-soft: rgba(255, 152, 0, 0.12);
    --np-radius: 10px;

    min-height: 100vh;
    background: var(--np-bg);
    color: var(--np-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
}
/* resets use :where() so they never out-rank the component classes below */
:where(.np-app) *, :where(.np-app) *::before, :where(.np-app) *::after { box-sizing: border-box; }
.np-app [hidden] { display: none !important; }
:where(.np-app) :is(h1, h2, p) { margin: 0; }
:where(.np-app) :is(h1, h2) { line-height: 1.2; }
:where(.np-app) a { color: inherit; text-decoration: none; }
:where(.np-app) button { font: inherit; color: inherit; }
:where(.np-app) svg { display: block; fill: currentColor; }

/* ---------------------------------------------------------------------
   Form controls
   --------------------------------------------------------------------- */
.np-input,
.np-select {
    display: block;
    width: 100%;
    height: 34px;
    padding: 0 10px;
    background: var(--np-input);
    border: 1px solid var(--np-line-input);
    border-radius: 8px;
    color: var(--np-text);
    font: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.np-input::placeholder { color: var(--np-text-faint); }
.np-input:hover, .np-select:hover { border-color: #4a524f; }
.np-input:focus, .np-select:focus {
    border-color: var(--np-green);
    box-shadow: 0 0 0 3px rgba(0, 128, 66, 0.25);
}
textarea.np-input { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.np-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 28px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239e9689' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 6l5 5 5-5'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 12px;
}
.np-select option { background: #1e2122; color: var(--np-text); }
.np-select option:disabled { color: var(--np-text-faint); }

/* number inputs: no spinners */
.np-app input[type=number]::-webkit-outer-spin-button,
.np-app input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.np-app input[type=number] { -moz-appearance: textfield; }

/* checkbox: gray outline when empty, green box with white tick when checked */
.np-check {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 2px solid #5b6265;
    border-radius: 4px;
    background: var(--np-input) center / 100% no-repeat;
    cursor: pointer;
    transition: background-color .12s, border-color .12s;
}
.np-check:hover { border-color: #7b8386; }
.np-check:checked {
    background-color: var(--np-green);
    border-color: var(--np-green);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}
.np-check:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 128, 66, 0.35); }
.np-check:disabled { opacity: .4; cursor: not-allowed; }

.np-label {
    display: block;
    margin: 0 0 4px 2px;
    font-size: 11.5px;
    color: var(--np-text-dim);
    white-space: nowrap;
}

/* text buttons */
.np-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--np-line-strong);
    border-radius: 8px;
    background: var(--np-surface-2);
    color: var(--np-text);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.np-btn:hover { border-color: #5d6467; background: #2a2f31; }
.np-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 128, 66, 0.35); }
.np-btn-primary { background: var(--np-green); border-color: var(--np-green); color: #fff; }
.np-btn-primary:hover { background: var(--np-green-hover); border-color: var(--np-green-hover); }
.np-btn-danger { background: #a3241a; border-color: #a3241a; color: #fff; }
.np-btn-danger:hover { background: #8a1e16; border-color: #8a1e16; }
.np-btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }

/* ---------------------------------------------------------------------
   Top bar
   --------------------------------------------------------------------- */
.np-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 24px;
    padding: 12px 24px 8px;
    background: rgba(24, 26, 27, 0.96);
    border-bottom: 1px solid var(--np-line);
    backdrop-filter: blur(6px);
}
.np-topbar-side { display: flex; align-items: flex-start; gap: 14px; }

.np-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    margin-right: 6px;
    white-space: nowrap;
}
.np-brand-logo { width: 30px; height: 30px; object-fit: contain; }
.np-brand-name { font-size: 22px; font-weight: 900; letter-spacing: .2px; line-height: 1; }
.np-nft { color: var(--np-green-bright); }
.np-per { color: var(--np-text-bright); }
.np-brand-client { margin-left: 4px; font-size: 19px; font-weight: 300; color: var(--np-text); line-height: 1; }

/* private key pill with the Encrypt button inside, and the key name under it
   (same height as the icon buttons + caption: 38 + 3 + 11) */
.np-pk-box { display: flex; flex-direction: column; gap: 3px; width: 300px; margin: 0; }
.np-pk {
    display: flex;
    align-items: center;
    width: 100%;
    height: 38px;
    padding: 3px 3px 3px 12px;
    background: var(--np-input);
    border: 1px solid var(--np-line-input);
    border-radius: 999px;
    transition: border-color .15s, box-shadow .15s;
}
.np-pk:focus-within { border-color: var(--np-green); box-shadow: 0 0 0 3px rgba(0, 128, 66, 0.25); }
.np-pk-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--np-text);
    font-size: 13px;
}
.np-pk-input::placeholder { color: var(--np-text-faint); }
/* key name: looks like the "start" / "logout" captions, editable on click. First in the form for the
   password manager, shown under the pill. Underline on hover / focus without taking layout space. */
.np-pk-user {
    order: 1;
    box-sizing: content-box;
    width: 100%;
    height: 11px;
    margin: 0 0 -1px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid transparent;
    outline: none;
    background: transparent;
    color: var(--np-text-dim);
    font-size: 11px;
    line-height: 11px;
    text-align: center;
    text-overflow: ellipsis;
}
.np-pk-user::placeholder { color: var(--np-text-faint); }
.np-pk-user:hover { border-bottom-color: var(--np-line-strong); }
.np-pk-user:focus { border-bottom-color: var(--np-green); color: var(--np-text); }
/* Chrome autofill paints fields light blue (an !important browser style); cover it with the field's own colour */
.np-pk-input:-webkit-autofill, .np-pk-input:-webkit-autofill:hover, .np-pk-input:-webkit-autofill:focus,
.np-pk-user:-webkit-autofill, .np-pk-user:-webkit-autofill:hover, .np-pk-user:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--np-input) inset;
    -webkit-text-fill-color: var(--np-text);
    caret-color: var(--np-text);
    transition: background-color 9999s 0s;
}
.np-pk-user:-webkit-autofill, .np-pk-user:-webkit-autofill:hover, .np-pk-user:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #181a1b inset; /* the top bar's colour */
    -webkit-text-fill-color: var(--np-text-dim);
}
.np-pk-encrypt {
    flex: none;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--np-line-strong);
    border-radius: 999px;
    background: var(--np-surface-2);
    font-size: 12px;
    cursor: pointer;
}
.np-pk-encrypt:hover { border-color: #5d6467; background: #2a2f31; }
.np-pk.is-encrypted { border-color: rgba(0, 219, 95, 0.45); }

/* square icon buttons with a small caption under them */
.np-tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin: 0;
    cursor: pointer;
}
.np-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1.5px solid var(--np-line-strong);
    border-radius: 9px;
    background: var(--np-surface);
    color: var(--np-text);
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.np-tool-btn svg { width: 20px; height: 20px; }
.np-tool-btn:hover { border-color: #6b7275; background: var(--np-surface-2); color: var(--np-text-bright); }
.np-tool-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 128, 66, 0.35); }
.np-tool-cap { font-size: 11px; line-height: 1; color: var(--np-text-dim); white-space: nowrap; user-select: none; }

/* main start / stop */
.np-tool-start { border-color: var(--np-green); color: var(--np-green-bright); background: rgba(0, 128, 66, 0.12); }
.np-tool-start:hover { background: var(--np-green); border-color: var(--np-green); color: #fff; }
.np-tool-start .np-ic-stop { display: none; }
.np-tool-start.is-running { border-color: var(--np-red); color: var(--np-red-bright); background: var(--np-red-soft); }
.np-tool-start.is-running:hover { background: var(--np-red); color: #fff; }
.np-tool-start.is-running .np-ic-start { display: none; }
.np-tool-start.is-running .np-ic-stop { display: block; }

.np-tool-check { cursor: pointer; }
.np-tool-check .np-check { width: 20px; height: 20px; }

.np-tool-logout { border-color: rgba(217, 58, 43, 0.7); color: #e6857c; }
.np-tool-logout:hover { background: var(--np-red); border-color: var(--np-red); color: #fff; }

#np-save.is-dirty { border-color: rgba(232, 168, 56, 0.7); color: var(--np-amber); }

.np-sub {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-height: 38px;
    margin-right: 8px;
    line-height: 1.25;
    white-space: nowrap;
}
.np-sub-label { font-size: 11px; color: var(--np-text-dim); }
.np-sub-date { font-size: 13px; color: var(--np-text-bright); font-weight: 600; }
.np-sub-addons { display: flex; gap: 10px; margin-top: 3px; font-size: 11px; color: var(--np-text-faint); }
.np-addon { display: inline-flex; align-items: center; gap: 4px; }
.np-addon::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #8a3a32; }
.np-addon.is-on { color: var(--np-text-dim); }
.np-addon.is-on::before { background: var(--np-green-bright); }

/* ---------------------------------------------------------------------
   Page body
   --------------------------------------------------------------------- */
.np-main { padding: 22px 24px 48px; }
.np-view-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; }
.np-view-title { font-size: 18px; font-weight: 600; color: var(--np-text-bright); }
.np-view-hint { font-size: 12px; color: var(--np-text-faint); }

/* ---------------------------------------------------------------------
   View 1: task group cards
   --------------------------------------------------------------------- */
.np-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    align-items: stretch;
}
.np-gcard {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 290px;
    background: var(--np-surface);
    border: 1.5px solid var(--np-line-strong);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color .15s, transform .15s, box-shadow .15s, opacity .15s;
}
.np-gcard:hover { border-color: #6b7275; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28); }
.np-gcard.has-running { border-color: rgba(0, 219, 95, 0.45); }
.np-gcard.has-running:hover { border-color: rgba(0, 219, 95, 0.75); }
.np-gcard.is-dragging { opacity: .35; }
.np-gcard.is-menu-open { z-index: 5; }

.np-gcard-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 10px 8px 8px;
}
.np-grip {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 30px;
    border-radius: 6px;
    color: var(--np-text-faint);
    cursor: grab;
}
.np-grip:hover { color: var(--np-text); background: var(--np-surface-2); }
.np-grip:active { cursor: grabbing; }
.np-grip svg { width: 16px; height: 16px; }

/* editable names (group + task) look like text until hovered or focused.
   The label grows with the text (hidden copy in ::after), so the pencil
   sits right after the name. */
.np-name {
    position: relative;
    display: inline-grid;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    font-size: 16px;
    font-weight: 600;
}
.np-name::after {
    content: attr(data-value) " ";
    grid-area: 1 / 1;
    height: 0;
    padding: 0 27px 0 9px;
    overflow: hidden;
    visibility: hidden;
    white-space: pre;
}
.np-name-input {
    grid-area: 1 / 1;
    width: 100%;
    min-width: 0;
    height: 32px;
    padding: 0 26px 0 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--np-text-bright);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    text-overflow: ellipsis;
    outline: none;
    cursor: text;
    transition: border-color .15s, background-color .15s;
}
.np-name-input:hover { border-color: var(--np-line-strong); }
.np-name-input:focus { border-color: var(--np-green); background: var(--np-input); }
.np-name-pen {
    position: absolute;
    top: 50%;
    margin-top: -6.5px;
    right: 8px;
    width: 13px;
    height: 13px;
    color: var(--np-text-faint);
    pointer-events: none;
    transition: opacity .15s;
}
.np-gcard .np-name-pen { opacity: 0; }
.np-gcard:hover .np-name-pen { opacity: 1; }
.np-name-input:focus + .np-name-pen { opacity: 0 !important; }

/* kebab (3 dots) menus */
.np-kebab {
    flex: none;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--np-text-dim);
    cursor: pointer;
}
.np-kebab:hover, .np-kebab[aria-expanded="true"] { background: var(--np-surface-2); color: var(--np-text-bright); }
.np-kebab svg { width: 18px; height: 18px; }

.np-menu {
    position: absolute;
    z-index: 40;
    top: 46px;
    right: 8px;
    min-width: 210px;
    padding: 6px;
    background: #232729;
    border: 1px solid var(--np-line-strong);
    border-radius: 10px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
    cursor: default;
}
.np-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--np-text);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.np-menu-item:hover { background: #2e3436; color: var(--np-text-bright); }
.np-menu-item svg { width: 15px; height: 15px; flex: none; color: var(--np-text-dim); }
.np-menu-item.is-danger { color: #f0857a; }
.np-menu-item.is-danger svg { color: #f0857a; }
.np-menu-item.is-danger:hover { background: var(--np-red-soft); }
.np-menu-sep { height: 1px; margin: 5px 4px; background: var(--np-line); }
.np-wallet-swatch { flex: none; width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.np-gcard-body { flex: 1; min-height: 0; padding: 0 16px; overflow: hidden; }
.np-gcard-count { margin: 0 0 6px; font-size: 12px; color: var(--np-text-dim); }
.np-gcard-list { margin: 0; padding: 0; list-style: none; }
.np-gcard-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 25px;
    font-size: 13px;
    border-bottom: 1px solid rgba(46, 51, 53, 0.55);
}
.np-gcard-list li:last-child { border-bottom: 0; }
.np-gcard-tname { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--np-text); }
.np-gcard-tcol { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--np-text-faint); font-size: 12px; }
.np-gcard-more { margin-top: 5px; font-size: 12px; color: var(--np-text-faint); }
.np-gcard-empty { padding-top: 34px; text-align: center; font-size: 13px; color: var(--np-text-faint); }

.np-type-tag {
    flex: none;
    padding: 1px 6px;
    border-radius: 5px;
    background: #2a2f31;
    color: var(--np-text-dim);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .3px;
}

.np-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #50575a; }
.np-dot.is-running { background: var(--np-green-bright); box-shadow: 0 0 0 3px rgba(0, 219, 95, 0.15); }
.np-dot.is-starting, .np-dot.is-stopping { background: var(--np-amber); }
.np-dot.is-error { background: var(--np-red-bright); }

.np-gcard-foot {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 16px 12px;
    border-top: 1px solid var(--np-line);
    font-size: 12.5px;
}
.np-gcard-states { display: flex; gap: 14px; color: var(--np-text-dim); }
.np-gcard-states span { display: inline-flex; align-items: center; gap: 6px; }

.np-stats { color: var(--np-text-dim); white-space: nowrap; }
.np-stats b { font-weight: 600; }
.np-stats .np-s-ok { color: var(--np-green-bright); }
.np-stats .np-s-skip { color: var(--np-yellow); }
.np-stats .np-s-err { color: var(--np-red-bright); }
.np-stats-sep { margin: 0 6px; color: var(--np-text-faint); }

/* "Create Group +" / "New Task +" placeholder cards */
.np-create {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 290px;
    padding: 0;
    border: 2px dashed #3b4143;
    border-radius: 14px;
    background: transparent;
    color: #807a72;
    font-size: 22px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s, color .15s, background-color .15s;
}
.np-create:hover { border-color: rgba(0, 219, 95, 0.55); color: var(--np-text-bright); background: rgba(0, 128, 66, 0.05); }
.np-create:focus-visible { outline: none; border-color: var(--np-green-bright); }
.np-create-plus { font-size: 28px; font-weight: 300; line-height: 1; }

/* Task Groups: "Create Group +" with the smaller "Import from file" under it, same height as a group card */
.np-create-stack { display: flex; flex-direction: column; gap: 10px; height: 290px; }
.np-create-stack .np-create { flex: 1; min-height: 0; }
.np-create-stack .np-create-import { flex: 0 0 56px; gap: 8px; font-size: 15px; }
.np-create-import svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------------------------------------------------------------------
   View 2: inside a group
   --------------------------------------------------------------------- */
.np-group-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}
.np-back {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px 0 12px;
    border: 1.5px solid var(--np-line-strong);
    border-radius: 10px;
    background: var(--np-surface);
    color: var(--np-text-bright);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.np-back svg { width: 22px; height: 22px; }
.np-back:hover { border-color: #6b7275; background: var(--np-surface-2); }

.np-group-tabs {
    display: flex;
    gap: 10px;
    min-width: 0;
    padding: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.np-tab {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    max-width: 220px;
    padding: 7px 14px;
    border: 1.5px solid var(--np-line-strong);
    border-radius: 10px;
    background: var(--np-surface);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.np-tab:hover { border-color: #6b7275; }
.np-tab-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--np-text); }
.np-tab-sub { font-size: 11px; color: var(--np-text-faint); white-space: nowrap; }
.np-tab.is-active {
    border-color: var(--np-green-bright);
    background: rgba(0, 128, 66, 0.10);
    box-shadow: 0 0 0 3px rgba(0, 219, 95, 0.14);
    cursor: default;
}
.np-tab.is-active .np-tab-name { color: #fff; }
.np-tab.is-active .np-tab-sub { color: var(--np-green-bright); }

.np-task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    align-items: stretch;
}
.np-task-grid .np-create { min-height: 440px; }

/* ---------------------------------------------------------------------
   Task card
   --------------------------------------------------------------------- */
.np-task {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 14px 12px;
    background: var(--np-surface);
    border: 1.5px solid #2c3133;
    border-radius: 14px;
    transition: border-color .2s, box-shadow .2s;
}
.np-task:hover { border-color: #3e4447; }
.np-task.is-running {
    border-color: rgba(0, 219, 95, 0.7);
    box-shadow: 0 0 0 1px rgba(0, 219, 95, 0.12), 0 0 22px rgba(0, 219, 95, 0.07);
}
.np-task.is-starting, .np-task.is-stopping { border-color: rgba(232, 168, 56, 0.6); }
.np-task.is-menu-open { z-index: 5; }

.np-task-head { display: flex; align-items: center; gap: 6px; margin: 0 -6px 0 -8px; }
.np-task-head .np-name { font-size: 15px; }
.np-task-head .np-name-input { font-size: 15px; }
.np-task-head .np-name-pen { opacity: .75; }
.np-task-head .np-kebab { margin-left: 0; }
.np-task-id {
    flex: none;
    margin-left: auto;
    padding: 3px 7px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--np-text-faint);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    cursor: copy;
}
.np-task-id:hover { background: var(--np-surface-2); color: var(--np-text); }
.np-task .np-menu { top: 40px; right: 6px; }

.np-row { display: flex; align-items: flex-end; gap: 10px; }
.np-field { display: flex; flex-direction: column; min-width: 0; }
.np-f-type { flex: 0 1 170px; }
.np-f-url { flex: 1; }
.np-row-spacer { flex: 1; }

.np-wallet {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1.5px solid;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.np-w1 { border-color: #5c6366; color: var(--np-text); background: var(--np-input); }
.np-w2 { border-color: #8fb83f; color: #cfe8a1; background: rgba(107, 142, 35, 0.24); }
.np-w3 { border-color: #8a7ff0; color: #d6d0ff; background: rgba(72, 61, 139, 0.38); }

.np-status { display: flex; flex-direction: column; align-items: flex-end; min-width: 70px; }
.np-status-text { height: 34px; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--np-text-dim); white-space: nowrap; }
.np-status-text.is-running { color: var(--np-green-bright); }
.np-status-text.is-starting, .np-status-text.is-stopping { color: var(--np-amber); }

.np-run-btn {
    flex: none;
    min-width: 84px;
    height: 34px;
    padding: 0 14px;
    border: 1.5px solid var(--np-green);
    border-radius: 8px;
    background: rgba(0, 128, 66, 0.12);
    color: var(--np-green-bright);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.np-run-btn:hover { background: var(--np-green); color: #fff; }
.np-run-btn.is-stop { border-color: var(--np-red); background: var(--np-red-soft); color: var(--np-red-bright); }
.np-run-btn.is-stop:hover { background: var(--np-red); color: #fff; }

.np-minmax { display: flex; align-items: center; gap: 5px; }
.np-minmax .np-input { width: 76px; text-align: center; padding: 0 6px; }
.np-minmax-dash { color: var(--np-text-faint); }
.np-input.is-warn { border-color: rgba(255, 152, 0, 0.7); background: var(--np-orange-soft); }
.np-input.is-low { color: var(--np-red-bright); border-color: rgba(217, 58, 43, 0.75); }

.np-m-slot { flex: none; width: 26px; height: 34px; display: flex; align-items: center; justify-content: center; }
.np-m-badge { font-size: 19px; font-weight: 800; color: #ff3b30; cursor: help; line-height: 1; }

/* filter + settings previews (click to open the big panel) */
.np-preview {
    position: relative;
    display: block;
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--np-line);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
    color: var(--np-text);
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.np-preview:hover { border-color: #545b5e; background: rgba(0, 0, 0, 0.26); }
.np-preview:focus-visible { outline: none; border-color: var(--np-green); }
.np-preview-filter { min-height: 76px; }
/* Cards in a row share one height: Settings, prices and Success / Skip / Error sit at the bottom,
   the spare space goes between Filter / Traits and Settings. */
.np-task > .np-f-settings { margin-top: auto; }
/*
.np-f-filter { flex: 1; }
.np-f-filter > .np-preview-filter { flex: 1; display: flex; flex-direction: column; }
.np-f-filter .np-pv-head + .np-pv-line { margin-top: 0; }
*/
.np-preview-settings { min-height: 112px; }
.np-preview-edit {
    position: absolute;
    top: 7px;
    right: 9px;
    font-size: 11px;
    color: var(--np-text-faint);
    opacity: 0;
    transition: opacity .15s;
}
.np-preview:hover .np-preview-edit { opacity: 1; }
.np-pv-head { display: block; margin-bottom: 5px; color: var(--np-text-dim); font-size: 12px; }
.np-pv-head b { color: var(--np-text-bright); font-weight: 600; }
.np-pv-line { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 4px; }
.np-pv-or { font-size: 10.5px; font-weight: 700; color: var(--np-text-faint); letter-spacing: .4px; }
.np-pv-muted { color: var(--np-text-faint); }
.np-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 999px;
    background: #2a2f31;
    color: var(--np-text);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.np-chip.is-not { background: var(--np-red-soft); color: #f0a39b; }
.np-chip.is-extra { background: rgba(0, 128, 66, 0.16); color: #8fe3b4; }
.np-chip.is-bad { background: var(--np-orange-soft); color: #ffbf66; }

.np-set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 14px; }
.np-set-item { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--np-text-faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-set-item .np-dot { width: 7px; height: 7px; }
.np-set-item.is-on { color: var(--np-text); }
.np-set-item.is-on .np-dot { background: var(--np-green-bright); }
.np-set-item.is-na { text-decoration: line-through; opacity: .55; }
.np-set-nums { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--np-line); font-size: 12px; color: var(--np-text-dim); }
.np-set-nums b { color: var(--np-text); font-weight: 600; }
.np-set-nums .is-missing { color: var(--np-amber); }

.np-task-foot { display: flex; align-items: center; gap: 10px; min-height: 30px; font-size: 12.5px; }
.np-stop-reason {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    color: var(--np-amber);
    font-size: 12px;
}

/* ---------------------------------------------------------------------
   Tooltip for any element with data-tip="..." (positioned by the JS)
   --------------------------------------------------------------------- */
.np-tooltip {
    position: fixed;
    z-index: 1200;
    top: 0;
    left: 0;
    max-width: 320px;
    padding: 8px 10px;
    border: 1px solid var(--np-line-strong);
    border-radius: 8px;
    background: #0b0c0d;
    color: var(--np-text);
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-line;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .12s, visibility .12s;
    pointer-events: none;
}
.np-tooltip.is-shown { opacity: 1; visibility: visible; }
/* highlighted part of a tooltip (margin min / max bid): bold + brighter white */
.np-tooltip b { color: #fff; }

.np-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    margin-left: 4px;
    border-radius: 50%;
    border: 1px solid #5b6265;
    color: var(--np-text-dim);
    font-size: 10px;
    font-weight: 700;
    font-style: normal;
    line-height: 1;
    vertical-align: 1px;
    cursor: help;
}
.np-info:hover { border-color: var(--np-text-dim); color: var(--np-text-bright); }
a.np-info { cursor: pointer; }
.np-new { margin-left: 5px; color: #e600e5; font-size: 11px; }

/* ---------------------------------------------------------------------
   Popups
   --------------------------------------------------------------------- */
.np-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(6, 7, 8, 0.68);
    backdrop-filter: blur(2px);
    animation: np-fade .14s ease-out;
}
.np-modal {
    display: flex;
    flex-direction: column;
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    background: #1e2122;
    border: 1px solid #383d3f;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    animation: np-pop .16s ease-out;
}
.np-modal-lg { width: min(940px, 100%); }
.np-modal-sm { width: min(440px, 100%); }
.np-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px 14px;
    border-bottom: 1px solid #383d3f;
}
.np-modal-title { font-size: 17px; font-weight: 600; color: var(--np-text-bright); }
.np-modal-sub { margin-top: 2px; font-size: 12px; color: var(--np-text-dim); }
.np-modal-x {
    flex: none;
    width: 32px;
    height: 32px;
    margin: -4px -6px 0 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--np-text-dim);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.np-modal-x:hover { background: var(--np-surface-2); color: var(--np-text-bright); }
.np-modal-body { flex: 1; min-height: 0; padding: 18px 20px; overflow-y: auto; }
.np-modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #383d3f;
}
.np-modal-note { margin-right: auto; font-size: 12px; color: var(--np-text-faint); }
.np-confirm-text { font-size: 14px; color: var(--np-text); }
.np-confirm-text b { color: var(--np-text-bright); }

@keyframes np-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes np-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

.np-help { font-size: 13px; color: var(--np-text-dim); margin-bottom: 12px; }
.np-help-sm { font-size: 12px; margin: 5px 0 10px; }
.np-mt { margin-top: 16px; }
.np-encrypt-img { display: block; width: 100%; margin-bottom: 14px; border-radius: 8px; }
.np-enc-result { min-height: 84px; resize: none; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

/* task settings popup */
.np-sec { margin-bottom: 22px; }
.np-sec:last-child { margin-bottom: 0; }
.np-sec-title {
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--np-line);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--np-text-dim);
}
.np-form-row { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.np-form-row > .np-field { flex: 0 0 auto; }
.np-w-200 { width: 200px; }
.np-w-140 { width: 140px; }
.np-w-110 { width: 110px; }
.np-filter-detail { margin-top: 14px; }
.np-filter-detail .np-minmax .np-input { width: 110px; }
.np-traits-input { min-height: 120px !important; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px !important; }
.np-traits-help { margin-top: 6px; font-size: 12px; color: var(--np-text-faint); }
.np-traits-explain { margin-top: 8px; padding: 9px 11px; border-radius: 8px; background: rgba(0, 0, 0, 0.2); font-size: 12.5px; color: var(--np-text-dim); }
.np-traits-explain:empty { display: none; }

.np-set-cols { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 6px 22px; }
.np-set-col { display: flex; flex-direction: column; gap: 4px; }
.np-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 32px;
    padding: 4px 6px;
    border-radius: 7px;
    font-size: 13px;
    color: var(--np-text);
    cursor: pointer;
}
.np-toggle:hover { background: rgba(255, 255, 255, 0.03); }
.np-num-row { display: flex; align-items: center; gap: 9px; min-height: 36px; font-size: 13px; }
.np-num-row .np-input { width: 92px; flex: none; text-align: center; }
.np-is-na { position: relative; opacity: .45; pointer-events: none; }
.np-is-na::after { content: "not for auto listing"; margin-left: auto; font-size: 11px; color: var(--np-amber); }
.np-text-row { display: grid; grid-template-columns: 3fr 1.6fr 1.4fr; gap: 14px; margin-top: 16px; }
.np-text-row textarea.np-input { min-height: 58px; }

/* task log */
.np-log {
    min-height: 320px;
    max-height: 62vh;
    margin: 0;
    padding: 12px 14px;
    overflow: auto;
    background: #000;
    border: 1px solid #383d3f;
    border-radius: 8px;
    color: #fff; /* regular lines ("Task started", "Status: ...") */
    font-family: "Courier New", Courier, ui-monospace, monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.np-log .is-offer { color: var(--np-text); } /* "OFFER: ..." lines: softer white */
.np-log .is-err { color: #ff5a4f; }
.np-log .is-warn { color: #ebef02; }
.np-log .is-info { color: #979086; }
.np-log-empty { color: var(--np-text-faint); }

/* toast */
.np-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 1100;
    max-width: min(560px, calc(100vw - 32px));
    padding: 10px 16px;
    border: 1px solid var(--np-line-strong);
    border-radius: 10px;
    background: #0e1011;
    color: var(--np-text-bright);
    font-size: 13px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 10px);
    transition: opacity .18s, transform .18s, visibility .18s;
    pointer-events: none;
}
.np-toast.is-shown { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* not subscribed */
.np-subscribe { max-width: 520px; margin: 12vh auto 0; text-align: center; }
.np-subscribe h2 { margin-bottom: 10px; font-size: 34px; font-weight: 700; color: var(--np-text-bright); }
.np-subscribe p { margin-bottom: 22px; color: var(--np-text-dim); font-size: 16px; }

/* ---------------------------------------------------------------------
   Login page
   --------------------------------------------------------------------- */
.np-login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; }
.np-login-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    width: 100%;
    max-width: 420px;
    padding: 40px 32px 34px;
    background: var(--np-surface);
    border: 1px solid var(--np-line);
    border-radius: 14px;
    text-align: center;
}
.np-login .np-brand { height: auto; margin: 0; gap: 8px; }
.np-login .np-brand-logo { width: 46px; height: 46px; }
.np-login .np-brand-name { font-size: 36px; }
.np-login .np-brand-client { font-size: 30px; }
.np-login-text { margin: 0; color: var(--np-text-dim); font-size: 14px; }
.np-login-actions { display: flex; gap: 10px; width: 100%; }
.np-login-actions .np-btn { flex: 1; height: 42px; font-size: 15px; }
.np-login-actions .np-btn:disabled { opacity: .6; cursor: default; }

/* ---------------------------------------------------------------------
   Smaller screens
   --------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .np-pk-box { width: 240px; }
    .np-sub { display: none; }
}
@media (max-width: 760px) {
    .np-topbar, .np-main { padding-left: 14px; padding-right: 14px; }
    .np-topbar-side { flex-wrap: wrap; }
    .np-pk-box { width: 100%; order: 5; }
    .np-group-nav { flex-direction: column; align-items: stretch; }
    .np-task-grid { grid-template-columns: 1fr; }
    .np-set-cols, .np-text-row { grid-template-columns: 1fr; }
}
