.ncpi-card {
    overflow: hidden;
}

.ncpi-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.ncpi-add-button {
    text-decoration: none !important;
}

.ncpi-disabled {
    min-height: 42px;
    border: 0;
    border-radius: 16px;
    padding: 0 16px;
    background: #f1f5f9;
    color: #667085;
    font-weight: 900;
}

.ncpi-notice {
    padding: 12px 14px;
    border-radius: 16px;
    background: #eef4ff;
    color: #1d4ed8;
    font-weight: 800;
    margin-bottom: 14px;
}

.ncpi-list {
    display: grid;
    gap: 14px;
}

.ncpi-empty {
    color: #667085;
    font-weight: 700;
}

.ncpi-item-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    background: #fff;
}

.ncpi-item-card h3 {
    margin: 0 0 10px;
    color: #101a33;
}

.ncpi-item-card dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.ncpi-item-card dl div {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 10px;
}

.ncpi-item-card dt {
    font-weight: 900;
    color: #667085;
}

.ncpi-item-card dd {
    margin: 0;
    color: #101a33;
    overflow-wrap: anywhere;
}

.ncpi-actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ncpi-actions form {
    margin: 0;
}

.ncpi-actions a,
.ncpi-actions button {
    min-height: 38px;
    border: 0;
    border-radius: 14px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #475467;
    font-weight: 900;
    text-decoration: none;
}

.ncpi-actions .ncpi-danger {
    background: #fff1f2;
    color: #be123c;
}

.ncpi-editor-shell {
    min-height: calc(100vh - 160px);
    display: grid;
    align-content: start;
    gap: 16px;
}

.ncpi-editor-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: -24px -24px 8px;
    padding: 14px 20px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.ncpi-editor-topbar a {
    color: #2563eb;
    font-weight: 900;
    text-decoration: none;
}

.ncpi-editor-topbar strong {
    color: #101a33;
    font-size: 18px;
}

.ncpi-editor-form {
    display: grid;
    gap: 14px;
}

.ncpi-field {
    display: grid;
    gap: 7px;
}

.ncpi-field span {
    font-weight: 900;
    color: #101a33;
}

.ncpi-field input,
.ncpi-field textarea,
.ncpi-field select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d7deea;
    border-radius: 16px;
    padding: 12px 14px;
    background: #fff;
    color: #101a33;
    font-size: 16px;
}

.ncpi-save-button {
    min-height: 48px;
}

@media (max-width: 760px) {
    .ncpi-item-card {
        grid-template-columns: 1fr;
    }

    .ncpi-actions {
        justify-content: flex-start;
    }

    .ncpi-item-card dl div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .ncpi-editor-topbar {
        margin: -20px -20px 8px;
    }
}


/* 1.0.1 - stabilniejsze akcje na kartach */
.ncpi-item-card {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    align-items: center;
}

.ncpi-actions {
    display: grid;
    grid-template-columns: 44px 44px 96px 96px;
    justify-content: end;
    align-items: center;
    gap: 10px;
}

.ncpi-actions a,
.ncpi-actions button {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    text-align: center;
}

.ncpi-actions form {
    width: 100%;
}

@media (max-width: 900px) {
    .ncpi-item-card {
        grid-template-columns: 1fr;
    }

    .ncpi-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        justify-content: stretch;
    }
}

