/* Notes and Documents tabs. Desktop layout lives inline in the components; this file holds the phone
   layout, where one panel shows at a time (list, then note or document, then details). */
.nt-mobile-only { display: none !important; }

@media (max-width: 767.98px) {
    .nt-mobile-only { display: inline-flex !important; }
    .nt-desktop-only { display: none !important; }

    /* Bottom padding clears the fixed bottom nav and its centre button. */
    .nt-route-body { padding: 12px 12px 110px !important; }
    .nt-route-height { height: auto !important; min-height: calc(100dvh - 200px); }

    /* Notes: one panel at a time */
    .nt-page { height: calc(100dvh - 200px); min-height: 420px !important; }
    .nt-page .nt-sidebar,
    .nt-page .nt-thread,
    .nt-page .nt-detail { display: none !important; width: 100% !important; min-width: 0 !important; border-left: none !important; border-right: none !important; }
    .nt-page .nt-detail-rail { display: none !important; }
    .nt-page.nt-pane-list .nt-sidebar,
    .nt-page.nt-pane-thread .nt-thread,
    .nt-page.nt-pane-details .nt-detail { display: flex !important; }

    /* Documents: list, then the open document scrolling as one column */
    .nd-page { height: calc(100dvh - 200px); min-height: 420px !important; }
    .nd-page .nd-list { width: 100% !important; border-right: none !important; }
    .nd-page .nd-detail { display: none !important; }
    .nd-page.nd-open .nd-list { display: none !important; }
    .nd-page.nd-open .nd-detail { display: flex !important; overflow-y: auto !important; }
    .nd-page .nd-header { flex-wrap: wrap; }
    .nd-page .nd-header h3 { white-space: normal !important; overflow-wrap: anywhere; }
    .nd-page .nd-body { flex: none !important; flex-direction: column; }
    .nd-page .nd-preview { flex: none !important; height: 55dvh; }
    .nd-page .nd-comments { width: 100% !important; border-left: none !important; border-top: 1px solid #E5E7EB; }

    /* Stop iOS zooming into fields, and make small buttons easy to tap */
    .nt-page input, .nt-page textarea, .nd-page input, .nd-page textarea, .nt-modal input, .nt-modal textarea { font-size: 16px !important; }
    .nt-tag-x { padding: 8px !important; margin: -6px -2px -6px 0; }
    .nt-tap { min-height: 44px; }
}
