.nh-wrap {
    display: grid;
    gap: 24px;
}

.nh-card {
    border: 1px solid #ddd;
    border-radius: 18px;
    padding: 22px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.nh-toolbar-card {
    padding: 16px 18px;
}

.nh-toolbar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
}

.nh-toolbar.no-create-button {
    align-items: stretch;
}

.nh-toolbar .nh-filter-form {
    flex: 1 1 520px;
}

.nh-form,
.nh-filter-form {
    display: grid;
    gap: 16px;
}

.nh-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 12px;
}

.nh-form label,
.nh-filter-form label {
    display: grid;
    gap: 6px;
}

.nh-form input[type="text"],
.nh-form input[type="url"],
.nh-form input[type="date"],
.nh-form textarea,
.nh-form input[type="file"],
.nh-filter-form select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cfcfcf;
    border-radius: 10px;
    box-sizing: border-box;
    background: #fff;
}

.nh-form textarea {
    min-height: 120px;
    resize: vertical;
}

.nh-button-primary,
.nh-filter-form button,
.nh-button-secondary {
    display: inline-block;
    width: fit-content;
    padding: 10px 16px;
    border-radius: 10px;
    border: 0;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
}

.nh-button-primary,
.nh-filter-form button {
    background: #111;
    color: #fff;
}

.nh-button-secondary {
    background: #efefef;
    color: #111;
}

.nh-filter-actions,
.nh-actions-row,
.nh-entry-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.nh-entry {
    display: grid;
    gap: 18px;
    scroll-margin-top: 24px;
}

.nh-entry-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.nh-entry-head-main {
    display: grid;
    gap: 10px;
}

.nh-date {
    color: #444;
    line-height: 1.05;
}

.nh-date-main {
    font-size: 1rem;
}

.nh-date-year {
    font-size: 2.2rem;
    font-weight: 800;
}

.nh-entry-title {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.2;
    font-weight: 800;
    position: relative;
    padding-left: 16px;
}

.nh-entry-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.2em;
    width: 6px;
    height: 1.1em;
    border-radius: 99px;
    background: #111;
}

.nh-entry-title-edit {
    font-size: 1.2rem;
}

.nh-entry-tags,
.nh-tag-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.nh-tag-link,
.nh-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #111;
    border: 1px solid #d7dce2;
    text-decoration: none;
    font-size: 0.94rem;
    line-height: 1.1;
}

.nh-tag-chip {
    cursor: pointer;
}

.nh-tag-chip.is-active,
.nh-tag-link:hover,
.nh-tag-link:focus {
    background: #111;
    color: #fff;
    border-color: #111;
}

.nh-tag-empty {
    color: #666;
    font-size: 0.95rem;
}

.nh-tag-selector {
    display: grid;
    gap: 10px;
}

.nh-image img,
.nh-image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
}

.nh-credit,
.nh-counter,
.nh-history-meta,
.nh-history-fields {
    color: #555;
    font-size: 0.95em;
}

.nh-entry-text p {
    margin: 0 0 1em;
}

.nh-history {
    border-top: 1px solid #eee;
    padding-top: 12px;
}

.nh-history summary {
    cursor: pointer;
    font-weight: 700;
}

.nh-history-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.nh-history-item {
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 14px;
}

.nh-history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.nh-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
}

.nh-message-success {
    background: #ecfdf3;
    color: #027a48;
}

.nh-message-error {
    background: #fef3f2;
    color: #b42318;
}

.nh-overlay {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.nh-overlay.is-open {
    display: block;
}

.nh-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.nh-overlay-dialog {
    position: relative;
    z-index: 2;
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    overflow: auto;
    margin: 20px auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.22);
}

.nh-overlay-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #ececec;
}

.nh-overlay-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.nh-overlay-body {
    padding: 22px;
}

.nh-overlay-close {
    border: 0;
    background: transparent;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: #111;
}

body.nh-overlay-open {
    overflow: hidden;
}

@media (max-width: 700px) {
    .nh-card {
        padding: 16px;
    }

    .nh-toolbar-card {
        padding: 12px 14px;
    }

    .nh-entry-head,
    .nh-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .nh-filter-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .nh-filter-form {
        gap: 12px;
    }

    .nh-filter-actions {
        margin-top: 0;
    }

    .nh-date-year {
        display: inline-block;
    }

    .nh-entry-title {
        font-size: 1.28rem;
    }
}
