/* ==========================================================================================================
   NOTES-RD-1669 (lane/1669-rd-notesui, owner 2026-11-09): the new-look NOTES pages (js/modules/notes-redesign.js) --
   the notes list (rows + a detail panel on desktop, rows + a bottom sheet on phone / tablet), Note details and the
   TABBED editor. Namespaced .nx-*; uses the ChiroApp "cx" tokens from css/index.css.
   Nothing here applies unless the module draws its markup or sets body.nx-on (new look on). --nx-ready tells the module
   this stylesheet is loaded (a missing / stale one keeps classic).
   EDITOR: the classic form is styled from the outside only. Never a display / visibility / disabled rule on a form control,
   a tab panel or anything the classic code shows / hides (tab panels keep the classic .tab-content / .active rule).
   No pills / chips (status and counts are plain coloured words), no emoji.
   ========================================================================================================== */
:root {
    --nx-ready: 1;
    --nx-head: 'Poppins', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --nx-hero: #2f5a37;
    --nx-hero-2: #3a6b43;
    --nx-soft: #eaf2ec;
    --nx-line: var(--cx-border, #dfe5e1);
    --nx-row-bg: var(--cx-surface, #fff);
    --nx-signed: #15803d;
    --nx-draft: #b45309;
    --nx-amended: #a16207;
    --nx-danger: #b91c1c;
}
[data-theme="dark"] { --nx-soft: #1b2a1e; --nx-hero: #23402a; --nx-hero-2: #2b4f33; --nx-signed: #86efac; --nx-draft: #fcd34d; --nx-amended: #fde68a; --nx-danger: #fca5a5; }

#page-notes > .nx-classic-hidden { display: none !important; }

.nx { color: var(--cx-text); display: flex; flex-direction: column; gap: 14px; min-width: 0; padding-bottom: 24px; }
.nx *, .nx-sheet * { box-sizing: border-box; }

/* header */
.nx-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.nx-head-text { min-width: 0; }
.nx-title { margin: 0; font-family: var(--nx-head); font-size: 2.1rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; color: var(--primary-text, var(--cx-text)); }   /* BRAND-1677 */
.nx-subtitle { margin: 4px 0 0; color: var(--cx-text-2); font-size: 0.95rem; }
.nx-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 6px 4px; margin: 0 0 -4px -4px;
    color: var(--cx-brand-ink); font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; min-height: 40px; }
.nx-back:hover { text-decoration: underline; }

/* buttons */
.nx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px;
    border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; text-decoration: none; color: inherit;
    background: var(--cx-surface); transition: background 120ms ease, box-shadow 120ms ease, transform 120ms ease; white-space: nowrap; }
.nx-btn:active { transform: translateY(1px); }
.nx-btn i { font-size: 1.15em; }
.nx-btn--primary { background: var(--nx-hero); color: #fff; box-shadow: 0 4px 12px rgba(47, 90, 55, 0.28); }
.nx-btn--primary:hover { background: var(--nx-hero-2); }
.nx-btn--secondary { border-color: var(--nx-line); background: var(--cx-surface); color: var(--cx-text); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05); }
.nx-btn--secondary:hover { border-color: var(--cx-brand); }
.nx-btn--quiet { background: transparent; color: var(--cx-text); justify-content: flex-start; border-radius: 10px; padding: 0 10px; }
.nx-btn--quiet i { color: var(--cx-brand-ink); }
.nx-btn--quiet:hover { background: var(--nx-soft); }
.nx-btn--danger { background: transparent; color: var(--nx-danger); justify-content: flex-start; padding: 0 10px; }
.nx-btn--danger:hover { background: color-mix(in srgb, var(--nx-danger) 8%, transparent); }
.nx-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 0;
    background: transparent; color: var(--cx-text-2); cursor: pointer; font-size: 1.15rem; flex: 0 0 auto; }
.nx-icon-btn:hover { background: var(--nx-soft); color: var(--cx-text); }
.nx-btn:focus-visible, .nx-icon-btn:focus-visible, .nx-row:focus-visible, .nx-tab:focus-visible, .nx-seg-btn:focus-visible, .nx-back:focus-visible,
.nx-detail a:focus-visible { outline: 3px solid var(--cx-focus); outline-offset: 2px; }

/* tools */
.nx-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.nx-search, .nx-select { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 6px 0 14px; border-radius: 12px; border: 1px solid var(--nx-line);
    background: var(--cx-surface); color: var(--cx-text-2); min-width: 0; }
