/* ============================================================
   sepp-todo — border-forward dark theme, Ukraine blue+yellow
   ============================================================ */

/* ---------- Auth page ---------- */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 340px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
/* gradient hairline on top edge */
.auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--grad-ua);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    pointer-events: none;
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: 20px;
}

.auth-card label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-card button {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius);
    padding: 11px;
    font-weight: 600;
    transition: border-color .15s, box-shadow .15s;
}
.auth-card button:hover {
    border-color: var(--accent-yellow);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.12);
}

.auth-error {
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: var(--radius);
    padding: 8px 10px;
    font-size: 13px;
    margin: 0;
    background: rgba(229, 72, 77, 0.08);
}

/* ---------- App layout ---------- */
.app-shell {
    display: grid;
    grid-template-columns: 272px 1fr;
    height: 100vh;
    height: 100dvh;
}

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
}

.sidebar-header {
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
    font-size: 16px;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    letter-spacing: .01em;
}

.brand-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 5px;
    background: var(--grad-ua);
}

.search-box {
    width: 100%;
}

.nav-views {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.nav-view-btn {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius);
    padding: 8px;
    font-size: 13px;
    transition: border-color .15s, color .15s;
}
.nav-view-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
}
.nav-view-btn.active {
    color: var(--text);
    border-color: var(--notebook-accent);
    box-shadow: inset 0 0 0 1px var(--notebook-accent);
}

.notebook-list {
    list-style: none;
    margin: 0;
    padding: 10px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.notebook-item {
    --nb-color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 3px;
    transition: border-color .15s, color .15s, background .15s;
}
.notebook-item.empty {
    cursor: default;
    color: var(--text-muted);
    font-size: 13px;
    opacity: .7;
}
.notebook-item:hover {
    border-color: var(--border);
    color: var(--text);
}
.notebook-item.active {
    color: var(--text);
    border-color: var(--nb-color);
    background: color-mix(in srgb, var(--nb-color) 10%, transparent);
}

.notebook-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none;
    background: var(--nb-color);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--nb-color) 60%, transparent);
}

.notebook-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notebook-actions {
    display: none;
    gap: 4px;
}
.notebook-item:hover .notebook-actions,
.notebook-item.active .notebook-actions {
    display: flex;
}

.icon-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 2px 5px;
    border-radius: 6px;
    font-size: 13px;
}
.icon-btn:hover {
    color: var(--text);
    border-color: var(--border);
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}
.sidebar-footer a {
    color: var(--text-muted);
    text-decoration: none;
}
.sidebar-footer a:hover {
    color: var(--accent-yellow);
}

.new-notebook-btn {
    width: 100%;
    background: transparent;
    border: 1px dashed var(--border);
    color: var(--text-muted);
    border-radius: var(--radius);
    padding: 9px;
    font-size: 13px;
    transition: border-color .15s, color .15s;
}
.new-notebook-btn:hover {
    color: var(--accent-yellow);
    border-color: var(--accent-yellow);
}

/* ---------- Sidebar toggle (mobile) ---------- */
.sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 9px;
    flex: none;
}
.sidebar-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
}
.sidebar-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity .2s;
}

/* ---------- Main content ---------- */
.main-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.main-header {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
}

.main-header h2 {
    margin: 0;
    font-size: 16px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-status {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-status button {
    background: transparent;
    color: var(--accent-yellow);
    border: 1px solid var(--accent-yellow);
    border-radius: var(--radius);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
}
.notification-status button:hover {
    background: rgba(255, 215, 0, 0.1);
}

.view-panel {
    flex: 1;
    overflow-y: auto;
    display: none;
    min-height: 0;
}
.view-panel.active {
    display: block;
}

.editor-scroll {
    max-width: 780px;
    margin: 0 auto;
    padding: 32px 24px 240px;
}

#editorjs {
    min-height: 300px;
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 60px 20px;
}

/* ---------- Toasts ---------- */
.toast-stack {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 800;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-blue);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    max-width: 320px;
    box-shadow: var(--shadow-pop);
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }

/* ---------- Search results ---------- */
.search-box-wrap {
    position: relative;
    padding: 0 16px 14px;
}
.search-results {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 6px;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 50;
    display: none;
    box-shadow: var(--shadow-pop);
}
.search-results.open { display: block; }
.search-group-title {
    padding: 8px 12px 2px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}
.search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    border-top: 1px solid var(--border);
    color: var(--text);
}
.search-result-item:first-child { border-top: none; }
.search-result-item:hover { border-left: 2px solid var(--accent-yellow); padding-left: 10px; }
.search-result-item mark {
    background: transparent;
    color: var(--accent-yellow);
    font-weight: 600;
}

/* ---------- Due overview ---------- */
.due-groups {
    max-width: 780px;
    margin: 0 auto;
    padding: 32px 24px 200px;
}
.due-group h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin: 24px 0 8px;
}
.due-group.overdue h3 { color: var(--danger); }
.due-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    background: transparent;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-blue);
    border-radius: var(--radius);
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color .15s;
}
.due-item:hover { border-color: var(--accent-yellow); }
.due-item.overdue { border-left-color: var(--danger); }
.due-item-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}
.due-item.overdue .due-item-time { color: var(--danger); }
.due-item-preview {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.due-item-notebook {
    font-size: 11px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 2px 6px;
}

/* ---------- Modals ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 9, 13, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1200;
    opacity: 0;
    transition: opacity .18s;
}
.modal-overlay.open { opacity: 1; }
.modal-card {
    position: relative;
    width: 380px;
    max-width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-pop);
    transform: translateY(6px) scale(.99);
    transition: transform .18s;
}
.modal-overlay.open .modal-card { transform: none; }
.modal-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--grad-ua);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.4;
    pointer-events: none;
}
.modal-title { margin: 0; font-size: 16px; }
.modal-message { margin: 0; font-size: 14px; color: var(--text-muted); }
.modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}
.modal-input { width: 100%; }
.modal-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.modal-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: var(--sw);
    cursor: pointer;
    box-shadow: 0 0 0 1px var(--border);
    transition: transform .12s;
}
.modal-swatch:hover { transform: scale(1.12); }
.modal-swatch.selected {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--sw);
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 2px;
}
.modal-btn {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: var(--radius);
    padding: 8px 16px;
    font-size: 13px;
    transition: border-color .15s, box-shadow .15s;
}
.modal-btn.ghost { color: var(--text-muted); }
.modal-btn.ghost:hover { color: var(--text); border-color: var(--text-muted); }
.modal-btn.primary { border-color: var(--accent-blue); }
.modal-btn.primary:hover { box-shadow: 0 0 0 3px rgba(0, 87, 183, 0.18); }
.modal-btn.danger { border-color: var(--danger); color: var(--danger); }
.modal-btn.danger:hover { box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.18); }

/* ---------- Editor.js chrome (dark, contrast-safe) ---------- */
.codex-editor { color: var(--text); }
/* everything inside the editor defaults to readable text unless a tool sets a
   specific inline color/highlight class — kills black-on-dark from pastes */
.codex-editor [contenteditable],
.ce-paragraph, .ce-header, .cdx-block, .tc-cell {
    color: var(--text);
}
.ce-block__content, .ce-toolbar__content { max-width: 100% !important; }
.ce-toolbar__plus, .ce-toolbar__settings-btn {
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
}
.ce-toolbar__plus:hover, .ce-toolbar__settings-btn:hover {
    border-color: var(--border);
    color: var(--text);
    background: transparent;
}
.ce-inline-toolbar, .ce-conversion-toolbar, .ce-settings, .ce-popover,
.ce-popover__container {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    box-shadow: var(--shadow-pop) !important;
}
.ce-inline-tool, .ce-inline-toolbar__dropdown, .ce-popover-item__title,
.ce-popover-item__icon, .cdx-search-field__input {
    color: var(--text) !important;
}
.ce-inline-tool:hover, .ce-popover-item:hover, .ce-popover-item--focused {
    background: var(--surface-alt) !important;
}
.ce-block--selected .ce-block__content {
    background: color-mix(in srgb, var(--notebook-accent) 14%, transparent);
    border-radius: 6px;
}
.cdx-search-field { background: var(--surface-alt) !important; border-color: var(--border) !important; }

/* checklist */
.cdx-checklist__item { position: relative; padding-left: 4px; }
.cdx-checklist__item-checkbox-check {
    border-color: var(--text-muted) !important;
}
.cdx-checklist__item--checked .cdx-checklist__item-checkbox-check {
    background: var(--notebook-accent) !important;
    border-color: var(--notebook-accent) !important;
}
/* strikethrough completed todos */
.cdx-checklist__item--checked .cdx-checklist__item-text {
    text-decoration: line-through;
    text-decoration-color: var(--text-muted);
    color: var(--text-muted);
}
/* completion glow */
.cdx-checklist__item.sepp-completed {
    animation: sepp-complete-glow .9s ease;
    border-radius: 8px;
}
@keyframes sepp-complete-glow {
    0%   { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0); }
    35%  { box-shadow: 0 0 0 2px var(--success), 0 0 14px 2px rgba(47, 191, 113, 0.5); }
    100% { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0); }
}
/* per-item drag handle */
.sepp-item-handle {
    cursor: grab;
    color: var(--text-muted);
    opacity: 0;
    padding: 0 6px 0 0;
    user-select: none;
    touch-action: none;
    font-size: 14px;
    line-height: 1;
    transition: opacity .12s, color .12s;
}
.cdx-checklist__item:hover .sepp-item-handle { opacity: .7; }
.sepp-item-handle:hover { color: var(--accent-yellow); opacity: 1; }
.cdx-checklist__item.sepp-item-dragging {
    opacity: .6;
    border: 1px dashed var(--accent-yellow);
    border-radius: 8px;
}