@media (max-width: 520px) {
    .ncpi-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* 1.0.2 - czytelniejszy odstęp między strzałkami i akcjami */
.ncpi-actions {
    grid-template-columns: 44px 44px 24px 112px 112px;
}

.ncpi-actions::before {
    content: "";
    display: block;
}

@media (max-width: 900px) {
    .ncpi-actions {
        grid-template-columns: 44px 44px minmax(0, 1fr) minmax(0, 1fr);
    }

    .ncpi-actions::before {
        display: none;
    }
}

@media (max-width: 520px) {
    .ncpi-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* 1.0.3 - finalna korekta akcji: flex zamiast grida, bez nakładania */
.ncpi-item-card {
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
}

.ncpi-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
    min-width: 420px !important;
}

.ncpi-actions::before {
    display: none !important;
    content: none !important;
}

.ncpi-actions form {
    margin: 0 !important;
    width: auto !important;
    flex: 0 0 auto !important;
}

.ncpi-actions a,
.ncpi-actions button {
    width: auto !important;
    min-width: 58px !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
}

.ncpi-actions a {
    min-width: 118px !important;
    margin-left: 28px !important;
}

.ncpi-actions form:last-child button {
    min-width: 112px !important;
}

@media (max-width: 900px) {
    .ncpi-item-card {
        grid-template-columns: 1fr !important;
    }

    .ncpi-actions {
        min-width: 0 !important;
        width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }

    .ncpi-actions a {
        margin-left: 0 !important;
    }
}

@media (max-width: 520px) {
    .ncpi-actions a,
    .ncpi-actions button {
        min-width: 0 !important;
        flex: 1 1 calc(50% - 8px) !important;
    }

    .ncpi-actions form {
        flex: 1 1 calc(50% - 8px) !important;
    }

    .ncpi-actions form button {
        width: 100% !important;
    }
}


/* 1.0.4 - edycja Hobby wewnątrz profilu */
.ncu-profile-section .ncpi-editor-shell {
    min-height: 0;
}

.ncu-profile-section .ncpi-editor-topbar {
    margin: 0 0 16px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    position: static;
}

.ncu-profile-section .ncpi-toolbar {
    margin-top: 10px;
}


/* 1.0.5 - formularz Hobby w profilu ma zostać w kontekście profilu */
.ncu-profile-section[data-ncu-section^="pi-"] .ncpi-editor-shell {
    width: 100%;
}

.ncu-profile-section[data-ncu-section^="pi-"] .ncpi-editor-topbar {
    background: #fff;
}


/* 1.0.6 - ochrona kart przed zbyt długim tekstem */
.ncpi-item-card,
.ncpi-item-card * {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ncpi-item-card h3,
.ncpi-item-card dd {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ncpi-notice {
    overflow-wrap: anywhere;
}


/* 1.0.7 - szerszy i prostszy formularz dodawania/edycji */
.ncpi-editor-shell-clean {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ncpi-editor-shell-clean .ncpi-editor-topbar {
    display: none !important;
}

.ncpi-editor-form-wide {
    width: min(100%, 980px) !important;
    max-width: 980px !important;
    margin: 0 auto !important;
    display: grid !important;
    gap: 20px !important;
}

.ncpi-editor-form-wide .ncpi-field {
    width: 100% !important;
    max-width: none !important;
    display: grid !important;
    gap: 8px !important;
}

.ncpi-editor-form-wide input[type="text"],
.ncpi-editor-form-wide input[type="month"],
.ncpi-editor-form-wide select,
.ncpi-editor-form-wide textarea {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

.ncpi-editor-form-wide textarea {
    min-height: 150px !important;
}

.ncpi-editor-actions {
    display: flex !important;
    gap: 12px !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin-top: 8px !important;
}

.ncpi-editor-actions .ncpi-exit-button,
.ncpi-editor-actions .ncpi-save-button {
    min-width: 180px !important;
    min-height: 48px !important;
    border-radius: 12px !important;
    font-weight: 900 !important;
    text-align: center !important;
}

.ncpi-editor-actions .ncpi-exit-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid #d1d5db !important;
    text-decoration: none !important;
}

.ncpi-editor-actions .ncpi-save-button {
    margin: 0 !important;
}

@media (max-width: 760px) {
    .ncpi-editor-form-wide {
        width: 100% !important;
        max-width: none !important;
    }

    .ncpi-editor-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
    }

    .ncpi-editor-actions .ncpi-exit-button,
    .ncpi-editor-actions .ncpi-save-button {
        min-width: 0 !important;
        width: 100% !important;
    }
}

@media (max-width: 420px) {
    .ncpi-editor-actions {
        grid-template-columns: 1fr !important;
    }
}


/* 1.0.8 - flash message znika po chwili */
.ncpi-notice {
    transition: opacity .22s ease, transform .22s ease, max-height .22s ease, margin .22s ease, padding .22s ease !important;
}

.ncpi-notice.is-hiding {
    opacity: 0 !important;
    transform: translateY(-4px) !important;
    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
}


/* 1.0.9 - komunikaty jako toast/overlay, bez przesuwania układu */
.ncpi-notice {
    position: fixed !important;
    left: 50% !important;
    top: calc(86px + env(safe-area-inset-top)) !important;
    transform: translateX(-50%) !important;
    z-index: 100020 !important;
    width: min(520px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 14px 18px !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    border: 1px solid #dbeafe !important;
    color: #111827 !important;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18) !important;
    pointer-events: none !important;
}

.ncpi-notice.is-hiding {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(-8px) !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 14px 18px !important;
    overflow: visible !important;
}

@media (max-width: 760px) {
    .ncpi-notice {
        top: calc(74px + env(safe-area-inset-top)) !important;
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
    }
}


/* 1.0.10 - toast wyżej, na poziomie akcji Dodaj */
.ncpi-notice {
    top: calc(68px + env(safe-area-inset-top)) !important;
}

@media (max-width: 760px) {
    .ncpi-notice {
        top: calc(62px + env(safe-area-inset-top)) !important;
    }
}


/* v1.1.3-core: hobby/items wypelniaja kontener CORE */
.nevv-content .ncpi-shell,
.nevv-content .ncpi-panel,
.nevv-content .ncpi-card,
.nevv-content .ncpi-grid,
.nevv-content .ncpi-list,
.nevv-content .ncpi-form,
.nevv-content .npi-shell,
.nevv-content .npi-panel,
.nevv-content .npi-card,
.nevv-content .npi-grid,
.nevv-content .npi-list,
.nevv-content .npi-form {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}


/* core-standards: jednolite przyciski i pola wg NEWS Community Core */
body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form button,
body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form input[type="submit"],
body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form .nevv-btn,
body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form a.nevv-btn {
    font-family: var(--nevv-font-family, inherit) !important;
    font-size: var(--nevv-normal-font-size, 16px) !important;
    border-radius: var(--nevv-radius-button, var(--nevv-radius-md, 10px)) !important;
    box-shadow: none !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form button[type="submit"],
body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form input[type="submit"],
body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form .nevv-btn-primary {
    background: var(--nevv-color-primary, #2563eb) !important;
    border-color: var(--nevv-color-primary, #2563eb) !important;
    color: var(--nevv-color-on-primary, #fff) !important;
}

body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form button[type="submit"]:hover,
body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form input[type="submit"]:hover,
body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form .nevv-btn-primary:hover {
    background: var(--nevv-color-primary-hover, var(--nevv-color-primary, #2563eb)) !important;
    color: var(--nevv-color-on-primary, #fff) !important;
}

body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form button:not([type="submit"]),
body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form .nevv-btn-secondary,
body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form a:not(.nevv-btn-primary).nevv-btn {
    background: var(--nevv-color-button-secondary-bg, rgba(15, 23, 42, .08)) !important;
    border-color: var(--nevv-color-border, #d7deea) !important;
    color: var(--nevv-color-text, #111827) !important;
}

body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form button:not([type="submit"]):hover,
body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form .nevv-btn-secondary:hover,
body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form a:not(.nevv-btn-primary).nevv-btn:hover {
    background: var(--nevv-color-button-secondary-hover-bg, rgba(15, 23, 42, .12)) !important;
    color: var(--nevv-color-text, #111827) !important;
}

body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form input,
body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form select,
body.nevv-community-standalone .nevv-content .ncpi-root, .ncpi-panel, .ncpi-items, .ncpi-form textarea {
    font-family: var(--nevv-font-family, inherit) !important;
    font-size: var(--nevv-normal-font-size, 16px) !important;
    border-radius: var(--nevv-radius-input, var(--nevv-radius-md, 10px)) !important;
    color: var(--nevv-color-text, #111827) !important;
    background: var(--nevv-color-surface, #fff) !important;
    border-color: var(--nevv-color-border, #d7deea) !important;
}


/* 1.1.5-core - Hobby: moduł układa, CORE maluje klawisze i pola. */
body.nevv-community-standalone .ncpi-root .nevv-btn,
body.nevv-community-standalone .ncpi-root button.nevv-btn,
body.nevv-community-standalone .ncpi-root a.nevv-btn,
body.nevv-community-standalone .ncpi-form .nevv-btn,
body.nevv-community-standalone .ncpi-actions .nevv-btn,
body.nevv-community-standalone .ncpi-editor-actions .nevv-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    padding: 0 16px !important;
    background: var(--nevv-color-primary, #2563eb) !important;
    border: 1px solid var(--nevv-color-primary, #2563eb) !important;
    color: var(--nevv-color-on-primary, #fff) !important;
    border-radius: var(--nevv-radius-button, 10px) !important;
    font-family: var(--nevv-font-family, inherit) !important;
    font-size: var(--nevv-normal-font-size, 16px) !important;
    line-height: 1 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

body.nevv-community-standalone .ncpi-root .nevv-btn:hover,
body.nevv-community-standalone .ncpi-root button.nevv-btn:hover,
body.nevv-community-standalone .ncpi-root a.nevv-btn:hover,
body.nevv-community-standalone .ncpi-form .nevv-btn:hover,
body.nevv-community-standalone .ncpi-actions .nevv-btn:hover,
body.nevv-community-standalone .ncpi-editor-actions .nevv-btn:hover {
    background: var(--nevv-color-primary-hover, var(--nevv-color-primary, #2563eb)) !important;
    border-color: var(--nevv-color-primary-hover, var(--nevv-color-primary, #2563eb)) !important;
    color: var(--nevv-color-on-primary, #fff) !important;
}

body.nevv-community-standalone .ncpi-root .nevv-btn:active,
body.nevv-community-standalone .ncpi-root button.nevv-btn:active,
body.nevv-community-standalone .ncpi-root a.nevv-btn:active,
body.nevv-community-standalone .ncpi-form .nevv-btn:active,
body.nevv-community-standalone .ncpi-actions .nevv-btn:active,
body.nevv-community-standalone .ncpi-editor-actions .nevv-btn:active {
    background: var(--nevv-color-primary-active, var(--nevv-color-primary, #2563eb)) !important;
    border-color: var(--nevv-color-primary-active, var(--nevv-color-primary, #2563eb)) !important;
    color: var(--nevv-color-on-primary, #fff) !important;
}

body.nevv-community-standalone .ncpi-root .nevv-btn-locked,
body.nevv-community-standalone .ncpi-root button.nevv-btn-locked,
body.nevv-community-standalone .ncpi-root .ncpi-disabled {
    background: rgba(15, 23, 42, .08) !important;
    border-color: transparent !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
}

body.nevv-community-standalone .ncpi-root input,
body.nevv-community-standalone .ncpi-root select,
body.nevv-community-standalone .ncpi-root textarea,
body.nevv-community-standalone .ncpi-form input,
body.nevv-community-standalone .ncpi-form select,
body.nevv-community-standalone .ncpi-form textarea {
    border-radius: var(--nevv-radius-input, 10px) !important;
    font-family: var(--nevv-font-family, inherit) !important;
    color: var(--nevv-color-text, #111827) !important;
}

body.nevv-community-standalone .ncpi-actions {
    align-items: center !important;
}

/* 1.1.6-core - przyciski i pola items korzystaja z wygladu CORE. */
.ncpi-root .nevv-btn,
.ncpi-root button,
.ncpi-root input[type="submit"],
.ncpi-root input[type="button"] {
    min-height: var(--nevv-button-height, 44px) !important;
    height: var(--nevv-button-height, 44px) !important;
    border-radius: var(--nevv-radius-button) !important;
    font-family: var(--nevv-font-family) !important;
    font-size: var(--nevv-button-font-size, 16px) !important;
    line-height: 1 !important;
}
.ncpi-root .nevv-btn-primary,
.ncpi-root button[type="submit"] {
    background: var(--nevv-color-primary) !important;
    border-color: var(--nevv-color-primary) !important;
    color: var(--nevv-color-on-primary, #fff) !important;
}
.ncpi-root .nevv-btn-primary:hover,
.ncpi-root button[type="submit"]:hover {
    background: var(--nevv-color-primary-hover) !important;
    border-color: var(--nevv-color-primary-hover) !important;
    color: var(--nevv-color-on-primary, #fff) !important;
}
.ncpi-root .nevv-btn-primary:active,
.ncpi-root button[type="submit"]:active,
.ncpi-root .nevv-btn.is-active {
    background: var(--nevv-color-primary-active) !important;
    border-color: var(--nevv-color-primary-active) !important;
    color: var(--nevv-color-on-primary, #fff) !important;
}
.ncpi-root .nevv-input,
.ncpi-root .nevv-select,
.ncpi-root input,
.ncpi-root select,
.ncpi-root textarea {
    border-radius: var(--nevv-radius-input) !important;
    font-family: var(--nevv-font-family) !important;
}

/* 1.1.6-core final - prawdziwe selektory modulu profile-items. */
.ncpi-card .nevv-btn,
.ncpi-card button,
.ncpi-editor-shell .nevv-btn,
.ncpi-editor-shell button {
    min-height: var(--nevv-button-height, 44px) !important;
    height: var(--nevv-button-height, 44px) !important;
    border-radius: var(--nevv-radius-button) !important;
    font-family: var(--nevv-font-family) !important;
    font-size: var(--nevv-button-font-size, 16px) !important;
    line-height: 1 !important;
}
.ncpi-card .nevv-btn-primary,
.ncpi-card button[type="submit"],
.ncpi-editor-shell .nevv-btn-primary,
.ncpi-editor-shell button[type="submit"] {
    background: var(--nevv-color-primary) !important;
    border-color: var(--nevv-color-primary) !important;
    color: var(--nevv-color-on-primary, #fff) !important;
}
.ncpi-card .nevv-btn-primary:hover,
.ncpi-card button[type="submit"]:hover,
.ncpi-editor-shell .nevv-btn-primary:hover,
.ncpi-editor-shell button[type="submit"]:hover {
    background: var(--nevv-color-primary-hover) !important;
    border-color: var(--nevv-color-primary-hover) !important;
    color: var(--nevv-color-on-primary, #fff) !important;
}
.ncpi-card .nevv-btn-primary:active,
.ncpi-card button[type="submit"]:active,
.ncpi-editor-shell .nevv-btn-primary:active,
.ncpi-editor-shell button[type="submit"]:active {
    background: var(--nevv-color-primary-active) !important;
    border-color: var(--nevv-color-primary-active) !important;
    color: var(--nevv-color-on-primary, #fff) !important;
}
.ncpi-card input,
.ncpi-card select,
.ncpi-card textarea,
.ncpi-editor-shell input,
.ncpi-editor-shell select,
.ncpi-editor-shell textarea {
    border-radius: var(--nevv-radius-input) !important;
    font-family: var(--nevv-font-family) !important;
}