.nx-search { flex: 1 1 280px; }
.nx-select { flex: 0 1 320px; padding-right: 10px; }
.nx-select > span { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.nx-search input, .nx-select select { border: 0; background: transparent; font: inherit; font-size: 0.95rem; color: var(--cx-text); outline: none; min-width: 0; padding: 0; height: 44px; box-shadow: none; }
.nx-search input { flex: 1 1 auto; width: 100%; }
.nx-search input::-webkit-search-cancel-button { display: none; }
.nx-select select { flex: 1 1 auto; width: 100%; cursor: pointer; }
.nx-search:focus-within, .nx-select:focus-within { border-color: var(--cx-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cx-focus) 25%, transparent); }

/* tabs (underlined words) */
.nx-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--nx-line); overflow-x: auto; scrollbar-width: none; }
.nx-tabs::-webkit-scrollbar { display: none; }
.nx-tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 0 9px; margin-bottom: -1px; font: inherit; font-weight: 600; font-size: 0.95rem;
    color: var(--cx-text-2); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 8px; align-items: baseline; border-radius: 0; }
.nx-tab[aria-selected="true"] { color: var(--cx-brand-ink); border-bottom-color: var(--cx-brand); }
.nx-tab-n { font-weight: 700; color: var(--cx-text-2); }
.nx-tab[data-filter="unsigned"] .nx-tab-n { color: var(--nx-draft); }

/* layout */
.nx-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.nx-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 1200px) {
    .nx-body.has-panel { grid-template-columns: minmax(0, 1fr) minmax(340px, 390px); }
    .nx-panel { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; border-radius: 18px; }
}
.nx-empty { margin: 0; padding: 32px 12px; text-align: center; color: var(--cx-text-2); background: var(--cx-surface); border: 1px dashed var(--nx-line); border-radius: 16px; }
.nx-more { align-self: center; }

/* day groups + rows */
.nx-day { display: flex; flex-direction: column; gap: 8px; }
.nx-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0; padding: 2px 2px 0; font-family: var(--nx-head);
    font-size: 1.1rem; font-weight: 700; color: var(--cx-text); }
.nx-day-n { font-family: inherit; font-size: 0.85rem; font-weight: 500; color: var(--cx-text-2); }
.nx-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.nx-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto 18px; align-items: center; gap: 14px; width: 100%; text-align: left;
    padding: 12px 14px; border-radius: 14px; border: 1px solid var(--nx-line); background: var(--nx-row-bg); color: var(--cx-text); font: inherit; cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); transition: box-shadow 120ms ease, border-color 120ms ease; line-height: 1.35; }
.nx-row:hover { box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08); border-color: color-mix(in srgb, var(--cx-brand) 40%, var(--nx-line)); }
.nx-row.is-selected { border-color: var(--cx-brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--cx-brand) 35%, transparent); background: color-mix(in srgb, var(--nx-soft) 55%, var(--nx-row-bg)); }
.nx-avatar { width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem;
    background: var(--cx-surface); border: 1px solid var(--nx-line); color: var(--cx-text); flex: 0 0 auto; }
.nx-avatar svg { width: 1em; height: 1em; }
.nx-avatar--lg { width: 52px; height: 52px; font-size: 1.7rem; border-radius: 14px; }
.nx-avatar--sm { width: 30px; height: 30px; font-size: 1.05rem; border-radius: 8px; }
.nx-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nx-who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nx-name { font-weight: 700; font-size: 1.02rem; }
.nx-species { color: var(--cx-text-2); font-weight: 500; }
.nx-l2 { color: var(--cx-text-2); font-size: 0.9rem; }
.nx-l3 { color: var(--cx-text-2); font-size: 0.86rem; opacity: 0.9; }
.nx-chev { color: var(--cx-text-2); opacity: 0.6; }
/* status: plain coloured words, never a pill */
.nx-state { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; background: none; border: 0; padding: 0; border-radius: 0; }
.nx-state--signed { color: var(--nx-signed); }
.nx-state--amended { color: var(--nx-amended); }
.nx-state--draft { color: var(--nx-draft); }
@media (max-width: 640px) {
    .nx-title { font-size: 1.8rem; }
    .nx-row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
    .nx-row > .nx-chev { display: none; }
    .nx-avatar { width: 40px; height: 40px; font-size: 1.3rem; }
    .nx-row > .nx-state { align-self: start; padding-top: 3px; }
    .nx-select { flex: 1 1 100%; }
    .nx-new { width: 100%; }
}