/* inline color / highlight marks (contrast-checked) */
mark.sepp-highlight-yellow { background: var(--accent-yellow); color: #12161c; padding: 0 2px; border-radius: 3px; }
mark.sepp-highlight-blue { background: var(--accent-blue); color: #fff; padding: 0 2px; border-radius: 3px; }
.sepp-color-yellow { color: var(--accent-yellow); }
.sepp-color-blue { color: var(--accent-blue-hover); }
.sepp-color-red { color: var(--danger); }

/* images */
.image-tool__image-picture { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.cdx-button {
    background: transparent !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
}
.cdx-button:hover { border-color: var(--accent-yellow) !important; }

/* ---------- Link tool / block flash ---------- */
.sepp-link-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius);
    padding: 8px 12px;
    cursor: pointer;
    transition: border-color .15s;
}
.sepp-link-chip:hover { border-color: var(--accent-yellow); }
.sepp-link-search input { width: 100%; }
.sepp-link-results {
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.sepp-link-result {
    padding: 8px 10px;
    font-size: 13px;
    cursor: pointer;
    border-top: 1px solid var(--border);
}
.sepp-link-result:first-child { border-top: none; }
.sepp-link-result:hover { background: var(--surface-alt); }

.sepp-flash { animation: sepp-flash-anim 1.6s ease; border-radius: 8px; }
@keyframes sepp-flash-anim {
    0% { box-shadow: 0 0 0 2px var(--accent-yellow); }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Reminder popover ---------- */
.sepp-reminder-popover {
    position: fixed;
    z-index: 1000;
    width: 280px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.srp-title { font-size: 13px; font-weight: 600; }
.srp-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.srp-presets button {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    padding: 7px 4px;
    font-size: 12px;
    transition: border-color .12s, color .12s;
}
.srp-presets button:hover { border-color: var(--accent-yellow); color: var(--accent-yellow); }
.srp-nudge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.srp-nudge button {
    width: 26px;
    height: 26px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 7px;
    font-size: 14px;
    line-height: 1;
}
.srp-nudge button:hover { border-color: var(--accent-blue); }
.srp-input { width: 100%; }
.srp-actions { display: flex; gap: 6px; }
.srp-actions button {
    flex: 1;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    padding: 7px;
    font-size: 12px;
}
.srp-actions button.primary { border-color: var(--accent-blue); }
.srp-actions button.primary:hover { box-shadow: 0 0 0 3px rgba(0, 87, 183, 0.18); }

.sepp-due-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 7px;
    margin-top: 6px;
    color: var(--text-muted);
}
.sepp-due-badge.overdue { color: var(--danger); border-color: var(--danger); }

/* ---------- Responsive: sidebar becomes a slide-over drawer ---------- */
@media (max-width: 860px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 84vw;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform .24s ease;
        border-right: 1px solid var(--border);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-scrim { display: block; opacity: 1; }
    .sidebar-toggle { display: flex; }
    .editor-scroll { padding: 24px 16px 200px; }
    .main-header { padding: 12px 16px; }
    .due-groups { padding: 24px 16px 160px; }
    .header-btn { padding: 6px 9px; }
}

/* ============================================================
   Additions: serif typography, sections, callouts, code/quote,
   copy menu, export modal, header actions, contrast fixes
   ============================================================ */

.auth-card h1,
.sidebar-header h1,
.main-header h2,
.modal-title,
.ce-header,
.sepp-section-title,
.doc-title {
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: .005em;
}
.ce-header { font-weight: 600; }

.brand-logo {
    width: 22px;
    height: 22px;
    display: inline-block;
    vertical-align: -4px;
}

.header-actions { display: flex; align-items: center; gap: 12px; }
.header-btn {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 12px;
    font-size: 13px;
    transition: border-color .15s, color .15s;
}
.header-btn:hover { border-color: var(--accent-yellow); color: var(--accent-yellow); }

/* Due-items nav pulse when something is due/overdue */
.nav-view-btn.has-due {
    border-color: var(--danger);
    animation: sepp-due-pulse 1.8s ease-in-out infinite;
}
@keyframes sepp-due-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); }
    50%      { box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.28); }
}

