/* Online notepad (template-parts/tools/online-notepad.php) */

.np-sr {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.np-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

/* Notes list */
.np-side {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-bg-elevated);
    padding: 10px;
}
.np-side__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.np-side__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 4px;
    background: none;
    border: 0;
    color: var(--color-text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: default;
}
.np-side__n {
    font-weight: 500;
    font-size: 12px;
    color: var(--color-text-muted);
    background: var(--color-bg-tertiary);
    border-radius: 999px;
    padding: 0 7px;
}
.np-side__n:empty { display: none; }
.np-new { gap: 4px; }
.np-ico { flex: none; }

.np-list-wrap { display: none; margin-top: 8px; }
.np-list-wrap.is-open { display: block; }
.np-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 380px;
    overflow-y: auto;
}
.np-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    text-align: start;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    transition: background-color var(--duration-micro) ease, border-color var(--duration-micro) ease;
}
.np-item:hover { background: var(--color-bg-tertiary); }
.np-item.is-current { border-color: var(--color-accent); background: var(--color-bg-tertiary); }
.np-item__title {
    font-size: 14px;
    color: var(--color-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.np-item__meta { font-size: 12px; color: var(--color-text-muted); }
.np-all {
    margin-top: 8px;
    padding: 6px 4px;
    background: none;
    border: 0;
    font-size: 13px;
    color: var(--color-text-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.np-all:hover { color: var(--color-text-primary); }

/* Editor */
.np-main { min-width: 0; }
.np-title {
    width: 100%;
    padding: 6px 2px 8px;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-primary);
    font-family: var(--font-display, 'Sora', 'DM Sans', sans-serif);
    font-size: 1.375rem;
    font-weight: 600;
}
.np-title:focus { outline: none; border-bottom-color: var(--color-accent); }
.np-title::placeholder { color: var(--color-text-subtle, var(--color-text-muted)); }

.np-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
}
.np-toolbar__gap { flex: 1 1 0; }
.np-toolbar .tool-btn-sm { gap: 5px; padding: 0.45rem 0.7rem; }
.np-mic {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.55rem 1rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #1A6B6A, #2d9e9e);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform var(--duration-micro) var(--ease-out);
}
.np-mic:hover { transform: translateY(-1px); }
.np-mic.is-on { background: linear-gradient(135deg, #b3261e, #e0533f); }
.np-mic:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.np-lang { max-width: 12rem; padding: 0.45rem 0.6rem; }
.np-del:hover { color: #e0533f; }

.np-body {
    display: block;
    width: 100%;
    min-height: 340px;
    resize: vertical;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-elevated);
    color: var(--color-text-primary);
    font-size: 1rem;
    line-height: 1.65;
    transition: border-color var(--duration-ui) var(--ease-out);
}
.np-body:focus { outline: none; border-color: var(--color-accent); }

.np-interim {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--color-text-muted);
    font-style: italic;
}
.np-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 12px;
    margin-top: 6px;
}
.np-saved.is-bad { color: #e0533f; }

.np-note {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-text-muted);
}
.np-note strong { color: var(--color-text-secondary); font-weight: 600; }

@media (max-width: 760px) {
    .np-layout { grid-template-columns: 1fr; gap: 10px; }
    .np-side { padding: 2px 6px; }
    .np-new { padding: 0.3rem 0.6rem; }
    .np-side__toggle { cursor: pointer; }
    .np-list { max-height: 260px; }
    .np-body { min-height: 220px; }
    /* phones: the page opens on the writing surface; the toolbar follows it */
    .np-main { display: flex; flex-direction: column; }
    .np-title { order: 0; }
    .np-body { order: 1; margin-top: 8px; }
    .np-interim { order: 2; }
    .np-foot { order: 3; }
    .np-toolbar { order: 4; margin-bottom: 0; }
    .np-btn-txt { display: none; }
    .np-title { font-size: 1.2rem; }
}
@media (min-width: 761px) {
    .np-side__toggle svg { display: none; }
    .np-list-wrap { display: block; }
}