/* detail (panel / sheet) */
.nx-detail { background: var(--cx-surface); border: 1px solid var(--nx-line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 22px rgba(15, 23, 42, 0.06); }
.nx-detail-head { display: flex; align-items: center; gap: 12px; }
.nx-detail-who { min-width: 0; flex: 1 1 auto; }
.nx-detail-name { margin: 0; font-family: var(--nx-head); font-size: 1.3rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.nx-detail-name a, .nx-detail-sub a { color: inherit; text-decoration: none; }
.nx-detail-name a:hover, .nx-detail-sub a:hover { text-decoration: underline; color: var(--cx-brand-ink); }
.nx-detail-sub { color: var(--cx-text-2); font-size: 0.92rem; margin-top: 2px; }
.nx-detail-who .nx-state { display: inline-block; margin-top: 4px; }
.nx-detail-head > .nx-icon-btn { align-self: flex-start; }
.nx-facts { margin: 0; display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--nx-line); }
.nx-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--nx-line); }
.nx-facts dt { color: var(--cx-text-2); font-size: 0.88rem; margin: 0; }
.nx-facts dd { margin: 0; font-weight: 600; font-size: 0.92rem; text-align: right; overflow-wrap: anywhere; }
.nx-summary { background: var(--nx-soft); border-radius: 12px; padding: 12px 14px; }
.nx-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cx-brand-ink); margin-bottom: 4px; }
.nx-summary p { margin: 0; font-size: 0.93rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.nx-sig { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--nx-line); border-left: 4px solid var(--nx-signed); }
.nx-sig.is-amended { border-left-color: var(--nx-amended); }
.nx-sig img { max-height: 40px; max-width: 180px; background: #fff; border-radius: 6px; }
.nx-sig-file { font-size: 0.82rem; font-style: italic; color: var(--cx-text-2); }
.nx-sig-text { font-size: 0.82rem; color: var(--cx-text-2); }
.nx-sig-by { font-weight: 600; color: var(--cx-text); }
.nx-sig-orig { color: var(--nx-amended); }
.nx-actions { display: flex; flex-direction: column; gap: 10px; }
.nx-actions-main { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.nx-detail .nx-actions-main > .nx-btn--primary { grid-column: 1 / -1; }
.nx-actions-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 2px 8px; border-top: 1px solid var(--nx-line); padding-top: 8px; }
.nx-actions-danger { border-top: 1px solid var(--nx-line); padding-top: 8px; }

/* sheet (phone / tablet) */
.nx-sheet-overlay { position: fixed; inset: 0; z-index: 10050; background: rgba(15, 23, 42, 0.45); display: none; align-items: flex-end; justify-content: center; }
.nx-sheet-overlay.is-open { display: flex; }
.nx-sheet { width: 100%; max-width: 640px; max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--cx-surface);
    border-radius: 22px 22px 0 0; position: relative; animation: nx-up 200ms ease-out; padding: 10px 0 env(safe-area-inset-bottom, 0); }