/* ---------- Checkboxes refined ---------- */
.cdx-checklist__item-checkbox-check {
    background: var(--surface) !important;
    border: 1.5px solid var(--text-muted) !important;
    border-radius: 5px !important;
    transition: background .12s, border-color .12s, box-shadow .12s;
}
.cdx-checklist__item-checkbox:hover .cdx-checklist__item-checkbox-check {
    border-color: var(--notebook-accent) !important;
}
.cdx-checklist__item--checked .cdx-checklist__item-checkbox-check {
    background: var(--notebook-accent) !important;
    border-color: var(--notebook-accent) !important;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--notebook-accent) 45%, transparent);
}
.cdx-checklist__item--checked .cdx-checklist__item-checkbox-check::after {
    border-color: #fff !important;
}

/* ---------- Image caption ---------- */
.image-tool__caption,
.cdx-input.image-tool__caption {
    background: var(--surface-alt) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    margin-top: 8px;
    font-size: 13px;
}
.image-tool__caption:empty::before { color: var(--text-muted); }
.image-tool__image-picture { display: block; }

/* contrast guard: Editor.js popover/toolbar icons + text */
.ce-popover svg, .ce-toolbar svg, .ce-inline-toolbar svg,
.ce-popover-item__icon svg, .cdx-button svg {
    color: var(--text) !important;
    fill: currentColor;
}
.ce-popover-item__icon, .ce-toolbar__plus, .ce-toolbar__settings-btn {
    background: var(--surface-alt) !important;
    color: var(--text) !important;
    border-radius: 7px;
}
.ce-popover, .ce-popover__items, .ce-popover-item__title { color: var(--text) !important; }
.cdx-search-field__input { color: var(--text) !important; }
.cdx-search-field__input::placeholder { color: var(--text-muted) !important; }

