/* nio · Notes */
.page:has(.nt) { max-width: 1240px; }
.nt-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.nt-title h1 { font-size: 30px; font-weight: 500; letter-spacing: -.05em; line-height: 1.1; }
.nt-title p { margin-top: 4px; color: var(--fg-muted); }
.nt-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.nt-search { flex: 1; position: relative; display: flex; align-items: center; }
.nt-search .ico { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--fg-muted); pointer-events: none; }
.nt-search input { width: 100%; height: 42px; padding: 0 14px 0 38px; border: 1px solid var(--border); border-radius: 12px; background: var(--white); font: inherit; color: var(--fg); transition: border-color .2s, box-shadow .2s; }
.nt-search input:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fg) 10%, transparent); }
.nt-new { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin: 0 0 20px; padding: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--white); color: var(--fg-muted); cursor: default; box-shadow: 0 1px 2px rgba(39,34,36,.05), 0 6px 20px -14px rgba(39,34,36,.35); transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .2s; }
.nt-new:hover { border-color: color-mix(in srgb, var(--fg) 30%, var(--border)); box-shadow: 0 1px 2px rgba(39,34,36,.06), 0 10px 28px -14px rgba(39,34,36,.45); }
.nt-new:active { transform: scale(.995); }
.nt-write { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; text-align: left; font: inherit; color: var(--fg-muted); cursor: pointer; }
.nt-new-b { display: flex; gap: 2px; }
.nt-new-b button, .nt-ib { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; height: 40px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent; color: var(--fg-muted); cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; transition: background .15s, color .15s, transform .15s var(--ease); }
.nt-new-b button:hover, .nt-ib:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); color: var(--fg); }
.nt-ib:active, .nt-new-b button:active { transform: scale(.92); }
.nt-ib.on { color: var(--fg); background: color-mix(in srgb, var(--fg) 10%, transparent); }
.nt-ib.sm { min-width: 30px; height: 30px; }
.nt .ico, .nt-ed .ico, .nt-pop .ico { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nt-ib.on .ico { fill: currentColor; fill-opacity: .15; }

.nt-filters { display: grid; overflow: visible; gap: 10px; margin-bottom: 0; padding: 2px 2px 12px; }
.nt-filter-views, .nt-filter-labels { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nt-filter-labels > span, .nt-results { font-size: 12px; color: var(--fg-muted); }
.nt-results { margin: 2px 2px 16px; overflow-wrap: anywhere; }
.nt-chip { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 36px; height: auto; white-space: normal; overflow-wrap: anywhere; max-width: 100%; padding: 0 13px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--fg-muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: background .18s, color .18s, border-color .18s, transform .18s var(--ease); }
.nt-chip .ico { width: 15px; height: 15px; }
.nt-chip:hover { border-color: var(--fg); color: var(--fg); }
.nt-chip[aria-current="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.nt-chip:active { transform: scale(.96); }

.nt-sec { margin: 8px 2px 10px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--fg-muted); }
.nt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; align-items: start; margin-bottom: 28px; }
.nt[data-layout="list"] .nt-grid { grid-template-columns: 1fr; max-width: 800px; margin-inline: auto; }
.nt[data-layout="list"] .nt-txt { -webkit-line-clamp: 4; }
.nt-grid > .nt-card { margin-bottom: 0; min-width: 0; }
.nt-card { position: relative; display: block; break-inside: avoid; margin: 0 0 14px; padding: 14px 15px 12px; border: 1px solid color-mix(in srgb, var(--fg) 13%, transparent); border-radius: 14px; background: var(--nc, var(--white)); cursor: pointer; transition: box-shadow .25s var(--ease), transform .25s var(--ease), opacity .2s; }
.nt-card:hover { box-shadow: 0 10px 28px -16px rgba(39,34,36,.5); transform: translateY(-2px); }
.nt-card:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.nt-card h3 { margin: 0 28px 6px 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; overflow-wrap: anywhere; }
.nt-txt { font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 10; -webkit-box-orient: vertical; overflow: hidden; }
.nt-txt.muted { color: var(--fg-muted); }
.nt-its { display: grid; gap: 3px; margin-top: 4px; }
.nt-it { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.4; }
.nt-it input { margin: 3px 0 0; accent-color: var(--fg); flex: none; cursor: pointer; width: 15px; height: 15px; }
.nt-it span { overflow-wrap: anywhere; }
.nt-it.done span { text-decoration: line-through; color: var(--fg-muted); }
.nt-more { font-size: 12px; color: var(--fg-muted); margin-left: 23px; }
.nt-pin { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--fg-muted); cursor: pointer; opacity: .65; transition: opacity .18s, background .15s; }
.nt-pin .ico { width: 17px; height: 17px; }
.nt-card:hover .nt-pin, .nt-pin.on, .nt-pin:focus-visible { opacity: 1; }
.nt-pin.on { color: var(--fg); } .nt-pin.on .ico { fill: currentColor; fill-opacity: .2; }
.nt-pin:hover { background: color-mix(in srgb, var(--fg) 10%, transparent); }
.nt-badge { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--fg-muted); }
.nt-badge .ico { width: 14px; height: 14px; } .nt-badge.err { color: var(--red); }
.nt-labels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nt-label { display: inline-flex; align-items: center; gap: 2px; height: auto; min-height: 22px; max-width: 100%; overflow-wrap: anywhere; padding: 0 9px; border-radius: 999px; background: color-mix(in srgb, var(--fg) 9%, transparent); font-size: 12px; font-weight: 500; }
.nt-label button { display: grid; place-items: center; width: 16px; height: 16px; margin: 0 -5px 0 2px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.nt-label button .ico { width: 11px; height: 11px; }
.nt-acts { display: flex; gap: 2px; justify-content: flex-end; height: 36px; margin-top: 12px; }
.nt-acts button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--fg-muted); cursor: pointer; }
.nt-acts button:hover { background: color-mix(in srgb, var(--fg) 10%, transparent); color: var(--fg); }
.nt-acts .ico { width: 17px; height: 17px; }
@media (hover: none) { .nt-pin { opacity: 1; } }
.nt-empty { padding: 56px 12px; text-align: center; color: var(--fg-muted); }
.nt-trash-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; color: var(--fg-muted); font-size: 13px; }
.nt-skel { display: block; height: 110px; margin-bottom: 14px; border-radius: 14px; background: linear-gradient(100deg, var(--bg-2) 30%, color-mix(in srgb, var(--bg-2) 55%, var(--white)) 50%, var(--bg-2) 70%) 0 0 / 220% 100%; animation: nt-sh 1.3s linear infinite; break-inside: avoid; }
.nt-skel.tall { height: 170px; }
@keyframes nt-sh { to { background-position: -120% 0; } }
.nt-undo { margin-left: 8px; padding: 0 2px; border: 0; background: none; color: var(--lemon); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* colors (targetes i editor) */
[data-color="lemon"] { --nc: #f1efa4; } [data-color="peach"] { --nc: #f8d9c8; } [data-color="moss"] { --nc: #d6dccb; }
[data-color="sky"] { --nc: #d3e3ea; } [data-color="lilac"] { --nc: #e0d9ec; } [data-color="rose"] { --nc: #f1d5d1; } [data-color="sand"] { --nc: #e7ddc9; }
[data-color=""] { --nc: var(--white); }

/* editor */
.nt-ov { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(39,34,36,.32); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); overscroll-behavior: contain; }
body:has(.nt-ov) { overflow: hidden; }
.nt-ed { position: relative; display: flex; flex-direction: column; width: min(800px, 100%); min-height: min(480px, 80dvh); border-radius: 18px; background: var(--nc, var(--white)); border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent); box-shadow: 0 30px 80px -24px rgba(39,34,36,.6); transition: background .25s; }
.nt-ed-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 0; }
.nt-ed-nav > span { font-size: 12px; color: var(--fg-muted); }
.nt-back { color: var(--fg); }
.nt-ed-head { display: flex; align-items: center; gap: 6px; padding: 12px 28px 8px; }
.nt-ed input.nt-ed-title { flex: 1; width: auto; padding: 0; border-radius: 0; box-shadow: none; min-width: 0; height: 40px; border: 0; background: transparent; font: inherit; font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--fg); outline: none; }
.nt-ed-title::placeholder, .nt-ed-text::placeholder, .nt-item input[type=text]::placeholder { color: color-mix(in srgb, var(--fg) 40%, transparent); }
.nt-ed-body { flex: 1; min-height: 80px; overflow-y: auto; padding: 4px 28px 24px; overscroll-behavior: contain; }
.nt-ed-text { display: block; width: 100%; min-height: 220px; max-height: 52vh; padding: 0; border: 0; background: transparent; font: inherit; font-size: 16px; line-height: 1.6; color: var(--fg); resize: none; outline: none; overflow-y: auto; }
.nt-ed-text.nt-desc { min-height: 0; margin-bottom: 10px; }
.nt-item { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.nt-item input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--fg); flex: none; cursor: pointer; }
.nt-item input[type=text] { flex: 1; min-width: 0; height: 30px; padding: 0; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--fg); outline: none; }
.nt-item.done input[type=text] { text-decoration: line-through; color: var(--fg-muted); }
.nt-x { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--fg-muted); cursor: pointer; opacity: 0; transition: opacity .15s; }
.nt-item:hover .nt-x, .nt-x:focus-visible { opacity: 1; } .nt-x .ico { width: 14px; height: 14px; }
@media (hover: none) { .nt-x { opacity: .7; } }
.nt-add { display: flex; align-items: center; gap: 10px; margin: 2px 0 6px; padding: 4px 0; border: 0; background: transparent; color: var(--fg-muted); font: inherit; font-size: 14px; cursor: pointer; }
.nt-add .ico { width: 17px; height: 17px; } .nt-add:hover { color: var(--fg); }
.nt-donehd { margin: 10px 0 4px; font-size: 12px; font-weight: 600; color: var(--fg-muted); }
.nt-audio { display: grid; gap: 6px; padding: 0 20px 8px; }
.nt-au { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 12px; background: color-mix(in srgb, var(--fg) 6%, transparent); font-size: 13px; }
.nt-au .nt-ib { background: var(--fg); color: var(--bg); } .nt-au .nt-ib .ico { width: 14px; height: 14px; fill: currentColor; }
.nt-au-d { font-weight: 600; font-variant-numeric: tabular-nums; }
.nt-au-s { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--fg-muted); }
.nt-au-s .ico { width: 14px; height: 14px; color: var(--moss); }
.nt-au[data-st="error"] .nt-au-s { color: var(--red); }
.nt-spin { width: 13px; height: 13px; border: 2px solid color-mix(in srgb, var(--fg) 20%, transparent); border-top-color: var(--fg); border-radius: 50%; animation: nt-rot .7s linear infinite; flex: none; }
@keyframes nt-rot { to { transform: rotate(360deg); } }
.nt-ed-labels { padding: 0 20px 6px; margin: 0; }
.nt-ed-nav, .nt-ed-head, .nt-ed-foot, .nt-audio, .nt-ed-labels, .nt-rec { flex-shrink: 0; }
.nt-save { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 8px; min-width: 0; font-size: 12px; color: var(--fg-muted); text-align: right; }
.nt-save .err { color: var(--red); }
.nt-save button[hidden] { display: none; }
.nt-warning { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); font-size: 13px; }
.nt :is(button, input):focus-visible, .nt-ed :is(button, input, textarea):focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
/* Dins la nota s'escriu com en un full: cap requadre al voltant del text, només el cursor. */
.nt-ed :is(.nt-ed-title, .nt-ed-text, .nt-item input[type=text]):is(:focus, :focus-visible), .nt-search input:focus-visible { outline: none; }
.nt-ed :is(.nt-ed-title, .nt-ed-text, .nt-item input[type=text]) { -webkit-tap-highlight-color: transparent; }
.nt-pop { overflow-y: auto; overscroll-behavior: contain; }
.nt-ed-foot { border-top: 1px solid color-mix(in srgb, var(--fg) 10%, transparent); padding: 12px 16px; }
.nt-tb { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nt-edit-tools, .nt-note-tools { display: flex; align-items: center; gap: 2px; min-width: 0; }
.nt-note-tools { margin-left: auto; }
.nt-ai-b { padding: 0 11px; } .nt-ai-b span { display: inline; }
.nt-done { height: 36px; padding: 0 16px; margin-left: 6px; }
.nt-rec { display: flex; align-items: center; gap: 10px; margin: 0 14px 12px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--red) 10%, var(--white)); }
.nt-rec[hidden], .nt-ai[hidden], .nt-ed-foot[hidden], .nt-audio[hidden], .nt-ed-labels[hidden] { display: none; }
.nt-rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: nt-pulse 1.1s ease-in-out infinite; flex: none; }
@keyframes nt-pulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 45%, transparent); } 50% { transform: scale(1.15); box-shadow: 0 0 0 8px transparent; } }
.nt-rec-t { font-weight: 600; font-variant-numeric: tabular-nums; }
.nt-rec-l { flex: 1; color: var(--fg-muted); font-size: 13px; }
.nt .btn.sm, .nt-ed .btn.sm, .nt-pop .btn.sm { height: 30px; padding: 0 12px; font-size: 13px; }

