
.notes-page { padding: var(--app-gutter, 24px) 0; }

.notes-app { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); height: calc(100vh - 2 * var(--app-gutter, 24px)); height: calc(100dvh - 2 * var(--app-gutter, 24px)); min-height: 480px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }

.notes-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--soft); }
.notes-side-top { display: grid; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.notes-search { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); font: 500 .95rem/1.3 var(--font-body); }
.notes-search::placeholder { color: #8b95a8; }
.notes-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; overscroll-behavior-x: contain; }
.notes-list li + li { margin-top: 4px; }
.notes-item { display: grid; gap: 3px; width: 100%; padding: 11px 12px; border: 1px solid transparent; border-radius: 10px; background: none; text-align: left; cursor: pointer; font-family: var(--font-body); color: var(--ink); }
.notes-item:hover { background: var(--white); }
.notes-item[aria-current="true"] { background: var(--white); border-color: var(--line); box-shadow: 0 1px 2px rgba(15, 27, 51, .06); }
.notes-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.notes-item strong { font-size: .98rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-item time { flex: none; font-size: .78rem; color: var(--muted); }
.notes-item-text { font-size: .86rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-pin { display: inline-block; vertical-align: -2px; margin-right: 4px; color: var(--brand); }
.notes-none { padding: 18px 12px; color: var(--muted); font-size: .92rem; }
.notes-side-foot { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); }
.notes-link { padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: 500 .82rem/1 var(--font-body); cursor: pointer; }
.notes-link:hover { color: var(--brand); background: var(--white); }

.notes-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.notes-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.notes-back { display: none; }
.notes-tool { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--muted); font: 600 .85rem/1 var(--font-body); cursor: pointer; }
.notes-tool:hover { background: var(--soft); color: var(--ink); }
.notes-tool[aria-pressed="true"] { background: var(--brand-tint); color: var(--brand-dark); }
.notes-tool.is-danger:hover { color: #b42318; }
.notes-tool.is-confirm { background: #fee4e2; color: #b42318; }
.notes-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.notes-spacer { flex: 1; }
.notes-fs { display: inline-flex; gap: 2px; }
.notes-title { width: 100%; padding: 20px 28px 8px; border: 0; outline: 0; background: none; color: var(--ink); font: 700 1.7rem/1.25 var(--font-head); letter-spacing: -.02em; }
.notes-title::placeholder { color: #a6aebd; }
.notes-body { flex: 1; width: 100%; min-height: 0; padding: 8px 28px 20px; border: 0; outline: 0; resize: none; background: none; color: var(--ink); font: 400 var(--notes-fs, 1.05rem)/1.7 var(--font-body); }
.notes-body::placeholder { color: #a6aebd; }
.notes-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 10px 28px; border-top: 1px solid var(--line); background: var(--soft); color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
.notes-foot .is-error { color: #b42318; }
.notes-empty { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 32px; text-align: center; color: var(--muted); }
.notes-empty h2 { font-size: 1.3rem; color: var(--ink); }
.notes-app.is-empty .notes-editor { display: none; }
.notes-app.is-empty .notes-empty { display: flex; }
.notes-editor { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.notes-toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-size: .92rem; box-shadow: var(--shadow); transform: translateX(-50%); }
.notes-toast[hidden] { display: none; }
.notes-toast button { border: 0; background: none; color: #9db4f0; font: 700 .92rem/1 var(--font-body); cursor: pointer; }

@media (max-width: 760px) {
    .notes-app { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 2 * var(--app-gutter, 24px)); height: calc(100dvh - 2 * var(--app-gutter, 24px)); }
    .notes-app .notes-main { display: none; }
    .notes-app.is-editing .notes-side { display: none; }
    .notes-app.is-editing .notes-main { display: flex; }
    .notes-back { display: inline-flex; }
    .notes-side { border-right: 0; }
    .notes-title { padding: 16px 18px 6px; font-size: 1.4rem; }
    .notes-body { padding: 6px 18px 16px; }
    .notes-foot { padding: 10px 18px; }
}

.notes-tags { width: 100%; padding: 0 28px 8px; border: 0; outline: 0; background: none; color: var(--muted); font: 500 .9rem/1.4 var(--font-body); }
.notes-tags::placeholder { color: #a6aebd; }
.notes-item mark { padding: 0 1px; border-radius: 2px; background: #fde68a; color: #1b1f2a; }
.notes-print { display: none; }
@media print {
    body > *:not(.notes-print) { display: none !important; }
    .notes-print { display: block; color: #000; }
    .notes-print h1 { margin-bottom: 12pt; font-size: 20pt; }
    .notes-print pre { white-space: pre-wrap; word-wrap: break-word; font: 12pt/1.5 var(--font-body); }
}
/* Thème sombre : variables et fond fournis par theme.css (html[data-theme="dark"]) */
html[data-theme="dark"] .notes-toast { background: #2e3547; }
html[data-theme="dark"] .notes-tool.is-confirm { background: #4a1d1a; color: #fda29b; }
html[data-theme="dark"] .notes-bk.is-old { color: #fda29b; }


.notes-preview { flex: 1; min-height: 0; overflow: auto; padding: 8px 28px 20px; color: var(--ink); font: 400 var(--notes-fs, 1.05rem)/1.7 var(--font-body); overflow-wrap: anywhere; }
.notes-preview > * + * { margin-top: .8em; }
.notes-preview h1, .notes-preview h2, .notes-preview h3, .notes-preview h4, .notes-preview h5, .notes-preview h6 { margin-top: 1.1em; line-height: 1.25; }
.notes-preview h1 { font-size: 1.7em; } .notes-preview h2 { font-size: 1.4em; } .notes-preview h3 { font-size: 1.2em; } .notes-preview h4, .notes-preview h5, .notes-preview h6 { font-size: 1em; }
.notes-preview ul, .notes-preview ol { padding-left: 1.4em; }
.notes-preview ul { list-style: disc; } .notes-preview ol { list-style: decimal; }
.notes-preview li input { margin-right: 4px; }
.notes-preview a { color: var(--brand); text-decoration: underline; }
.notes-preview code { padding: 1px 5px; border-radius: 5px; background: var(--soft); font: .9em ui-monospace, Menlo, Consolas, monospace; }
.notes-preview pre { padding: 12px 14px; overflow-x: auto; border-radius: 10px; background: var(--soft); }
.notes-preview pre code { padding: 0; background: none; }
.notes-preview blockquote { padding-left: 14px; border-left: 3px solid var(--line); color: var(--muted); margin-left: 0; margin-right: 0; }
.notes-preview hr { border: 0; border-top: 1px solid var(--line); }

.notes-app.is-drop { outline: 2px dashed var(--brand); outline-offset: -6px; }
.notes-body:disabled { cursor: not-allowed; opacity: .6; }
.notes-dialog { width: min(92vw, 380px); padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); color: var(--ink); box-shadow: var(--shadow); }
.notes-dialog::backdrop { background: rgba(15, 27, 51, .45); }
.notes-dialog h2 { font-size: 1.2rem; }
.notes-dialog p { margin: 8px 0 12px; color: var(--muted); font-size: .92rem; }
.notes-dialog .notes-pwd-err { margin: 8px 0 0; color: #b42318; }
.notes-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.notes-folder { width: 100%; padding: 0 28px 6px; border: 0; outline: 0; background: none; color: var(--muted); font: 500 .9rem/1.4 var(--font-body); }
.notes-folder::placeholder { color: #a6aebd; }
.notes-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--brand-tint); color: var(--ink); font-size: .85rem; font-weight: 600; }
.notes-bulk[hidden] { display: none; }
.notes-bulk .notes-search { flex: 1 1 100%; padding: 7px 10px; font-size: .85rem; }
.notes-bulk .notes-link:disabled { opacity: .4; cursor: default; }
.notes-item.is-sel { background: var(--brand-tint); border-color: var(--brand); }

.notes-tree { border: 1px solid var(--line); border-radius: 10px; background: var(--white); overflow: hidden; }
.notes-tree[hidden] { display: none; }
.notes-tree-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2px 6px; padding: 4px 6px 2px 12px; color: var(--muted); font: 600 .74rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .04em; }
.notes-tree-head > span:last-child { display: flex; flex-wrap: wrap; gap: 2px; text-transform: none; letter-spacing: 0; }
.notes-tree ul { max-height: 150px; overflow-y: auto; padding: 0 4px 4px; }
.notes-fold { display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 6px 8px 6px calc(8px + var(--d, 0) * 14px); border: 0; border-radius: 8px; background: none; color: var(--ink); font: 500 .88rem/1.2 var(--font-body); text-align: left; cursor: pointer; }
.notes-fold span { flex: none; color: var(--muted); font-size: .78rem; }
.notes-fold:hover { background: var(--soft); }
.notes-fold.is-active { background: var(--brand-tint); color: var(--brand-dark); font-weight: 600; }
.notes-fold.is-over, .notes-link.is-over { outline: 2px dashed var(--brand); background: var(--brand-tint); }
.notes-list li[draggable="true"] { cursor: grab; }

.notes-views { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.notes-view { flex: 1; padding: 5px 4px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: 600 .78rem/1.2 var(--font-body); cursor: pointer; }
.notes-view[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 27, 51, .12); }
.notes-item-folder { display: none; }
.notes-list.is-compact .notes-item-text { display: none; }
.notes-list.is-compact .notes-item { padding-top: 7px; padding-bottom: 7px; }
.notes-list.is-table .notes-item { display: grid; grid-template-columns: minmax(0, 1fr) 74px 52px; gap: 8px; align-items: center; padding-top: 7px; padding-bottom: 7px; }
.notes-list.is-table .notes-item-head { display: contents; }
.notes-list.is-table .notes-item-text { display: none; }
.notes-list.is-table .notes-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-list.is-table .notes-item-folder { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .78rem; }
.notes-list.is-table time { color: var(--muted); font-size: .78rem; text-align: right; }
.notes-thead { display: grid; grid-template-columns: minmax(0, 1fr) 74px 52px; gap: 8px; padding: 6px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font: 600 .72rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .04em; }
.notes-thead span:last-child { text-align: right; }
.notes-list.is-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 8px; padding: 8px; }
.notes-list.is-cards li { border: 1px solid var(--line); border-radius: 12px; }
.notes-list.is-cards .notes-item-text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.notes-list.is-cards .notes-item-folder { display: inline-block; margin-top: 6px; padding: 1px 7px; border-radius: 99px; background: var(--soft); color: var(--muted); font-size: .72rem; }
.notes-list.is-cards .notes-none { grid-column: 1 / -1; border: 0; }
.notes-list li { position: relative; overflow: hidden; touch-action: pan-y; }
.notes-list .notes-item { position: relative; transition: transform .2s ease; }
.notes-list li.is-swiped > .notes-item { transform: translateX(-88px); }
.notes-swipe-del { position: absolute; top: 0; right: 0; bottom: 0; width: 88px; border: 0; background: #d92d20; color: #fff; font: 600 .85rem var(--font-body); cursor: pointer; visibility: hidden; }
.notes-list li.is-swiped > .notes-swipe-del, .notes-list li.is-swiping > .notes-swipe-del { visibility: visible; }

.notes-fmt { display: flex; gap: 2px; padding: 4px 28px; overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.notes-fmt[hidden] { display: none; }
.notes-fmt button { flex: none; min-width: 32px; padding: 6px 9px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: 600 .84rem/1 var(--font-body); white-space: nowrap; cursor: pointer; }
.notes-fmt button:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
.notes-fmt button:disabled { opacity: .4; cursor: default; }
.notes-preview li.is-task { margin-left: -1.2em; list-style: none; }
.notes-preview li.is-done { color: var(--muted); text-decoration: line-through; }
.notes-preview li input[type="checkbox"] { cursor: pointer; }

.notes-tagbar { display: flex; flex-wrap: wrap; gap: 4px; max-height: 76px; overflow-y: auto; }
.notes-tagbar[hidden] { display: none; }
.notes-tag { padding: 3px 9px; border: 1px solid var(--line); border-radius: 99px; background: var(--white); color: var(--muted); font: 600 .76rem/1.3 var(--font-body); cursor: pointer; }
.notes-tag span { margin-left: 2px; font-weight: 500; opacity: .7; }
.notes-tag:hover { color: var(--ink); }
.notes-tag[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-dark); }

.notes-bk { flex: 1 0 100%; padding: 2px 8px 0; color: var(--muted); font-size: .74rem; }
.notes-bk[hidden] { display: none; }
.notes-bk.is-old { color: #b42318; }

.notes-hist { width: min(94vw, 780px); }
.notes-hist-grid { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 12px; height: min(50vh, 380px); }
.notes-hist-grid ul { min-height: 0; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 10px; }
.notes-hist-item { display: grid; gap: 2px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--ink); font: 500 .85rem/1.3 var(--font-body); text-align: left; cursor: pointer; }
.notes-hist-item span { overflow: hidden; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.notes-hist-item:hover { background: var(--soft); }
.notes-hist-item[aria-current="true"] { border-color: var(--brand); background: var(--brand-tint); }
.notes-hist-view { min-height: 0; margin: 0; padding: 12px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); font: .88rem/1.55 var(--font-body); white-space: pre-wrap; overflow-wrap: anywhere; }

.notes-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.notes-quick .btn { padding: 9px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); font-size: .88rem; font-weight: 600; cursor: pointer; }
.notes-quick .btn:hover { border-color: var(--brand); }
.notes-quick select { padding: 9px 10px; font-size: .88rem; }
.notes-backlinks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 8px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.notes-backlinks[hidden] { display: none; }
.notes-preview a.notes-wiki { text-decoration: none; border-bottom: 1px dashed var(--brand); }
.notes-preview a.notes-wiki.is-missing { border-bottom-color: #d92d20; color: #b42318; }
.notes-app.is-focus { grid-template-columns: minmax(0, 1fr); }
.notes-app.is-focus .notes-side { display: none; }
.notes-app.is-focus :is(.notes-title, .notes-tags, .notes-folder, .notes-work, .notes-fmt, .notes-backlinks) { width: 100%; max-width: 860px; margin-inline: auto; }
.notes-app.is-focus .notes-work.is-split { max-width: 1280px; }

.notes-preview img { display: block; max-width: 100%; height: auto; border-radius: 8px; }
.notes-preview img:not([src]) { min-height: 1.2em; visibility: hidden; }
.notes-settings { width: min(94vw, 460px); }
.notes-settings section { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.notes-settings section:first-of-type { border-top: 0; }
.notes-settings h3 { font-size: .95rem; }
.notes-settings p { margin: 0; }
.notes-set-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: .92rem; }
.notes-set-row .notes-search { width: auto; min-width: 140px; }
.notes-settings .btn, .notes-keys .btn { cursor: pointer; }
.notes-keys { width: min(94vw, 520px); }
.notes-keys dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 12px 0; font-size: .92rem; }
.notes-keys dt { white-space: nowrap; }
.notes-keys dd { margin: 0; color: var(--muted); }
.notes-keys kbd { padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); font: 600 .8rem var(--font-body); }
.notes-keys code { padding: 1px 5px; border-radius: 5px; background: var(--soft); font-size: .85em; }
.notes-app[inert] { opacity: .35; }

.notes-bk-btn { padding: 2px 8px 0; border: 0; background: none; font: inherit; font-size: .74rem; text-align: left; cursor: pointer; }
.notes-bk-btn:hover { text-decoration: underline; }
.notes-settings section[hidden] { display: none; }
.notes-set-hint { color: var(--muted); font-size: .8rem; }

.notes-list.is-cards .notes-item { height: 100%; align-content: start; }
.notes-list.is-cards .notes-item-head { display: block; }
.notes-list.is-cards .notes-item strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; overflow-wrap: anywhere; }
.notes-list.is-cards .notes-item time { display: block; margin-top: 2px; }
.notes-list.is-table .notes-item-folder:empty::before { content: '—'; }
.notes-list.is-cards .notes-item-folder:empty { display: none; }

.notes-work { display: flex; flex: 1; min-height: 0; }
.notes-work > .notes-body, .notes-work > .notes-preview { flex: 1 1 0; min-width: 0; }
.notes-work.is-split > .notes-preview { border-left: 1px solid var(--line); background: var(--soft); }
.notes-preview strong { font-weight: 700; }
.notes-preview em { font-style: italic; }
.notes-preview del { text-decoration: line-through; }
.notes-preview h1, .notes-preview h2, .notes-preview h3, .notes-preview h4, .notes-preview h5, .notes-preview h6 { font-weight: 700; }
.notes-preview [data-l] { border-radius: 4px; transition: background-color .12s ease; }
.notes-work.is-split .notes-preview [data-l].is-cur { background: var(--brand-tint); box-shadow: -6px 0 0 var(--brand-tint), -9px 0 0 var(--brand); }
@media (max-width: 1000px) {
    .notes-work.is-split { flex-direction: column; }
    .notes-work.is-split > .notes-preview { border-left: 0; border-top: 1px solid var(--line); }
}
.notes-wys { flex: 1; min-height: 0; overflow: auto; padding: 8px 28px 20px; color: var(--ink); font: 400 var(--notes-fs, 1.05rem)/1.7 var(--font-body); overflow-wrap: anywhere; outline: 0; cursor: text; white-space: pre-wrap; -webkit-user-select: text; user-select: text; -webkit-tap-highlight-color: transparent; caret-color: var(--brand); }
.notes-wys > * + * { margin-top: .8em; }
.notes-wys h1, .notes-wys h2, .notes-wys h3, .notes-wys h4, .notes-wys h5, .notes-wys h6 { margin-top: 1.1em; line-height: 1.25; font-weight: 700; }
.notes-wys h1 { font-size: 1.7em; } .notes-wys h2 { font-size: 1.4em; } .notes-wys h3 { font-size: 1.2em; } .notes-wys h4, .notes-wys h5, .notes-wys h6 { font-size: 1em; }
.notes-wys ul, .notes-wys ol { padding-left: 1.4em; }
.notes-wys ul { list-style: disc; } .notes-wys ol { list-style: decimal; }
.notes-wys li input { margin-right: 4px; }
.notes-wys a { color: var(--brand); text-decoration: underline; }
.notes-wys code { padding: 1px 5px; border-radius: 5px; background: var(--soft); font: .9em ui-monospace, Menlo, Consolas, monospace; }
.notes-wys pre { padding: 12px 14px; overflow-x: auto; border-radius: 10px; background: var(--soft); white-space: pre-wrap; }
.notes-wys pre code { padding: 0; background: none; }
.notes-wys blockquote { padding-left: 14px; border-left: 3px solid var(--line); color: var(--muted); margin-left: 0; margin-right: 0; }
.notes-wys hr { border: 0; border-top: 1px solid var(--line); }
.notes-wys li.is-task { margin-left: -1.2em; list-style: none; }
.notes-wys li.is-done { color: var(--muted); text-decoration: line-through; }
.notes-wys li input[type="checkbox"] { cursor: pointer; }
.notes-wys a.notes-wiki { text-decoration: none; border-bottom: 1px dashed var(--brand); cursor: pointer; }
.notes-wys a.notes-wiki.is-missing { border-bottom-color: #d92d20; color: #b42318; }
.notes-wys img { display: block; max-width: 100%; height: auto; border-radius: 8px; cursor: default; }
.notes-wys img:not([src]) { min-height: 1.2em; visibility: hidden; }
.notes-wys strong { font-weight: 700; }
.notes-wys em { font-style: italic; }
.notes-wys del { text-decoration: line-through; }

.notes-work > .notes-wys { flex: 1 1 0; min-width: 0; }
.notes-wys.is-empty > :first-child::before { content: var(--ph, ''); color: #a6aebd; pointer-events: none; }
.notes-wys.is-disabled { cursor: not-allowed; opacity: .6; }
.notes-fmt button[aria-pressed="true"] { background: var(--brand-tint); color: var(--brand); }

/* Ajustements mobiles regroupés */
@media (max-width: 760px) {
    .notes-tags { padding: 0 18px 6px; }
    .notes-preview { padding: 6px 18px 16px; }
    .notes-folder { padding: 0 18px 6px; }
    .notes-fmt { padding: 4px 18px; }
    .notes-hist-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: 130px minmax(0, 1fr); height: 62vh; }
    .notes-backlinks { padding: 8px 18px; }
    #noteFocus { display: none; }
    .notes-wys { padding: 6px 18px 16px; }
}

/* Mise en forme dans l'aperçu de la liste */
.notes-item-text strong { font-weight: 700; font-size: inherit; color: var(--ink); overflow: visible; text-overflow: clip; white-space: inherit; }
.notes-item-text em { font-style: italic; }
.notes-item-text del { text-decoration: line-through; }
.notes-item-text code { padding: 0 4px; border-radius: 4px; background: var(--soft); font: .92em ui-monospace, Menlo, Consolas, monospace; }

/* Lien vers la calculatrice */
a.notes-link { display: inline-block; text-decoration: none; }

/* ===== Tableaux, outils du tableau, ordre des épingles ===== */
.notes-tool[hidden] { display: none; }
.notes-tool:disabled { opacity: .35; cursor: default; }
.notes-preview table, .notes-wys table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.notes-preview th, .notes-preview td, .notes-wys th, .notes-wys td { min-width: 4.5em; height: 2.3em; padding: 6px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; white-space: normal; overflow-wrap: anywhere; }
.notes-preview th, .notes-wys th { background: var(--soft); font-weight: 700; }
.notes-wys td:focus-within, .notes-wys th:focus-within { outline: 2px solid var(--brand); outline-offset: -2px; }
.notes-preview ul ul, .notes-preview ol ol, .notes-preview ul ol, .notes-preview ol ul,
.notes-wys ul ul, .notes-wys ol ol, .notes-wys ul ol, .notes-wys ol ul { margin-top: .2em; }
.notes-preview ul ul, .notes-wys ul ul { list-style: circle; }
.notes-preview ul ul ul, .notes-wys ul ul ul { list-style: square; }
.notes-tbl { align-items: center; background: var(--soft); }
.notes-tbl-label { flex: none; padding: 0 8px 0 2px; color: var(--muted); font: 700 .72rem/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; }
.notes-tbl button[data-tbl="del"]:hover { color: #b42318; }
.notes-app.is-focus .notes-tbl { width: 100%; max-width: 860px; margin-inline: auto; }
@media (max-width: 760px) {
    .notes-preview th, .notes-preview td, .notes-wys th, .notes-wys td { padding: 6px 8px; }
}

/* ===== Boutons à icône seule ===== */
.notes-ic { display: block; flex: none; width: 18px; height: 18px; pointer-events: none; }
.notes-link.has-ic, .notes-tool.has-ic { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; }
.notes-link.has-ic[hidden] { display: none; }
.notes-side-foot { gap: 2px; }
.notes-link.has-ic[aria-pressed="true"] { color: var(--brand-dark); background: var(--brand-tint); }
.notes-link.has-ic:focus-visible, .notes-tool.has-ic:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.notes-cnt { position: absolute; top: 0; right: 0; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--brand); color: #fff; font: 700 .64rem/15px var(--font-body); text-align: center; pointer-events: none; }
.notes-tool.is-confirm .notes-ic { animation: notes-shake .25s; }
@keyframes notes-shake { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }

/* ===== Colonne de gauche : tout défile, sauf la barre de boutons du bas ===== */
.notes-side { overflow-y: auto; overscroll-behavior: contain; }
.notes-side-top, .notes-bulk { flex: none; }
.notes-list { flex: none; overflow: visible; }
.notes-side-foot { position: sticky; bottom: 0; z-index: 2; flex: none; margin-top: auto; background: var(--soft); }