/* ---------- Sections ---------- */
.sepp-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin: 10px 0 4px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--notebook-accent);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--notebook-accent) 6%, transparent);
}
.sepp-section-handle {
    cursor: grab;
    color: var(--text-muted);
    touch-action: none;
    user-select: none;
    font-size: 14px;
}
.sepp-section-handle:hover { color: var(--accent-yellow); }
.sepp-section-chevron {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    width: 20px;
    transition: transform .15s, color .15s;
}
.sepp-section-chevron:hover { color: var(--text); }
.sepp-section[data-collapsed="true"] .sepp-section-chevron { transform: rotate(-90deg); }
.sepp-section-title {
    flex: 1;
    font-size: 15px;
    outline: none;
    min-height: 1.2em;
    color: var(--text);
}
.sepp-section-title:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
}
.sepp-section-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 14px;
}
.sepp-section-btn:hover { color: var(--text); border-color: var(--border); }
.sepp-section-dragging { opacity: .6; }
.sepp-section-drop { box-shadow: 0 -2px 0 0 var(--accent-yellow); }

.sepp-copy-menu {
    position: fixed;
    z-index: 1100;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 170px;
}
.sepp-copy-menu button {
    background: transparent;
    border: none;
    color: var(--text);
    text-align: left;
    padding: 7px 9px;
    border-radius: 7px;
    font-size: 13px;
}
.sepp-copy-menu button:hover { background: var(--surface-alt); }

/* ---------- Export modal ---------- */
.export-tools { display: flex; gap: 8px; }
.export-tools button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 7px;
    padding: 5px 10px;
    font-size: 12px;
}
.export-tools button:hover { color: var(--text); border-color: var(--text-muted); }
.export-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
}
.export-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 7px;
    font-size: 14px;
    cursor: pointer;
}
.export-row:hover { background: var(--surface-alt); }

/* ---------- Quote / code ---------- */
.cdx-quote { border-left: 3px solid var(--accent-blue); padding-left: 14px; }
.cdx-quote__text {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text);
    min-height: 1.4em;
}
.cdx-quote__caption { color: var(--text-muted); font-size: 13px; }
.ce-code__textarea, .cdx-input.ce-code__textarea {
    background: var(--surface-alt) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    font-family: ui-monospace, Menlo, Consolas, monospace !important;
    font-size: 13px;
    line-height: 1.5;
}

/* inline code + inline quote */
.inline-code, code.inline-code, .cdx-inline-code {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1px 5px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: .92em;
    color: var(--accent-yellow);
}
q.sepp-inline-quote {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text);
    border-bottom: 1px dashed var(--accent-blue);
}
q.sepp-inline-quote::before { content: "\201C"; color: var(--text-muted); }
q.sepp-inline-quote::after { content: "\201D"; color: var(--text-muted); }

/* ---------- Callouts ---------- */
.sepp-callout {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: var(--radius);
    padding: 11px 13px;
    margin: 8px 0;
    background: color-mix(in srgb, var(--cl, var(--accent-blue)) 8%, transparent);
    border-left-color: var(--cl, var(--accent-blue));
}
.sepp-callout-info { --cl: var(--accent-blue); }
.sepp-callout-warning { --cl: #e0a400; }
.sepp-callout-success { --cl: var(--success); }
.sepp-callout-error { --cl: var(--danger); }
.sepp-callout-icon { color: var(--cl, var(--accent-blue)); font-size: 15px; line-height: 1.5; }
.sepp-callout-body { flex: 1; outline: none; color: var(--text); min-height: 1.3em; }
.sepp-callout-body:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
}