/* Panell «Més» (mòbil): llista de text, sense icones; es tanca lliscant cap avall o tocant fora. */
.nt-more-btn { display: none; }
.nt-more-scrim { position: absolute; inset: 0; z-index: 5; background: rgba(39,34,36,.28); transition: opacity .25s; }
.nt-more-scrim[hidden] { display: none; }
.nt-more-sheet { position: absolute; bottom: 0; left: 0; right: 0; z-index: 6; display: grid; gap: 2px; padding: 6px 12px calc(12px + var(--safe-b)); border-radius: 18px 18px 0 0; background: var(--white); box-shadow: 0 -8px 30px rgba(39,34,36,.14); touch-action: none; transition: transform .3s cubic-bezier(.22,1,.36,1); }
.nt-more-sheet[hidden] { display: none; }
.nt-more-grab { width: 40px; height: 5px; margin: 4px auto 10px; border-radius: 5px; background: var(--border); }
.nt-more-sheet button { display: block; width: 100%; min-height: 52px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; text-align: left; font: inherit; font-size: 16px; font-weight: 500; color: var(--fg); cursor: pointer; transition: background .15s; }
.nt-more-sheet button:active { background: color-mix(in srgb, var(--fg) 8%, transparent); }
.nt-more-sheet button.danger { color: var(--red); }
.nt-more-sheet button.muted { color: var(--fg-muted); text-align: center; }

