/* Fieldline 1.5.7 reader bridge for the nekud.click redesign (mu-plugins of 18 Oct 2026).
   1. Colour themes now reach the redesign's masthead, footer, search and buttons (their
      --fl-paper / --fl-paper-deep / --fl-ink-muted / --fl-accent-deep tokens follow the palette).
   2. Footer background = the chosen colour theme's own accent colour (as huaxia.click), with
      text chosen per theme for WCAG AA (lowest pair 4.53:1). Default keeps nekud's navy footer
      (its muted text now passes AA, it was 2.6:1); dark mode has its own dark footer.
   3. The font menu works again: the "Dubai everywhere" rule (!important) is overridden only
      when a reader picks another font. Dubai stays the default.
   4. Text size scales the redesign's px-locked text too (body, articles, cards, headings). */

/* 1. palette -> redesign tokens (light mode only, like every colour theme) */
html[data-palette]:not([data-palette=""]):not([data-palette="default"]):not([data-theme="dark"]){--fl-paper:var(--fl-bg);--fl-paper-deep:var(--fl-band);--fl-ink-muted:var(--fl-muted);--fl-accent-deep:var(--fl-accent-hover);--fl-iris:var(--fl-second-text)}
html[data-palette]:not([data-palette=""]):not([data-palette="default"]):not([data-theme="dark"]) .fl-masthead{background:var(--fl-bg)}

/* 2. footer follows the colour theme */
html body .fl-footer{background:var(--flf-bg)!important;color:var(--flf-fg);border-top-color:var(--flf-rule);transition:background-color .3s ease,color .3s ease}
html body .fl-footer :is(h4,p,.fl-footer-bottom,.fl-footer-bottom span){color:var(--flf-muted)!important}
html body .fl-footer :is(a,.fl-footer-brand h4,em){color:var(--flf-fg)!important}
html body .fl-footer a:is(:hover,:focus-visible){color:var(--flf-fg)!important;text-decoration:underline;text-underline-offset:3px}
html body .fl-footer :focus-visible{outline:2px solid var(--flf-fg);outline-offset:2px}
html body .fl-footer-bottom{border-top-color:var(--flf-rule)!important}
@media (prefers-reduced-motion:reduce){html body .fl-footer{transition:none}}