/* ============================================================
   v3 overhaul: selection contrast, gradients, section boxes,
   reminder tab, tags, code, table, scroll indicator, footer
   ============================================================ */

/* selection contrast everywhere */
::selection { background: var(--accent-blue); color: #fff; }
::-moz-selection { background: var(--accent-blue); color: #fff; }
.cdx-checklist__item--checked ::selection { background: var(--accent-blue); color: #fff; }

/* softer, rounder base */
:root { --radius: 11px; --radius-lg: 18px; }

/* less solid fills: nav active + notebook active use gradient-tinted borders */
.nav-view-btn.active {
    border-color: transparent;
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        var(--grad-ua) border-box;
    border: 1px solid transparent;
}
.notebook-item.active {
    background: linear-gradient(90deg, color-mix(in srgb, var(--nb-color) 12%, transparent), transparent 70%);
}

/* image: centered by default, caption full width */
.image-tool { text-align: center; }
.image-tool__image { justify-content: center; display: flex; }
.image-tool__image-picture { margin: 0 auto; max-width: 100%; }
.image-tool__caption,
.cdx-input.image-tool__caption {
    display: block;
    width: 100%;
    text-align: center;
    margin: 8px auto 0;
}

/* ---------- Section boxes (overlay) ---------- */
.editor-scroll { position: relative; }
.sepp-section-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.sepp-section-box {
    position: absolute;
    left: -10px;
    right: -10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: transparent;
    transition: border-color .2s, box-shadow .2s;
}
.sepp-section-box.active {
    border-color: transparent;
    background:
        linear-gradient(var(--bg), var(--bg)) padding-box,
        var(--grad-ua) border-box;
    border: 1.5px solid transparent;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-yellow) 25%, transparent);
}
#editorjs { position: relative; z-index: 1; }

/* section header: no fill, just a light labeled bar */
.sepp-section {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px dashed var(--border) !important;
    border-radius: 0 !important;
    margin: 6px 0 6px !important;
    padding: 4px 2px 8px !important;
}
.sepp-section-title { font-family: var(--font-serif); font-size: 16px; font-weight: 600; }

/* ---------- Reminder tab (protrudes left, expands on hover) ---------- */
.sepp-reminder-wrap { position: relative; }
.sepp-reminder-tab {
    position: absolute;
    left: -14px;
    top: 2px;
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 5px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-blue);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 12px;
    cursor: default;
    z-index: 5;
    transition: left .12s, box-shadow .12s;
}
.sepp-reminder-tab.overdue { border-left-color: var(--danger); color: var(--danger); }
.sepp-reminder-tab .srt-clock { line-height: 1; }
.sepp-reminder-tab .srt-expand {
    display: none;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    white-space: nowrap;
}
.sepp-reminder-tab:hover {
    left: 6px;
    box-shadow: var(--shadow-pop);
    background: var(--surface-alt);
}
.sepp-reminder-tab:hover .srt-expand { display: inline-flex; }
.srt-date { color: var(--text); font-size: 12px; }
.srt-actions { display: inline-flex; gap: 4px; }
.srt-actions button {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 11px;
}
.srt-actions button:hover { border-color: var(--accent-yellow); color: var(--accent-yellow); }

/* ---------- Tags in sidebar ---------- */
.tag-filter { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.tag-filter-head {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-muted); margin-bottom: 8px;
}
.tag-reset {
    background: transparent; border: 1px solid var(--border);
    color: var(--text-muted); border-radius: 6px; padding: 1px 7px; font-size: 11px;
    text-transform: none; letter-spacing: 0;
}
.tag-reset:hover { color: var(--accent-yellow); border-color: var(--accent-yellow); }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    transition: border-color .12s, color .12s, background .12s;
}
.tag-chip:hover { color: var(--text); border-color: var(--text-muted); }
.tag-chip.on {
    color: var(--bg);
    border-color: transparent;
    background: var(--grad-ua);
    font-weight: 600;
}