/* Al mòbil, el panell «Més» i els desplegables són fulls de baix que segueixen el dit: el navegador no s'ho queda per desplaçar. */
.nt-more-sheet, .nt-pop-sheet { touch-action: none; }
.nt-pop.nt-pop-sheet { position: absolute; z-index: 6; left: 0 !important; right: 0; bottom: 0 !important; top: auto; min-width: 0; max-width: none; max-height: 75% !important; overflow: auto; overscroll-behavior: contain; padding: 6px 12px calc(14px + var(--safe-b)); border: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(39,34,36,.14); animation: nt-sheet-up .28s cubic-bezier(.22,1,.36,1); }
.nt-pop-sheet input, .nt-pop-sheet select { touch-action: manipulation; }
@keyframes nt-sheet-up { from { transform: translateY(100%); } }

/* finestretes */
.nt-pop { position: absolute; z-index: 5; min-width: 220px; max-width: min(340px, calc(100% - 16px)); padding: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--white); box-shadow: 0 18px 50px -14px rgba(39,34,36,.5); animation: nt-pop .18s var(--ease); transform-origin: bottom left; }
@keyframes nt-pop { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.nt-pad { display: block; padding: 6px 8px; }
.nt-colors { display: flex; gap: 8px; padding: 6px; flex-wrap: wrap; }
.nt-dot { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--fg) 22%, transparent); background: var(--nc, var(--white)); cursor: pointer; transition: transform .15s var(--ease); }
.nt-dot:hover { transform: scale(1.12); } .nt-dot[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--white), 0 0 0 3.5px var(--fg); }
.nt-lf { display: flex; gap: 6px; padding: 4px; }
.nt-lf input { flex: 1; min-width: 0; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--white); font: inherit; font-size: 13px; color: var(--fg); }
.nt-lsug { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 4px 2px; }
.nt-sel { width: 100%; height: 34px; margin-top: 4px; padding: 0 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--white); font: inherit; font-size: 13px; color: var(--fg); }
.nt-acts-list { display: grid; gap: 2px; padding: 4px 0; }
.nt-acts-list button { display: grid; gap: 1px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; font: inherit; color: var(--fg); cursor: pointer; transition: background .15s; }
.nt-acts-list button:hover:not(:disabled) { background: color-mix(in srgb, var(--fg) 7%, transparent); }
.nt-acts-list button:disabled { opacity: .45; cursor: default; }
.nt-acts-list b { font-size: 14px; font-weight: 600; } .nt-acts-list span { font-size: 12px; color: var(--fg-muted); }
.nt-note { padding: 4px 8px 2px; }
.nt-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; } .nt-steps .ico { width: 15px; height: 15px; vertical-align: -3px; }