.nx-sheet .nx-detail { border: 0; border-radius: 0; box-shadow: none; }
.nx-grip { display: block; width: 44px; height: 5px; margin: 0 auto; border-radius: 3px; background: var(--nx-line); }
@keyframes nx-up { from { transform: translateY(24px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nx-sheet { animation: none; } }
body.nx-sheet-open { overflow: hidden; }

/* ── Note details ── */
.nx-view { gap: 16px; }
.nx-view-head { display: flex; flex-direction: column; gap: 4px; }
.nx-view-titlebar { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.nx-view-titlebar .nx-state { font-size: 0.95rem; }
.nx-view-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.nx-view-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.nx-view-rail { display: flex; flex-direction: column; gap: 12px; min-width: 0; order: -1; }
.nx-rail-card { background: var(--cx-surface); border: 1px solid var(--nx-line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.nx-view .nx-actions-main { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.nx-view .nx-actions-main > .nx-btn--primary { grid-column: 1 / -1; }
.nx-share-slot:empty { display: none; }
.nx-share-slot .vetsend-status-row { margin: 0 !important; }
@media (min-width: 1200px) {
    .nx-view-grid { grid-template-columns: minmax(0, 1fr) 320px; }
    .nx-view-rail { order: 0; position: sticky; top: 12px; }
    .nx-view .nx-actions-main { grid-template-columns: 1fr 1fr; }
    .nx-view .nx-actions-more { grid-template-columns: 1fr; }
}
.nx-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: color-mix(in srgb, var(--cx-text-2) 10%, transparent); align-self: flex-start; max-width: 100%; }
.nx-seg-btn { min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent; color: var(--cx-text-2); font: inherit; font-weight: 600;
    font-size: 0.95rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nx-seg-btn[aria-selected="true"] { background: var(--cx-surface); color: var(--cx-brand-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
/* the classic body, as a calm document */
.nx-view .nx-doc { background: var(--cx-surface); backdrop-filter: none; -webkit-backdrop-filter: none; border: 1px solid var(--nx-line); border-radius: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.06); padding: 28px 32px !important; margin: 0; }
.nx-view .nx-doc > div { max-width: 820px !important; }
.nx-view .nx-doc h3 { font-family: var(--nx-head); }
.nx-view .nx-doc h4 { font-family: var(--nx-head); letter-spacing: 0.01em; }
.nx-view .nx-doc .entity-avatar { border-radius: 14px; }
@media (max-width: 640px) {
    .nx-view .nx-doc { padding: 18px 16px !important; border-radius: 16px; }
    .nx-seg { align-self: stretch; }
    .nx-seg-btn { flex: 1 1 0; justify-content: center; padding: 0 8px; }
}

/* ── Editor: the classic page header + form, restyled from the outside ── */
body.nx-on #page-notes > .page-header:not(.nx-classic-hidden) { margin-bottom: 14px; gap: 6px; flex-direction: column; align-items: stretch; }
body.nx-on #page-notes > .page-header:not(.nx-classic-hidden) > div:first-child { flex-wrap: wrap; }
body.nx-on #page-notes > .page-header:not(.nx-classic-hidden) .btn-outline[onclick*="closeNoteInline"] {
    order: -1; background: none; border: 0; box-shadow: none; padding: 6px 4px; margin-left: -4px; min-height: 40px; color: var(--cx-brand-ink); font-weight: 600; font-size: 0.95rem; }
body.nx-on #page-notes > .page-header:not(.nx-classic-hidden) .btn-outline[onclick*="closeNoteInline"]:hover { text-decoration: underline; }
body.nx-on #page-notes > .page-header:not(.nx-classic-hidden) h1 { font-family: var(--nx-head); font-size: 2rem; letter-spacing: -0.03em; line-height: 1.1; flex-basis: 100%; }
.nx-edit-meta { margin: 0; display: flex; align-items: center; gap: 10px; color: var(--cx-text-2); font-size: 0.98rem; min-width: 0; }
.nx-edit-meta-text { min-width: 0; overflow-wrap: anywhere; }
.nx-edit-meta strong { color: var(--cx-text); }
.nx-edit-meta .nx-avatar { color: var(--cx-text); }

body.nx-on #note-form-container { background: var(--cx-surface); backdrop-filter: none; -webkit-backdrop-filter: none; border: 1px solid var(--nx-line); border-radius: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.06); padding: 22px 24px !important; }
/* tabs: one scrolling row of underlined words, kept in view while the panel scrolls (classic order, never flattened) */
body.nx-on #note-form-container .modal-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 22px; border-bottom: 1px solid var(--nx-line); margin: 0 -24px 20px; padding: 0 24px;
    position: sticky; top: 0; z-index: 6; background: var(--cx-surface); scroll-padding: 0 24px; scrollbar-width: none; }
/* NOTETABSPDF-1683: the strip only scrolls sideways -- no vertical or free drag (touch-action pan-x pan-y: the finger can start on a
   tab and still scroll the page up/down, but the strip itself never moves vertically), no rubber-band hand-off sideways, and no text
   selection / long-press callout / native drag on the tab labels (taps still select a tab). */
body.nx-on #note-form-container .modal-tabs { overflow-y: hidden; overscroll-behavior-x: contain; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
body.nx-on #note-form-container .modal-tabs, body.nx-on #note-form-container .modal-tabs .modal-tab {
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; -webkit-tap-highlight-color: transparent; }
@media (max-width: 1024px) {
    /* the strip scrolls sideways: a strong fade on the side(s) with more tabs (data-nx-scroll from the module) */
    body.nx-on #note-form-container .modal-tabs { top: calc(52px + env(safe-area-inset-top, 0px)); }
    body.nx-on #note-form-container .modal-tabs[data-nx-scroll="start"] {
        -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 72px), transparent 100%); mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 72px), transparent 100%); }
    body.nx-on #note-form-container .modal-tabs[data-nx-scroll="middle"] {
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 56px, #000 calc(100% - 72px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 56px, #000 calc(100% - 72px), transparent 100%); }
    body.nx-on #note-form-container .modal-tabs[data-nx-scroll="end"] {
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 56px, #000 100%); mask-image: linear-gradient(90deg, transparent 0, #000 56px, #000 100%); }
    body.nx-on #note-form-container .modal-tabs > .modal-tab:last-child { margin-right: 24px; }
}
@media (min-width: 1025px) {
    body.nx-on #note-form-container .modal-tabs { flex-wrap: wrap; row-gap: 0; overflow: visible; }
}
body.nx-on #note-form-container .modal-tab { flex: 0 0 auto; background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; box-shadow: none;
    padding: 14px 0 11px; margin-bottom: -1px; color: var(--cx-text-2); font-weight: 600; font-size: 0.95rem; }