/* ---------- Sidebar footer redesign ---------- */
.sidebar-footer { align-items: center; }
.footer-links { display: inline-flex; gap: 6px; }
.footer-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border: 1px solid var(--border);
    border-radius: 9px;
    text-decoration: none;
    font-size: 14px;
    color: var(--text-muted);
    transition: border-color .12s, color .12s;
}
.footer-links a:hover { color: var(--accent-yellow); border-color: var(--accent-yellow); }
.sidebar-new { padding: 10px; }
#notification-status-mini { font-size: 11px; }

/* ---------- Per-block copy button ---------- */
.sepp-block-copy {
    position: fixed;
    z-index: 60;
    width: 22px; height: 22px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    border-radius: 6px;
    font-size: 12px;
    line-height: 1;
    padding: 0;
}
.sepp-block-copy:hover { color: var(--accent-yellow); border-color: var(--accent-yellow); }

/* ---------- Scroll indicator ---------- */
.sepp-scroll-indicator {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
    z-index: 70;
}
.sepp-scroll-indicator.show { opacity: .85; }

/* ---------- Quote (custom) ---------- */
.sepp-quote {
    margin: 8px 0;
    padding: 4px 0 4px 14px;
    border-left: 3px solid var(--accent-blue);
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text);
    outline: none;
    min-height: 1.4em;
}
.sepp-quote:empty::before { content: attr(data-placeholder); color: var(--text-muted); font-style: normal; }

/* ---------- Code block (custom) ---------- */
.sepp-code {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 8px 0;
    background: var(--surface-alt);
}
.sepp-code-bar {
    display: flex;
    justify-content: flex-end;
    padding: 5px 8px;
    border-bottom: 1px solid var(--border);
}
.sepp-code-lang {
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 12px;
}
.sepp-code-textarea {
    width: 100%;
    border: none !important;
    background: transparent !important;
    color: var(--text) !important;
    font-family: ui-monospace, Menlo, Consolas, monospace !important;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 12px;
    resize: none;
    outline: none;
    display: block;
}
.sepp-code-pre {
    margin: 0;
    padding: 10px 12px;
    overflow-x: auto;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    cursor: text;
}
.sepp-code-pre code.hljs { background: transparent; padding: 0; }

/* ---------- Table (editorjs table) dark theme ---------- */
.tc-wrap { --color-border: var(--border); --color-background: var(--surface-alt); color: var(--text); }
.tc-table { border-color: var(--border); }
.tc-row { border-color: var(--border); }
.tc-cell { border-color: var(--border); color: var(--text); }
.tc-cell[heading], .tc-row--heading .tc-cell {
    background: color-mix(in srgb, var(--accent-blue) 14%, transparent);
    font-weight: 600;
}
.tc-add-row, .tc-add-column { color: var(--text-muted); }
.tc-add-row:hover, .tc-add-column:hover { background: var(--surface-alt); color: var(--text); }
.tc-toolbox__toggler, .tc-popover { color: var(--text); }
.tc-popover { background: var(--surface); border-color: var(--border); }
.tc-popover__item:hover { background: var(--surface-alt); }

/* ---------- Due-item done / edit buttons ---------- */
.due-item-done, .due-item-edit {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    border-radius: 7px;
    width: 26px; height: 26px;
    font-size: 13px;
    flex: none;
}
.due-item-done:hover { color: var(--success); border-color: var(--success); }
.due-item-edit:hover { color: var(--accent-yellow); border-color: var(--accent-yellow); }
.due-item-preview { cursor: pointer; }

/* callout warmer, less flat; subtle gradient */
.sepp-callout {
    background: linear-gradient(120deg, color-mix(in srgb, var(--cl, var(--accent-blue)) 10%, transparent), transparent 80%);
}

/* brand title wraps nicely */
.sidebar-header h1 { align-items: flex-start; line-height: 1.2; }
.sidebar-header h1 span { font-size: 15px; }