/* panell de l'assistent dins l'editor */
.nt-ai { margin: 0 14px 10px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.62); border: 1px solid color-mix(in srgb, var(--fg) 10%, transparent); animation: nt-pop .22s var(--ease); max-height: 38vh; overflow: auto; }
.nt-ai-run, .nt-ai-err { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fg-muted); } .nt-ai-err { color: var(--red); justify-content: space-between; }
.nt-ai-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.nt-ai-h span { display: inline-flex; align-items: center; gap: 6px; } .nt-ai-h .ico { width: 15px; height: 15px; } .nt-ai-h small { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--fg-muted); }
.nt-ai-b { font-size: 14px; line-height: 1.5; } .nt-ai-b pre { margin: 6px 0 0; white-space: pre-wrap; font: inherit; } .nt-ai-b ul { margin: 0; padding-left: 18px; } .nt-ai-b p { margin: 0 0 6px; }
.nt-ai-f { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

@media (max-width: 700px) {
  /* Els desplegables de la nota (color, etiqueta, assistent) ocupen l'amplada, amb marge: no se surten pels costats. */
  .nt-pop { left: 10px !important; right: 10px; max-width: none; min-width: 0; }
  .page:has(.nt) { padding-inline: 14px; }
  .nt-title h1 { font-size: 26px; } .nt-title p { display: none; }
  .nt-top { margin-bottom: 12px; } .nt-tools .btn span { display: none; } .nt-tools .btn { padding: 0 11px; }
  .nt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .nt-card { margin-bottom: 10px; padding: 12px; }
  .nt-ov { padding: 0; align-items: flex-end; top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100dvh); background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nt-ed { width: 100%; min-height: 0; height: 100%; max-height: 100%; border-radius: 0; border: 0; padding-top: var(--safe-t); padding-bottom: var(--safe-b); }
  .nt-ed-nav { padding-inline: 12px; } .nt-ed-nav > span { font-size: 11px; }
  .nt-ed-head { padding: 10px 16px 8px; }
  .nt-ed-body { padding: 4px 16px 16px; }
  .nt-ed-foot { padding: 8px; }
  .nt-ed-title { font-size: 19px; }
  .nt-ai-b span { display: none; } .nt-ai-b { padding: 0 9px; }
  .nt-new-b button, .nt-ib, .nt-acts button { min-width: 44px; height: 44px; }
  .nt-acts { height: 44px; }
  .nt-chip { min-height: 44px; }
  .nt-tb { gap: 0; }
  .nt-done { height: 44px; }
  .nt-search input { height: 44px; font-size: 16px; }
  .nt-filter-views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .nt-filter-views .nt-chip { padding: 8px 4px; justify-content: center; gap: 4px; font-size: 12px; }
  .nt-filter-views .ico { width: 14px; height: 14px; }
  .nt-edit-tools { width: 100%; justify-content: space-around; }
  .nt-tb .nt-ib .ico { width: 22px; height: 22px; }
  .nt-more-btn { display: inline-flex; }
  .nt-note-tools { display: none; }
  .nt-pin { width: 44px; height: 44px; top: 2px; right: 2px; }
  .nt-card h3 { margin-right: 32px; }
  .nt-item { min-height: 44px; }
  .nt-x { width: 44px; height: 44px; opacity: .7; }
  .nt-add { min-height: 44px; }
  .nt-dot { width: 36px; height: 36px; }
  .nt-colors { gap: 10px; }
  .nt-lf input, .nt-sel { min-height: 44px; font-size: 16px; }
  .nt-save { font-size: 11px; }
}
@media (max-width: 380px) { .nt-grid { grid-template-columns: 1fr; } }
/* Lliscar per arxivar (tàctil): el navegador només desplaça en vertical; l'horitzontal és nostre. */
@media (hover: none) { .nt-card { touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } .nt-card:hover { transform: none; box-shadow: none; } }
.nt-card.swiping { z-index: 2; box-shadow: 0 14px 34px -16px rgba(39,34,36,.55); cursor: grabbing; will-change: transform; }
/* Al mòbil, la llista de notes sense icones: només el contingut. Arxivar és lliscar; la resta, dins la nota. */
@media (max-width: 700px) {
  .nt-card .nt-acts, .nt-card .nt-pin, .nt-chip .ico, .nt-badge .ico, .nt-filter-views .ico { display: none; }
  .nt-card h3 { margin-right: 0; }
  .nt-badge { margin-top: 6px; }
}
@media (min-width: 701px) {
  .nt-ov { top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100dvh); }
  .nt-ed { min-height: min(480px, calc(var(--vvh, 100dvh) - 48px)); max-height: min(820px, calc(var(--vvh, 100dvh) - 48px)); }
}
@media (prefers-reduced-motion: reduce) { .nt-card, .nt-new, .nt-pop, .nt-ai { transition: none; animation: none; } .nt-rec-dot, .nt-spin, .nt-skel { animation: none; } }

