* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --nh-bg: #f7f7f5;
    --nh-white: #ffffff;
    --nh-text: #37352f;
    --nh-text2: #787774;
    --nh-muted: #b4b4b0;
    --nh-border: #e9e9e7;
    --nh-hover: #f1f1ef;
    --nh-accent: #2eaadc;
    --nh-brown: #9a6e3a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, 'Apple Color Emoji', Arial, sans-serif;
    background: var(--nh-bg);
    color: var(--nh-text);
    line-height: 1.5;
}

.nh-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.5rem;
    background: var(--nh-white);
    border-bottom: 1px solid var(--nh-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nh-brand {
    font-size: 1rem;
    font-weight: 600;
    color: var(--nh-text);
    text-decoration: none;
}

.nh-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nh-link {
    color: var(--nh-text2);
    text-decoration: none;
    font-size: 0.85rem;
}

.nh-link:hover { color: var(--nh-text); }
.nh-link.small { font-size: 0.8rem; }

.nh-btn {
    padding: 0.35rem 0.8rem;
    background: var(--nh-text);
    color: var(--nh-white);
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}

.nh-btn:hover { opacity: 0.85; }
.nh-btn.outline { background: none; color: var(--nh-text2); border: 1px solid var(--nh-border); }

.nh-btn-icon {
    background: none;
    border: none;
    color: var(--nh-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.3rem;
}

.nh-btn-icon:hover { color: var(--nh-text); }

.nh-main {
    display: flex;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
    gap: 2rem;
}

.nh-sidebar {
    width: 200px;
    flex-shrink: 0;
    padding: 1rem;
    background: var(--nh-white);
    border: 1px solid var(--nh-border);
    border-radius: 6px;
    height: fit-content;
}

.nh-sidebar h3 {
    font-size: 0.85rem;
    color: var(--nh-text2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
}

.small { font-size: 0.8rem; color: var(--nh-text2); margin-bottom: 0.3rem; }

.nh-notes {
    flex: 1;
}

.nh-notes h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.nh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.nh-card {
    background: var(--nh-white);
    border: 1px solid var(--nh-border);
    border-radius: 6px;
    padding: 1.2rem;
    transition: box-shadow 0.15s;
}

.nh-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.nh-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.nh-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.nh-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nh-card p {
    font-size: 0.9rem;
    color: var(--nh-text2);
    margin-bottom: 0.8rem;
}

.nh-tag {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    background: var(--nh-hover);
    border-radius: 3px;
    font-size: 0.75rem;
    color: var(--nh-brown);
}

/* New note form */
.new-note {
    margin-bottom: 1.5rem;
}

.nh-input, .nh-textarea {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--nh-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.title-input {
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-bottom: 1px solid var(--nh-border);
    border-radius: 0;
    padding: 0.6rem 0;
}

.nh-input:focus, .nh-textarea:focus, .title-input:focus {
    outline: none;
    border-color: var(--nh-accent);
}

.nh-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Render page */
.nh-render {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem;
}

.nh-article {
    background: var(--nh-white);
    border: 1px solid var(--nh-border);
    border-radius: 8px;
    padding: 2.5rem;
    margin-bottom: 1rem;
}

.nh-article h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.nh-content {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--nh-text);
    margin-bottom: 1.5rem;
}

.nh-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nh-id {
    font-size: 0.8rem;
    color: var(--nh-muted);
}

@media (max-width: 768px) {
    .nh-main { flex-direction: column; }
    .nh-sidebar { width: 100%; }
    .nh-grid { grid-template-columns: 1fr; }
}