body.nx-on #note-form-container .modal-tab:hover { background: none; color: var(--cx-text); border-color: transparent; border-bottom-color: var(--nx-line); }
body.nx-on #note-form-container .modal-tab.active { background: none; color: var(--cx-brand-ink); border-bottom-color: var(--cx-brand); box-shadow: none; }
body.nx-on #note-form-container .modal-tab:focus-visible { outline: 3px solid var(--cx-focus); outline-offset: -3px; }
/* Echo: a calm card (all classic controls and the held-recording banner inside, untouched) */
body.nx-on #note-form-container #aiScribeContainer { background: color-mix(in srgb, var(--nx-soft) 70%, var(--cx-surface)) !important; border: 1px solid var(--nx-line) !important;
    border-radius: 16px !important; box-shadow: none !important; }
body.nx-on #note-form-container #aiScribeContainer .btn { border-radius: 12px !important; box-shadow: none !important; min-height: 42px; }
body.nx-on #note-form-container #aiScribeContainer #scribeRecordBtn.btn-primary { background: var(--nx-hero); border-color: var(--nx-hero); color: #fff; }
/* fields */
body.nx-on #note-form-container .form-group label, body.nx-on #note-form-container .form-label { font-weight: 600; color: var(--cx-text); }
body.nx-on #note-form-container input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]),
body.nx-on #note-form-container select, body.nx-on #note-form-container textarea {
    border-radius: 12px; border: 1px solid var(--nx-line); background-color: var(--cx-surface); color: var(--cx-text); min-height: 44px; }
body.nx-on #note-form-container textarea { min-height: 96px; line-height: 1.5; }
body.nx-on #note-form-container input:focus, body.nx-on #note-form-container select:focus, body.nx-on #note-form-container textarea:focus {
    border-color: var(--cx-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cx-focus) 22%, transparent); outline: none; }
body.nx-on #note-form-container .tab-nav-bar { border-top: 1px solid var(--nx-line); }
body.nx-on #note-form-container .tab-nav-btn { border-radius: 12px; min-height: 40px; border-color: var(--nx-line); color: var(--cx-text); }
body.nx-on #note-form-container .tab-nav-btn:hover { border-color: var(--cx-brand); color: var(--cx-brand-ink); }
/* actions */
body.nx-on #note-form-container .note-form-actions { border-top: 1px solid var(--nx-line); }
body.nx-on #note-form-container .note-form-action-btn { border-radius: 14px; }
body.nx-on #note-form-container .note-form-action-primary:not([disabled]) { background: var(--nx-hero); box-shadow: 0 4px 12px rgba(47, 90, 55, 0.28); color: #fff; }
body.nx-on #note-form-container .note-form-action-primary:not([disabled]):hover { background: var(--nx-hero-2); }
body.nx-on #note-form-container #signAndSaveBtn:not(.note-form-action-primary) { background: var(--cx-surface); color: var(--nx-hero); border: 1.5px solid var(--nx-hero); box-shadow: none; }
body.nx-on #note-form-container .note-form-action-draft { color: var(--cx-brand-ink); border-color: var(--cx-brand); }
body.nx-on #note-form-container .note-form-action-draft:hover { background: var(--nx-soft); }