/* ---------- Classe o reunió en directe (notes-live.js) */
.nt-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.nt-badge.nt-lvb { color: var(--fg); }
.nt-badge .lv-dot { width: 8px; height: 8px; }
.lv-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--red); flex: none; animation: nt-pulse 1.1s ease-in-out infinite; }
.lv-dot.off { background: var(--fg-muted); animation: none; }
.lv-start .seg button { height: 44px; }
.lv-start .seg .ico { width: 18px; height: 18px; }
.lv-warn { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--lemon, #f6e9a0) 45%, transparent); }

.lv { position: fixed; inset: 0; z-index: 72; display: flex; justify-content: center; background: var(--bg); overscroll-behavior: contain; }
.lv-in { display: flex; flex-direction: column; width: min(1100px, 100%); height: 100%; padding: calc(10px + var(--safe-t, 0px)) 20px calc(10px + var(--safe-b, 0px)); gap: 12px; min-height: 0; }
.lv-h { display: flex; align-items: center; gap: 8px; }
.lv-ttl { flex: 1; min-width: 0; }
.lv-ttl h2 { font-size: 20px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-ttl small { color: var(--fg-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.lv-rec { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--red) 9%, var(--white)); }
.lv-rec.lost { background: color-mix(in srgb, var(--lemon, #f6e9a0) 55%, var(--white)); }
.lv-time { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.lv-meter { width: 64px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--fg) 12%, transparent); overflow: hidden; }
.lv-meter i { display: block; height: 100%; background: var(--moss); transform-origin: left; transform: scaleX(0); transition: transform .12s linear; }
.lv-st { flex: 1 1 160px; min-width: 0; font-size: 13px; color: var(--fg-muted); }
.lv-rec .btn .ico { width: 15px; height: 15px; }
.lv-state { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; border-radius: 14px; background: var(--white); border: 1px solid var(--border); font-size: 14px; }
.lv-state span { flex: 1 1 180px; }
.lv-state[data-s="done"] { background: color-mix(in srgb, var(--moss) 10%, var(--white)); }
.lv-err { padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--red) 10%, var(--white)); color: var(--red); font-size: 14px; }
.lv-tabs { display: none; }
.lv-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; }
.lv-body > section { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px; border-radius: 16px; background: var(--white); border: 1px solid var(--border); }
.lv-tr { font-size: 15px; line-height: 1.65; }
@media (min-width: 761px) { .lv-body > section::before { content: attr(data-label); display: block; margin-bottom: 10px; font-size: 12px; font-weight: 600; color: var(--fg-muted); } }
.lv-tr p { margin: 0; }
.lv-ts { display: inline-block; margin: 0 6px 0 0; padding: 0 6px; border-radius: 6px; background: var(--bg-2); color: var(--fg-muted); font: 600 11px var(--mono); vertical-align: 1px; }
.lv-tr .lv-ts:not(:first-child) { margin-top: 10px; }
.lv-seg.wait { color: var(--fg-muted); }
.lv-seg.err { color: var(--red); font-size: 13px; }
.lv-empty { color: var(--fg-muted); font-size: 14px; }
.lv-notes h3 { margin: 16px 0 6px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.lv-notes h3:first-child { margin-top: 0; }
.lv-notes p { margin: 0 0 8px; line-height: 1.55; }
.lv-notes ul { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 4px; line-height: 1.5; }
.lv-notes ul.lv-check { list-style: none; padding-left: 0; }
.lv-notes ul.lv-check li::before { content: ''; display: inline-block; width: 13px; height: 13px; margin-right: 8px; border: 1.6px solid var(--fg-muted); border-radius: 4px; vertical-align: -2px; }
.lv-part + .lv-part { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.lv-part h4 { margin-bottom: 6px; font: 600 12px var(--mono); color: var(--fg-muted); }
.lv-busy { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--fg-muted); font-size: 14px; }
.lv-parts { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.lv-parts summary { cursor: pointer; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.lv-by { margin-top: 12px; }
.lv-pill { position: fixed; z-index: 66; left: 50%; bottom: calc(76px + var(--safe-b, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: 20px; background: var(--fg); color: var(--bg); font: inherit; font-size: 14px; box-shadow: 0 10px 30px -10px rgba(39,34,36,.6); cursor: pointer; }
.lv-pill b { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .lv-in { padding-left: 12px; padding-right: 12px; gap: 10px; }
  .lv-tabs { display: flex; }
  .lv-body { display: block; }
  .lv-body > section { height: 100%; }
  .lv-body[data-tab="notes"] .lv-tr, .lv-body[data-tab="tr"] .lv-notes { display: none; }
  .lv-time { font-size: 19px; }
  .nt-tools .btn span { white-space: nowrap; }
  .nt-tools .btn.nt-live-btn span { display: inline; }
  .nt-tools .btn.nt-live-btn { padding: 0 13px; }
}
@media (prefers-reduced-motion: reduce) { .lv-dot { animation: none; } .lv-meter i { transition: none; } }