html{--flf-bg:#0F2236;--flf-fg:#FBFAF5;--flf-muted:#C7CACB;--flf-rule:#435260}
html[data-palette="porcelain"]:not([data-theme="dark"]){--flf-bg:#1E4C9E;--flf-fg:#FBFCFE;--flf-muted:#CAD5E9;--flf-rule:#4F73B3}
html[data-palette="azure"]:not([data-theme="dark"]){--flf-bg:#173A73;--flf-fg:#EEF5FB;--flf-muted:#BFCCDD;--flf-rule:#466391}
html[data-palette="celadon"]:not([data-theme="dark"]){--flf-bg:#2F5F6B;--flf-fg:#EDF2ED;--flf-muted:#C3D2D0;--flf-rule:#597F88}
html[data-palette="jade"]:not([data-theme="dark"]){--flf-bg:#0E6A4C;--flf-fg:#E8F4EC;--flf-muted:#E8F4EC;--flf-rule:#3E886F}
html[data-palette="bamboo"]:not([data-theme="dark"]){--flf-bg:#4D6B18;--flf-fg:#F2F1DE;--flf-muted:#F2F1DE;--flf-rule:#718844}
html[data-palette="inkwash"]:not([data-theme="dark"]){--flf-bg:#262626;--flf-fg:#F3F3F1;--flf-muted:#C6C6C4;--flf-rule:#535353}
html[data-palette="imperial"]:not([data-theme="dark"]){--flf-bg:#8B2412;--flf-fg:#FBF4D9;--flf-muted:#E2C6AD;--flf-rule:#A4523E}
html[data-palette="lantern"]:not([data-theme="dark"]){--flf-bg:#B1261B;--flf-fg:#FDF6E7;--flf-muted:#FDF6E7;--flf-rule:#C25448}
html[data-palette="cinnabar"]:not([data-theme="dark"]){--flf-bg:#A3221A;--flf-fg:#FBF6EC;--flf-muted:#E8C7BE;--flf-rule:#B65148}
html[data-palette="silkroad"]:not([data-theme="dark"]){--flf-bg:#A2461F;--flf-fg:#F7ECDC;--flf-muted:#F7ECDC;--flf-rule:#B56B49}
html[data-palette="teahouse"]:not([data-theme="dark"]){--flf-bg:#7A4527;--flf-fg:#F4EBE0;--flf-muted:#D9C6B7;--flf-rule:#956A50}
html[data-palette="lotus"]:not([data-theme="dark"]){--flf-bg:#2F6B4A;--flf-fg:#FCF1F3;--flf-muted:#FCF1F3;--flf-rule:#5C886F}
html[data-palette="plum"]:not([data-theme="dark"]){--flf-bg:#7A2B5B;--flf-fg:#FBF3F5;--flf-muted:#DFC7D3;--flf-rule:#96577D}
html[data-palette="egret"]:not([data-theme="dark"]){--flf-bg:#3D5A73;--flf-fg:#F7F8F8;--flf-muted:#CED5DB;--flf-rule:#667D90}
html[data-palette="kingfisher"]:not([data-theme="dark"]){--flf-bg:#0F6B6E;--flf-fg:#ECF7F5;--flf-muted:#ECF7F5;--flf-rule:#408A8C}
html[data-palette="persimmon"]:not([data-theme="dark"]){--flf-bg:#C1502E;--flf-fg:#FFFFFF;--flf-muted:#FFFFFF;--flf-rule:#CF765C}
html[data-palette="bronze"]:not([data-theme="dark"]){--flf-bg:#8A6D2F;--flf-fg:#FFFFFF;--flf-muted:#FFFFFF;--flf-rule:#A48D5D}
html[data-palette="moonwhite"]:not([data-theme="dark"]){--flf-bg:#28324A;--flf-fg:#F5F7FA;--flf-muted:#C8CCD3;--flf-rule:#555D71}
html[data-palette="peony"]:not([data-theme="dark"]){--flf-bg:#B02A4E;--flf-fg:#FDF0F1;--flf-muted:#FDF0F1;--flf-rule:#C15672}
html[data-palette="osmanthus"]:not([data-theme="dark"]){--flf-bg:#B07219;--flf-fg:#111111;--flf-muted:#111111;--flf-rule:#8D5D17}
html[data-palette="sesame"]:not([data-theme="dark"]){--flf-bg:#44403A;--flf-fg:#F4F3EF;--flf-muted:#CDCCC7;--flf-rule:#6B6762}
html[data-palette="orchid"]:not([data-theme="dark"]){--flf-bg:#6B3FA0;--flf-fg:#F7F3FB;--flf-muted:#D8CBE7;--flf-rule:#8A67B4}
html[data-palette="gardenia"]:not([data-theme="dark"]){--flf-bg:#1D5C3D;--flf-fg:#FBF9EF;--flf-muted:#CAD6C8;--flf-rule:#4E7F64}
html[data-palette="custom"]:not([data-theme="dark"]){--flf-bg:var(--flc-ft-bg,var(--fl-accent));--flf-fg:var(--flc-ft-fg,var(--fl-on-accent));--flf-muted:var(--flc-ft-muted,var(--flc-ft-fg,var(--fl-on-accent)));--flf-rule:var(--flc-ft-rule,color-mix(in srgb,var(--flf-fg) 22%,var(--flf-bg)))}
html[data-theme="dark"]{--flf-bg:#10141F;--flf-fg:#F5F4EE;--flf-muted:#B9B4A6;--flf-rule:#2E3448}

/* 3. font menu (Dubai default; overrides the mu-plugin blanket only when another font is chosen) */
html[data-font]:not([data-font="dubai"]) body,
html[data-font]:not([data-font="dubai"]) body *:not(.katex):not(.katex *),
html[data-font]:not([data-font="dubai"]) body *:not(.katex *)::before,
html[data-font]:not([data-font="dubai"]) body *:not(.katex *)::after{font-family:var(--fl-reader-font)!important}
html[data-font="atkinson"]{--fl-reader-font:'Atkinson Hyperlegible', Verdana, 'Segoe UI', sans-serif}
html[data-font="literata"]{--fl-reader-font:'Literata', Georgia, 'Times New Roman', serif}
html[data-font="american-typewriter"]{--fl-reader-font:'American Typewriter', 'Courier New', serif}
html[data-font="andale-mono"]{--fl-reader-font:'Andale Mono', Monaco, 'Courier New', monospace}
html[data-font="apple-chancery"]{--fl-reader-font:'Apple Chancery', cursive}
html[data-font="arial"]{--fl-reader-font:Arial, Helvetica, 'Helvetica Neue', sans-serif}
html[data-font="arial-black"]{--fl-reader-font:'Arial Black', Arial, Helvetica, sans-serif}
html[data-font="arial-narrow"]{--fl-reader-font:'Arial Narrow', Arial, Helvetica, sans-serif}
html[data-font="avenir"]{--fl-reader-font:Avenir, 'Avenir Next', 'Helvetica Neue', Arial, sans-serif}
html[data-font="avenir-next"]{--fl-reader-font:'Avenir Next', Avenir, 'Helvetica Neue', Arial, sans-serif}
html[data-font="bahnschrift"]{--fl-reader-font:Bahnschrift, 'DIN Alternate', 'Segoe UI', sans-serif}
html[data-font="baskerville-sys"]{--fl-reader-font:Baskerville, 'Baskerville Old Face', 'Times New Roman', serif}
html[data-font="big-caslon"]{--fl-reader-font:'Big Caslon', 'Book Antiqua', 'Times New Roman', serif}
html[data-font="book-antiqua"]{--fl-reader-font:'Book Antiqua', Palatino, 'Palatino Linotype', 'Times New Roman', serif}
html[data-font="bookman"]{--fl-reader-font:'Bookman Old Style', Bookman, Georgia, serif}
html[data-font="bradley-hand"]{--fl-reader-font:'Bradley Hand', 'Bradley Hand ITC', cursive}
html[data-font="brush-script"]{--fl-reader-font:'Brush Script MT', cursive}
html[data-font="calibri"]{--fl-reader-font:Calibri, 'Segoe UI', Candara, 'Helvetica Neue', Arial, sans-serif}
html[data-font="cambria"]{--fl-reader-font:Cambria, 'Times New Roman', Times, serif}
html[data-font="candara"]{--fl-reader-font:Candara, Calibri, 'Segoe UI', Arial, sans-serif}
html[data-font="cantarell"]{--fl-reader-font:Cantarell, 'Segoe UI', sans-serif}
html[data-font="cascadia-code"]{--fl-reader-font:'Cascadia Code', Consolas, monospace}
html[data-font="cascadia-mono"]{--fl-reader-font:'Cascadia Mono', Consolas, monospace}
html[data-font="century-gothic"]{--fl-reader-font:'Century Gothic', CenturyGothic, AppleGothic, sans-serif}
html[data-font="century-schoolbook"]{--fl-reader-font:'Century Schoolbook', 'New Century Schoolbook', Georgia, serif}
html[data-font="chalkduster"]{--fl-reader-font:Chalkduster, fantasy, cursive}
html[data-font="comic-sans"]{--fl-reader-font:'Comic Sans MS', 'Comic Sans', cursive, sans-serif}
html[data-font="consolas"]{--fl-reader-font:Consolas, 'Lucida Console', 'Courier New', monospace}
html[data-font="constantia"]{--fl-reader-font:Constantia, 'Palatino Linotype', Palatino, Georgia, serif}
html[data-font="copperplate"]{--fl-reader-font:Copperplate, 'Copperplate Gothic Light', Fantasy, serif}
html[data-font="corbel"]{--fl-reader-font:Corbel, 'Segoe UI', Calibri, Arial, sans-serif}
html[data-font="courier"]{--fl-reader-font:Courier, 'Courier New', monospace}
html[data-font="courier-new"]{--fl-reader-font:'Courier New', Courier, monospace}
html[data-font="dejavu-sans"]{--fl-reader-font:'DejaVu Sans', Arial, sans-serif}
html[data-font="dejavu-serif"]{--fl-reader-font:'DejaVu Serif', Georgia, serif}
html[data-font="didot"]{--fl-reader-font:Didot, 'Bodoni MT', 'Times New Roman', serif}
html[data-font="franklin-gothic"]{--fl-reader-font:'Franklin Gothic Medium', 'Franklin Gothic', 'ITC Franklin Gothic', Arial, sans-serif}
html[data-font="futura-sys"]{--fl-reader-font:Futura, 'Century Gothic', 'Avenir Next', sans-serif}
html[data-font="gadugi"]{--fl-reader-font:Gadugi, 'Segoe UI', sans-serif}
html[data-font="garamond-sys"]{--fl-reader-font:Garamond, 'EB Garamond', 'Palatino Linotype', serif}
html[data-font="geneva"]{--fl-reader-font:Geneva, Tahoma, Verdana, sans-serif}
html[data-font="georgia"]{--fl-reader-font:Georgia, 'Times New Roman', Times, serif}
html[data-font="gill-sans"]{--fl-reader-font:'Gill Sans', 'Gill Sans MT', Calibri, sans-serif}
html[data-font="helvetica"]{--fl-reader-font:Helvetica, 'Helvetica Neue', Arial, sans-serif}
html[data-font="helvetica-neue"]{--fl-reader-font:'Helvetica Neue', Helvetica, Arial, sans-serif}
html[data-font="herculanum"]{--fl-reader-font:Herculanum, fantasy, serif}
html[data-font="hoefler"]{--fl-reader-font:'Hoefler Text', 'Times New Roman', Georgia, serif}
html[data-font="impact"]{--fl-reader-font:Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif}
html[data-font="liberation-mono"]{--fl-reader-font:'Liberation Mono', Consolas, monospace}
html[data-font="liberation-sans"]{--fl-reader-font:'Liberation Sans', Arial, sans-serif}
html[data-font="liberation-serif"]{--fl-reader-font:'Liberation Serif', 'Times New Roman', serif}
html[data-font="lucida-console"]{--fl-reader-font:'Lucida Console', Monaco, 'Courier New', monospace}
html[data-font="lucida-grande"]{--fl-reader-font:'Lucida Grande', 'Lucida Sans Unicode', Arial, sans-serif}
html[data-font="lucida-sans"]{--fl-reader-font:'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif}
html[data-font="malgun"]{--fl-reader-font:'Malgun Gothic', 'Segoe UI', sans-serif}
html[data-font="marker-felt"]{--fl-reader-font:'Marker Felt', fantasy, cursive}
html[data-font="meiryo"]{--fl-reader-font:Meiryo, 'Segoe UI', sans-serif}
html[data-font="menlo"]{--fl-reader-font:Menlo, Monaco, Consolas, monospace}
html[data-font="microsoft-yahei"]{--fl-reader-font:'Microsoft YaHei', 'Segoe UI', sans-serif}
html[data-font="monaco"]{--fl-reader-font:Monaco, Menlo, 'Courier New', monospace}
html[data-font="ms-gothic"]{--fl-reader-font:'MS Gothic', 'MS UI Gothic', sans-serif}
html[data-font="mv-boli"]{--fl-reader-font:'MV Boli', cursive}
html[data-font="noteworthy"]{--fl-reader-font:Noteworthy, 'Segoe Print', cursive}
html[data-font="noto-sans-sys"]{--fl-reader-font:'Noto Sans', 'Helvetica Neue', Arial, sans-serif}
html[data-font="noto-serif-sys"]{--fl-reader-font:'Noto Serif', Georgia, serif}
html[data-font="optima"]{--fl-reader-font:Optima, Candara, 'Segoe UI', sans-serif}
html[data-font="palatino"]{--fl-reader-font:'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif}
html[data-font="papyrus"]{--fl-reader-font:Papyrus, fantasy, serif}
html[data-font="perpetua"]{--fl-reader-font:Perpetua, Baskerville, Georgia, serif}
html[data-font="rockwell"]{--fl-reader-font:Rockwell, 'Courier New', Georgia, serif}
html[data-font="segoe-print"]{--fl-reader-font:'Segoe Print', 'Comic Sans MS', cursive}
html[data-font="segoe-script"]{--fl-reader-font:'Segoe Script', cursive}
html[data-font="segoe-ui"]{--fl-reader-font:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif}
html[data-font="sf-mono"]{--fl-reader-font:'SF Mono', ui-monospace, Menlo, monospace}
html[data-font="sf-pro"]{--fl-reader-font:-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif}
html[data-font="sitka"]{--fl-reader-font:Sitka, Georgia, serif}
html[data-font="snell"]{--fl-reader-font:'Snell Roundhand', cursive}
html[data-font="system-ui"]{--fl-reader-font:system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif}
html[data-font="tahoma"]{--fl-reader-font:Tahoma, Geneva, Verdana, sans-serif}
html[data-font="times"]{--fl-reader-font:Times, 'Times New Roman', Georgia, serif}
html[data-font="times-new-roman"]{--fl-reader-font:'Times New Roman', Times, Baskerville, Georgia, serif}
html[data-font="trebuchet"]{--fl-reader-font:'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif}
html[data-font="ubuntu"]{--fl-reader-font:Ubuntu, 'Segoe UI', sans-serif}
html[data-font="ui-mono"]{--fl-reader-font:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace}
html[data-font="ui-rounded"]{--fl-reader-font:ui-rounded, 'SF Pro Rounded', system-ui, sans-serif}
html[data-font="ui-sans"]{--fl-reader-font:ui-sans-serif, system-ui, sans-serif}
html[data-font="ui-serif"]{--fl-reader-font:ui-serif, Georgia, serif}
html[data-font="verdana"]{--fl-reader-font:Verdana, Geneva, Tahoma, sans-serif}
html[data-font="yu-gothic"]{--fl-reader-font:'Yu Gothic', 'Yu Gothic UI', sans-serif}
html[data-font="zapfino"]{--fl-reader-font:Zapfino, cursive}

/* 4. text size (steps from the panel; 100 = no change) */
html[data-text-size="87.5"]{--fl-ts:0.875}
html[data-text-size="93.75"]{--fl-ts:0.9375}
html[data-text-size="100"]{--fl-ts:1}
html[data-text-size="106.25"]{--fl-ts:1.0625}
html[data-text-size="112.5"]{--fl-ts:1.125}
html[data-text-size="125"]{--fl-ts:1.25}
html[data-text-size="137.5"]{--fl-ts:1.375}
html[data-text-size="150"]{--fl-ts:1.5}
html[data-text-size]:not([data-text-size="100"]) body{font-size:calc(18px * var(--fl-ts,1))!important}
html[data-text-size]:not([data-text-size="100"]) body .fl-prose,html[data-text-size]:not([data-text-size="100"]) body .fl-reader-prose,html[data-text-size]:not([data-text-size="100"]) body .fl-article__body,html[data-text-size]:not([data-text-size="100"]) body .fl-prose>p,html[data-text-size]:not([data-text-size="100"]) body .fl-prose>li,html[data-text-size]:not([data-text-size="100"]) body .fl-prose li,html[data-text-size]:not([data-text-size="100"]) body .fl-prose p{font-size:calc(18px * var(--fl-ts,1))!important}
html[data-text-size]:not([data-text-size="100"]) body .fl-lead__excerpt{font-size:calc(17px * var(--fl-ts,1))!important}
html[data-text-size]:not([data-text-size="100"]) body .fl-card__title,html[data-text-size]:not([data-text-size="100"]) body .fl-archive-grid .fl-card__title,html[data-text-size]:not([data-text-size="100"]) body .fl-explore .fl-card__title{font-size:calc(22px * var(--fl-ts,1))!important}
html[data-text-size]:not([data-text-size="100"]) body .fl-card__excerpt,html[data-text-size]:not([data-text-size="100"]) body .fl-archive-grid .fl-card__excerpt,html[data-text-size]:not([data-text-size="100"]) body .fl-explore .fl-card__excerpt{font-size:calc(14px * var(--fl-ts,1))!important}
html[data-text-size]:not([data-text-size="100"]) body .fl-card__meta,html[data-text-size]:not([data-text-size="100"]) body .fl-card__eyebrow,html[data-text-size]:not([data-text-size="100"]) body .fl-eyebrow,html[data-text-size]:not([data-text-size="100"]) body .fl-topic-chip{font-size:calc(11px * var(--fl-ts,1))!important}
html[data-text-size]:not([data-text-size="100"]) body .fl-meta,html[data-text-size]:not([data-text-size="100"]) body .fl-lead__meta{font-size:calc(12px * var(--fl-ts,1))!important}
html[data-text-size]:not([data-text-size="100"]) body .fl-masthead .fl-nav a,html[data-text-size]:not([data-text-size="100"]) body .fl-footer a,html[data-text-size]:not([data-text-size="100"]) body .fl-footer .fl-footer-brand p{font-size:calc(14px * var(--fl-ts,1))!important}
html[data-text-size]:not([data-text-size="100"]) body .fl-footer h4{font-size:calc(11px * var(--fl-ts,1))!important}
html[data-text-size]:not([data-text-size="100"]) body .fl-footer-bottom{font-size:calc(12px * var(--fl-ts,1))!important}
html[data-text-size]:not([data-text-size="100"]) body .fl-lead__title{font-size:calc(clamp(36px, 5vw, 56px) * var(--fl-ts,1))!important}
html[data-text-size]:not([data-text-size="100"]) body .fl-article__head h1,html[data-text-size]:not([data-text-size="100"]) body .fl-article__title,html[data-text-size]:not([data-text-size="100"]) body .fl-page-title h1,html[data-text-size]:not([data-text-size="100"]) body .fl-archive-header h1,html[data-text-size]:not([data-text-size="100"]) body .fl-sectionhead h1,html[data-text-size]:not([data-text-size="100"]) body .fl-sectionhead__title{font-size:calc(clamp(36px, 4vw, 52px) * var(--fl-ts,1))!important}

/* Panel font menu: the redesign styles every .fl-select as a text field; keep only the inner select boxed. */
html body .fl-appearance__panel .fl-select{display:block;width:auto;padding:0!important;border:0!important;background:none!important;box-shadow:none!important;min-height:0!important}
html body .fl-masthead .fl-scheme-toggle > span:not(.screen-reader-text){display:none;line-height:0}
html:not([data-theme="dark"]) body .fl-masthead .fl-scheme-toggle > .fl-scheme-toggle__moon,html[data-theme="dark"] body .fl-masthead .fl-scheme-toggle > .fl-scheme-toggle__sun{display:inline-flex}
html body .fl-masthead .fl-controls{display:flex;align-items:center;gap:6px}