@media (max-width: 640px) {
    body.nx-on #note-form-container { padding: 14px 14px !important; border-radius: 16px; }
    body.nx-on #note-form-container .modal-tabs { margin: 0 -14px 16px; padding: 0 14px; gap: 18px; scroll-padding: 0 14px; }
    body.nx-on #page-notes > .page-header:not(.nx-classic-hidden) h1 { font-size: 1.7rem; }
}
/* desktop: the form's actions become a sticky right rail beside the tabs (same buttons, same order, still inside the form) */
@media (min-width: 1200px) {
    body.nx-on #note-form-container #noteForm { display: grid; grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: repeat(10, auto) 1fr;
        column-gap: 28px; row-gap: 0; align-items: start; }
    body.nx-on #note-form-container #noteForm > * { grid-column: 1; min-width: 0; }
    body.nx-on #note-form-container #noteForm > .note-form-actions { grid-column: 2; grid-row: 1 / -1; position: sticky; top: 64px; align-self: start;
        margin-top: 0; padding: 16px; border: 1px solid var(--nx-line); border-radius: 16px; background: var(--cx-surface-2, #f8faf9); }
    body.nx-on #note-form-container .modal-tabs { margin-right: 0; padding-right: 0; }
}
@media (max-width: 480px) {
    body.nx-on #note-form-container .note-form-actions { margin-left: -14px; margin-right: -14px; padding: 12px 14px; background: var(--cx-surface); }
}

/* ── sign readiness (owner 2026-11-09): from the classic sign-time required-field rules; display only ── */
#nxSignBar { width: 100%; }
.nx-signbar { margin-top: 6px; padding: 12px 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--nx-draft) 35%, var(--nx-line));
    background: color-mix(in srgb, var(--nx-draft) 7%, var(--cx-surface)); display: flex; flex-direction: column; gap: 8px; }
.nx-signbar.is-ready { border-color: color-mix(in srgb, var(--nx-signed) 35%, var(--nx-line)); background: color-mix(in srgb, var(--nx-signed) 7%, var(--cx-surface)); }
.nx-signbar-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; color: var(--cx-text); }
.nx-signbar-head i { font-size: 1.15rem; align-self: center; color: var(--nx-draft); }
.nx-signbar.is-ready .nx-signbar-head i { color: var(--nx-signed); }
.nx-signbar-sub { color: var(--cx-text-2); font-size: 0.9rem; }
.nx-meter { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--cx-text-2) 15%, transparent); overflow: hidden; }
.nx-meter > span { display: block; height: 100%; background: var(--nx-draft); border-radius: 3px; }
.nx-signbar.is-ready .nx-meter > span { background: var(--nx-signed); }
.nx-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nx-step { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 0; background: transparent;
    color: var(--cx-text); font: inherit; font-size: 0.92rem; text-align: left; cursor: pointer; }
.nx-step:hover { background: color-mix(in srgb, var(--nx-draft) 10%, transparent); }
.nx-step:focus-visible { outline: 3px solid var(--cx-focus); outline-offset: 1px; }
.nx-step-tab { font-weight: 700; color: var(--nx-draft); white-space: nowrap; }
.nx-step-field { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-step i { color: var(--cx-text-2); }
/* tab marks: a drawn check (required fields complete) or an amber mark (required left), after the classic tab word */
body.nx-on #note-form-container .modal-tab[data-nx-step] { display: inline-flex; align-items: center; gap: 7px; }
body.nx-on #note-form-container .modal-tab[data-nx-step="done"]::after { content: ''; width: 5px; height: 10px; border: solid var(--nx-signed); border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-2px); flex: 0 0 auto; }
body.nx-on #note-form-container .modal-tab[data-nx-step="todo"]::after { content: '!'; width: 16px; height: 16px; line-height: 16px; text-align: center; font-size: 0.7rem; font-weight: 800;
    color: #fff; background: var(--nx-draft); border-radius: 50%; flex: 0 0 auto; }

/* IOS-16PX (lane/1674-rd-int; owner rule for the redesign: iOS inputs are at least 16px). iOS Safari zooms the whole page when
   a field under 16px gets focus; on phones / tablets / touch screens every field of this page and its sheet is 16px.
   Measured by tests/journeys/redesign1674_fit_browser.cjs F2 at 360 / 390. */
@media (max-width: 1024px), (pointer: coarse) {
    #nxRoot input, #nxRoot select, #nxRoot textarea, #nxSheet input, #nxSheet select, #nxSheet textarea { font-size: 16px; }
}
