/* Folinq mobile night parity v1.
   Loaded LAST in layout only for mobile widths. Dark is selected by the
   active viewport preference (folio-night-v1); light/mobile stays untouched.
   Only chrome/cards/controls change. Photos, book covers and PDF pages retain
   their source pixels and reader colors. */
@media screen and (max-width:768px){
  html body.folinq-r2013.folio-night-v1{
    --mn-surface:#16263b;--mn-raised:#20354d;--mn-deep:#101f32;
    --mn-border:#405a77;--mn-text:#edf5ff;--mn-muted:#bfd2e6;--mn-link:#9fd0ff;
    background:#0b1423!important;color:var(--mn-text)!important;color-scheme:dark;
  }

  /* Mobile navigation, profile drawer and basic dialogs. */
  html body.folinq-r2013.folio-night-v1 :is(.mobile-app-topbar,.mobile-app-topbar .mobile-bottom-nav,.mobile-bottom-nav,.mobile-profile-drawer-v1,.q-chat-dock-panel){
    background:#111e30!important;border-color:#334c67!important;color:#edf5ff!important;
  }
  html body.folinq-r2013.folio-night-v1 .mobile-app-topbar .mobile-bottom-nav a:not(.write-btn):not(.nav-write),
  html body.folinq-r2013.folio-night-v1 .mobile-profile-drawer-v1 a{
    background:transparent!important;color:#c7d9ef!important;border-color:#3b5571!important;
  }
  html body.folinq-r2013.folio-night-v1 .mobile-app-topbar .mobile-bottom-nav a:not(.write-btn):not(.nav-write):is(.active,:hover,:focus-visible),
  html body.folinq-r2013.folio-night-v1 .mobile-profile-drawer-v1 a:is(.active,:hover){
    background:#274869!important;color:#fff!important;
  }
  html body.folinq-r2013.folio-night-v1 .mobile-app-topbar .mobile-bottom-nav .nav-write,
  html body.folinq-r2013.folio-night-v1 .mobile-app-topbar .mobile-bottom-nav .write-btn{
    background:#0968cb!important;color:#fff!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.profile-info-box,.modal-content,.dialog-content,.feed-tabs-card,.feed-tabs,.profile-tabs-v175){
    background:#182a40!important;color:#eef6ff!important;border-color:#3d5775!important;
  }
  html body.folinq-r2013.folio-night-v1 .profile-info-box :is(h3,h4,.profile-info-section b){
    color:#eff7ff!important;
  }
  html body.folinq-r2013.folio-night-v1 .profile-info-box :is(.profile-info-close,.profile-icon-btn){
    background:#294561!important;border-color:#577694!important;color:#e4f2ff!important;
  }

  /* Folio feed, selection pills, reactions, compact cards and statistics. */
  html body.folinq-r2013.folio-night-v1 :is(.feed-tabs-card,.feed-tabs,.feed-view-tabs,.composer,.post.card,.profile-card,.post-head,.post-body,.comment-bubble,.book-grid){
    background:#16263b!important;color:#ebf4ff!important;border-color:#3b536e!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.feed-tab:not(.active),.activity-kind-tab-v162:not(.active),.profile-tabs-v175 a:not(.active),.feed-view-tabs a:not(.active)){
    background:#233b55!important;border-color:#486685!important;color:#d5eaff!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.feed-tab.active,.activity-kind-tab-v162.active,.profile-tabs-v175 a.active){
    background:#1e5688!important;color:#fff!important;border-color:#6cace7!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.post-title,.post-body,.post-body p,.post-head h4,.post-head h4 a,.profile-card h3){
    color:#f0f7ff!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.post .muted,.post-head .small,.post-stats,.comment-actions){
    color:#b9cde2!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.react-menu,.post-react-menu,.comment-react-menu,.reaction-pill,.comment-reaction-summary,.comment-reaction-types-v207>span){
    background:#203650!important;border-color:#4c6783!important;color:#dfedff!important;
  }
  html body.folinq-r2013.folio-night-v1 .react-menu button{
    background:#294866!important;border-color:#4b7095!important;color:#d8eaff!important;
  }
  html body.folinq-r2013.folio-night-v1 .profile-card .stat-row-link:is(:hover,:active,:focus-visible){
    background:#25415d!important;color:#eef7ff!important;
  }
  html body.folinq-r2013.folio-night-v1 .profile-card .stat-row-link:is(:hover,:active,:focus-visible) span{
    color:#e7f2ff!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.post .dropdown-menu,.folio-work-menu-floating-v1,.chat-room-menu-v183>div,.chat-thread-menu-v183>div,.q-chat-menu-pop){
    background:#1d3047!important;border-color:#4b6582!important;color:#eaf5ff!important;
  }
  html body.folinq-r2013.folio-night-v1 .folio-work-menu-floating-v1 :is(a,button,summary){
    color:#e7f3ff!important;
  }
  html body.folinq-r2013.folio-night-v1 .folio-work-menu-floating-v1 :is(a,button,summary):hover{
    background:#304f6e!important;color:#fff!important;
  }
  html body.folinq-r2013.folio-night-v1 .folio-work-menu-floating-v1>details>summary{
    color:#ffa5b1!important;
  }
  html body.folinq-r2013.folio-night-v1 .feed-side-ribbon-card .feed-side-ribbon-footer,
  html body.folinq-r2013.folio-night-v1 .feed-side-ribbon-card .feed-side-ribbon-footer::before,
  html body.folinq-r2013.folio-night-v1 .feed-side-ribbon-card .feed-side-ribbon-footer::after{
    background:transparent!important;background-image:none!important;box-shadow:none!important;
  }

  /* Personal profile, selected folios, books, approval and award widgets. */
  html body.folinq-r2013.folio-night-v1 :is(.profile-hero,.profile-hero .hero-body,.profile-about-card,.profile-edit-section-v193,.featured-strip,.profile-activity-pro-v162,[data-profile-endorsements-v204],.profile-awards-v111,.reader-library-panel,.favorite-profile-card){
    background:#17283e!important;color:#edf6ff!important;border-color:#3e5673!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.featured-mini,.favorite-mini-row,.profile-credit-name-list-v171 a,.profile-endorsement-wide-item-v204,.profile-award-card-v107){
    background:#223850!important;background-image:none!important;border-color:#496483!important;color:#edf5ff!important;box-shadow:none!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.featured-mini b,.favorite-mini-row b,.profile-endorsement-person-v204 b,.profile-award-body-v107 h3,.activity-card-body-v162 b){
    color:#f1f8ff!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.featured-mini small,.favorite-mini-row small,.profile-endorsement-wide-item-v204 p,.profile-award-body-v107 p,.activity-card-body-v162 p,.activity-card-body-v162 small){
    color:#c4d8eb!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 .profile-awards-v111 .profile-award-media-v107,
  html body.folinq-r2013.folio-night-v1 .profile-awards-v111 .profile-award-placeholder-v110{
    background:#1e354e!important;border-color:#405b7b!important;
  }
  html body.folinq-r2013.folio-night-v1 .profile-awards-v111 .profile-award-placeholder-v110 img{
    background:#1e354e!important;filter:invert(1) hue-rotate(180deg) saturate(1.15)!important;mix-blend-mode:screen!important;
  }
  html body.folinq-r2013.folio-night-v1 .profile-awards-v111 .profile-award-media-custom-v110 img{
    filter:none!important;mix-blend-mode:normal!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.profile-award-edit-dialog-v110,.profile-award-detail-dialog-v111,.profile-award-detail-shell-v111,.profile-awards-settings-panel-v107,.endorsement-detail-card-v206){
    background:#1a2c43!important;border-color:#466280!important;color:#edf5ff!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.profile-award-detail-content-v111 h2,.endorsement-detail-person-v206 b,.profile-awards-settings-title-v107 strong){
    color:#eff7ff!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.profile-award-detail-description-v111 p,.endorsement-detail-card-v206>p){
    background:#233a55!important;color:#d4e6f8!important;border-color:#4c6886!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.profile-endorsement-tab-buttons-v204 button,.profile-activity-settings-v163,.activity-option-grid-v159 label,.reader-book-tabs details){
    background:#213a54!important;color:#e2efff!important;border-color:#4a6887!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.activity-option-grid-v159 label,.reader-book-tabs summary){
    color:#e8f3ff!important;
  }
  html body.folinq-r2013.folio-night-v1 .profile-edit-v193 :is(.profile-edit-section-head-v193 h3,.profile-edit-section-head-v193 p,.field>label){
    color:#dceafa!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 .profile-edit-v193 .field :is(input,select,textarea){
    background:#102238!important;color:#edf6ff!important;border-color:#4a6989!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.book-grid .book-card,.book-card-shell .book-card,.network-v162-book-card,.feed-book-activity-content .book-card){
    background:#203650!important;color:#edf5ff!important;border-color:#476582!important;box-shadow:none!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.book-grid .book-info b,.feed-book-activity-content .book-info b,.network-v162-book-card b){
    color:#edf7ff!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.book-grid .book-info p,.book-grid .book-info small,.feed-book-activity-content .book-info p){
    color:#c6daeb!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 .profile-fa-zone .profile-headline-compact{
    color:#cbdff2!important;opacity:1!important;
  }

  /* My Network and mobile search/role filters. */
  html body.folinq-r2013.folio-night-v1 :is(.network-discovery-hero-v2211,.network-primary-tabs-v190,.network-discovery-filters-v2211,.network-v162-card.card,.network-view-switch-v219){
    background:#1b2d43!important;border-color:#3e5874!important;color:#ebf5ff!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.network-discovery-copy-v2211 h1,.network-primary-tab-v190 b,.network-person-body-v1 h3 a){
    color:#f0f7ff!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.network-discovery-copy-v2211 p,.network-primary-tab-v190 small,.network-person-tagline-v1,.network-person-location-v1){
    color:#c5d8eb!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 .network-people-role-tabs-v190 .network-v162-chip{
    background:#243c56!important;color:#e0efff!important;border-color:#4d7091!important;box-shadow:none!important;
  }
  html body.folinq-r2013.folio-night-v1 .network-people-role-tabs-v190 .network-v162-chip:is(.active,[aria-current=page]){
    background:#1c5b91!important;color:#fff!important;border-color:#70acf0!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.network-discovery-search-v2211,.network-role-picker-mobile-v2212 select,.network-discovery-filters-v2211 select){
    background:#13253b!important;border-color:#486a8b!important;color:#eaf5ff!important;
  }
  html body.folinq-r2013.folio-night-v1 .network-discovery-search-v2211 input{
    background:transparent!important;color:#eaf5ff!important;
  }
  html body.folinq-r2013.folio-night-v1 .network-discovery-search-v2211 input::placeholder{
    color:#adc2d8!important;
  }

  /* Shelf list/kanban and studio: preserve images and folder status colors. */
  html body.folinq-r2013.folio-night-v1 :is(.shelf-dashboard-v194 .shelf-unified-card-v194,.shelf-dashboard-v194 .shelf-work-card-pro,.shelf-dashboard-v194 .book-rack-pro,.shelf-dashboard-v194 .book-tile-pro,.shelf-kanban-toolbar-v1992,.shelf-kanban-column-v1992,.shelf-kanban-card-v1992,.studio-hero-modern,.studio-search){
    background:#1b3048!important;border-color:#425c7b!important;color:#e9f4ff!important;box-shadow:none!important;
  }
  html body.folinq-r2013.folio-night-v1 .shelf-kanban-column-v1992{
    border-top:4px solid var(--folder-color,#4a8ad5)!important;
  }
  html body.folinq-r2013.folio-night-v1 .shelf-kanban-column-head-v1992{
    background:#243c56!important;color:#f0f7ff!important;border-color:#4b6481!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.shelf-work-card-pro h3,.shelf-work-card-pro h3 a,.shelf-kanban-card-link-v1992 b,.studio-hero-modern h1,.studio-hero-modern h2){
    color:#f3f8ff!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.shelf-work-card-pro p,.shelf-kanban-card-link-v1992 p,.studio-hero-modern p){
    color:#c6daed!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.shelf-kanban-empty-v1992,.shelf-kanban-card-menu-v1992,.shelf-kanban-folder-menu-v1992>div,.shelf-reading-decision-v1 button){
    background:#263e58!important;border-color:#4a6989!important;color:#dcefff!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.shelf-kanban-filter-v1992 input,.shelf-kanban-filter-v1992 select,.shelf-status-form select){
    background:#112338!important;border-color:#4e6c8b!important;color:#eaf5ff!important;
  }

  /* Messaging, notification lists, administrative tables and audio player. */
  html body.folinq-r2013.folio-night-v1 :is(.chat-linkedin-v183,.chat-thread-list-v183,.chat-stream-v183,.chat-room-v183,.chat-compose-v183,.notification-item-v169,.admin-table){
    background:#16273c!important;color:#e9f4ff!important;border-color:#3d5672!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.chat-thread-item-v183,.chat-thread-item-v183.is-unread,.notification-item-v169.unread){
    background:#20364f!important;color:#ebf5ff!important;border-color:#466481!important;
  }
  html body.folinq-r2013.folio-night-v1 .chat-thread-item-v183.is-active{
    background:#254d75!important;color:#fff!important;border-color:#649bd4!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.chat-thread-name-v183 b,.notification-body-v169 b,.chat-message-author-v183 b){
    color:#f0f7ff!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.chat-thread-copy-v183 small,.notification-body-v169 small,.notification-body-v169 em,.chat-thread-meta-v183 time){
    color:#bdd1e6!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.chat-filter-pills-v183,.chat-message-bubble-v183,.chat-reactions-v183 span,.notification-more-v169,.notification-menu-panel-v169){
    background:#253d58!important;color:#e8f3ff!important;border-color:#4e6c8a!important;
  }
  html body.folinq-r2013.folio-night-v1 .chat-message-v183.mine .chat-message-bubble-v183{
    background:#1f4972!important;border-color:#467eaf!important;color:#f0f7ff!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.chat-compose-v183 textarea,.chat-global-search-v183 input,.chat-inline-search-v183 input){
    background:#102239!important;color:#eaf5ff!important;border-color:#4a6684!important;
  }
  html body.folinq-r2013.folio-night-v1 .admin-table th{
    background:#263e57!important;color:#edf5ff!important;border-color:#4b6580!important;
  }
  html body.folinq-r2013.folio-night-v1 .admin-table td{
    background:#17273b!important;color:#e7f2ff!important;border-color:#3c5470!important;
  }
  html body.folinq-r2013.folio-night-v1 .admin-table td a{color:#9fceff!important;}
  html body.folinq-r2013.folio-night-v1 .audio-player{
    background:#1a2d44!important;color:#eaf4ff!important;border-color:#46627f!important;
  }
  html body.folinq-r2013.folio-night-v1 .audio-player .folio-audio-controls-v1{
    color:#eaf4ff!important;
  }

  /* Terms, privacy, support, language and other input-driven panels. */
  html body.folinq-r2013.folio-night-v1 :is(.folinq-policy-hero,.folinq-policy-content,.folinq-policy-toc,.folinq-policy-cards>div,.support-card,.support-human-check-row-v186 span,.q-footer-language-switch){
    background:#1b2e45!important;background-image:none!important;
    color:#eaf4ff!important;border-color:#405d7b!important;box-shadow:none!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.folinq-policy-hero h1,.folinq-policy-section h2,.folinq-policy-section h3,.folinq-policy-toc strong,.folinq-policy-cards b,.support-card h1){
    color:#f2f8ff!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.folinq-policy-hero p,.folinq-policy-section p,.folinq-policy-section li,.folinq-policy-cards p,.folinq-policy-toc a,.support-human-check-v186 small){
    color:#c8dcee!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 :is(.support-human-check-row-v186 input,.support-shell .field input,.support-shell .field textarea){
    background:#102238!important;color:#edf6ff!important;border-color:#4b6d90!important;
  }
  html body.folinq-r2013.folio-night-v1 .q-footer-language-switch :is(span,a){
    color:#c8dfff!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 .q-footer-language-switch a.active{
    background:#21568c!important;color:#fff!important;
  }

  /* Mobile Folio composer had its own last-loaded layer; keep equivalent
     palette here for status/option popups without changing visibility. */
  html body.folinq-r2013.folio-night-v1 #postComposer form.folio-mobile-redesign-v1 :is(.folio-quick-v177-card,.folio-quick-v177-header,.folio-mobile-accordion-v1,.folio-tools-v177,.folio-quick-v174-footer){
    background:#172b41!important;border-color:#425d79!important;color:#eaf5ff!important;
  }
  html body.folinq-r2013.folio-night-v1 #postComposer form.folio-mobile-redesign-v1 :is(.folio-mobile-accordion-heading-v1 b,.folio-quick-v174-brand b){
    color:#f1f8ff!important;
  }
  html body.folinq-r2013.folio-night-v1 #postComposer form.folio-mobile-redesign-v1 :is(.folio-quick-v177-title,.folio-quick-v177-body,.folio-status-menu-v179,.folio-mobile-accordion-content-v1 input,.folio-mobile-accordion-content-v1 select){
    background:#102238!important;color:#edf6ff!important;border-color:#496683!important;
  }

  /* Preserve semantic states and document content.
     Never invert uploaded user images, book covers or the PDF canvas. */
  html body.folinq-r2013.folio-night-v1 :is(.book-cover img,.post-media img,.network-person-avatar-v1 img,.profile-award-media-custom-v110 img,.folio-inline-pdf-canvas-v9){
    filter:none!important;mix-blend-mode:normal!important;
  }
  html body.folinq-r2013.folio-night-v1 .folio-inline-pdf-canvas-v9{
    background:#fff!important;
  }

  /* Mobile Folio body: old hardcoded text colors can survive on children
     after the container is dark. Apply foreground to the actual user copy,
     including expanded/collapsed PDF Folios, but retain blue link styling. */
  html body.folinq-r2013.folio-night-v1 article[data-work-card] .post-body[data-user-content],
  html body.folinq-r2013.folio-night-v1 article[data-work-card] .post-body[data-user-content] > :is(.folio-full-r2013,.folio-preview-r2013,.feed-inline-content,.feed-inline-preview),
  html body.folinq-r2013.folio-night-v1 .work-full .post-body[data-user-content]{
    color:#e9f3ff!important;-webkit-text-fill-color:#e9f3ff!important;
    opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 article[data-work-card] .post-body[data-user-content] :is(.folio-full-r2013,.folio-preview-r2013,.feed-inline-content,.feed-inline-preview) :not(a):not(button),
  html body.folinq-r2013.folio-night-v1 .work-full .post-body[data-user-content] :not(a):not(button){
    color:inherit!important;-webkit-text-fill-color:inherit!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 article[data-work-card] .post-body[data-user-content] :is(a,.folio-more-r2013,.inline-more,.feed-inline-more){
    color:#8fc9ff!important;-webkit-text-fill-color:#8fc9ff!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 article[data-work-card] .post-body[data-user-content] :is(.folio-full-r2013,.folio-preview-r2013) {
    background:transparent!important;
  }

  /* Reader controls keep readable contrast in night mode; PDF paper stays
     its original white rather than being inverted. */
  html body.folinq-r2013.folio-night-v1 .pdf-book-viewer .pdf-book-head,
  html body.folinq-r2013.folio-night-v1 .pdf-book-viewer .pdf-book-foot {
    background:#182c43!important;color:#eaf5ff!important;
    border-color:#3e5977!important;
  }
  html body.folinq-r2013.folio-night-v1 .pdf-book-viewer .pdf-book-head :is(b,small),
  html body.folinq-r2013.folio-night-v1 .pdf-book-viewer .pdf-page-label {
    color:#e4f1ff!important;opacity:1!important;
  }
  html body.folinq-r2013.folio-night-v1 .pdf-book-viewer .folio-pdf-head-actions-v193 :is(button,a) {
    background:#274561!important;color:#cce8ff!important;border-color:#557595!important;
  }
  html body.folinq-r2013.folio-night-v1 .pdf-book-viewer .pdf-page-shell canvas {
    background:#fff!important;filter:none!important;mix-blend-mode:normal!important;
  }
}
