/* ==========================================================================
   imOmics International Alliance — "Dark Fluorescence"
   Dark luminous heroes over fluorescence-microscopy imagery; calm light
   content sections. All styling lives here — CSP forbids inline styles.
   ========================================================================== */

:root {
  --ink:         #0A1524;
  --navy-900:    #081226;
  --navy-800:    #0B1D33;
  --navy-700:    #12304E;
  --blue:        #1B7FBE;
  --blue-bright: #4FB2E8;
  --orange:      #E8720C;
  --orange-dark: #C25F08;
  --cyan:        #3FD2C0;
  --paper:       #FFFFFF;
  --mist:        #F4F7FA;
  --line:        #DFE7EF;
  --muted:       #54687E;
  --radius:      16px;
  --radius-sm:   10px;
  --wrap:        1180px;
  --shadow-sm: 0 1px 3px rgba(8, 18, 38, .08);
  --shadow-md: 0 8px 24px rgba(8, 18, 38, .10);
  --shadow-lg: 0 16px 48px rgba(8, 18, 38, .16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: Georgia, "Times New Roman", "Songti SC", SimSun, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--navy-700); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.22; color: var(--navy-800); margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); letter-spacing: -.015em; }
h2 { font-size: clamp(1.45rem, 3vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--orange); color: #fff; padding: .5rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Header / nav (fixed, translucent dark navy) ---------- */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(8, 18, 38, .55);
  backdrop-filter: saturate(1.3) blur(12px);
  -webkit-backdrop-filter: saturate(1.3) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  transition: background .25s ease, border-color .25s ease;
}
.site-header.scrolled {
  background: rgba(8, 18, 38, .97);
  border-bottom-color: rgba(255, 255, 255, .12);
}

.nav-wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }

.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand:hover { text-decoration: none; }

.logo-chip {
  display: inline-flex; align-items: center; background: #fff;
  border-radius: 10px; padding: 6px 10px; line-height: 0;
  box-shadow: 0 2px 10px rgba(8, 18, 38, .25);
}
.logo-chip img { display: block; }

.site-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.site-nav a {
  display: inline-block; padding: .5rem .72rem; border-radius: 999px;
  color: rgba(255, 255, 255, .92); font-size: .95rem; font-weight: 500; white-space: nowrap;
}
.site-nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }
.site-nav a.active { background: var(--orange); color: #fff; }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08); border-radius: 10px; cursor: pointer; padding: 10px;
}
.nav-toggle span { display: block; height: 2px; margin: 5px 0; background: #fff; border-radius: 2px; }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    background: var(--navy-900); border-bottom: 1px solid rgba(255, 255, 255, .12);
    flex-direction: column; align-items: stretch; padding: 10px 16px 16px; gap: 2px;
    box-shadow: var(--shadow-lg);
  }
  .site-nav a { padding: .7rem 1rem; border-radius: 10px; }
  html.js .site-nav.open { display: flex; }
}

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-block; padding: .78rem 1.5rem; border-radius: 999px;
  font-weight: 600; font-size: 1rem; line-height: 1.2; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 8px 20px rgba(232, 114, 12, .35); }
.btn-primary:hover { background: var(--orange-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-ghost:hover { background: var(--blue); color: #fff; }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .75); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .14); border-color: #fff; color: #fff; }
.btn-accent { background: var(--orange); color: #fff; box-shadow: 0 6px 16px rgba(232, 114, 12, .3); }
.btn-accent:hover { background: var(--orange-dark); color: #fff; }
.btn-sm { padding: .45rem 1rem; font-size: .9rem; }

.link-arrow {
  display: inline-flex; align-items: center; gap: .35rem;
  color: #fff; font-weight: 600; padding: .78rem 0;
}
.link-arrow::after { content: "→"; transition: transform .15s ease; }
.link-arrow:hover { color: var(--cyan); text-decoration: none; }
.link-arrow:hover::after { transform: translateX(4px); }

.card-link { font-weight: 600; }
.card-link::after { content: " →"; }

/* ---------- Home hero ---------- */

.hero {
  position: relative; overflow: hidden; background: var(--navy-900);
  min-height: max(620px, 92vh); display: flex;
}
.hero picture, .hero img.hero-img {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
}
.hero img.hero-img { object-fit: cover; object-position: center; }
.hero-overlay {
  position: relative; flex: 1; display: flex; align-items: flex-end;
  background: linear-gradient(180deg, rgba(8, 18, 38, .55) 0%, rgba(8, 18, 38, .35) 40%, rgba(8, 18, 38, .92) 100%);
  padding: 8rem 0 5rem;
}
.hero-content { max-width: 880px; }

.kicker {
  margin: 0 0 .5rem; font-size: .82rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--blue);
}
.kicker-dark { color: var(--cyan); }

.wordmark {
  margin: 0 0 .4rem; font-size: clamp(3.5rem, 10vw, 7rem); font-weight: 800;
  letter-spacing: -.03em; line-height: 1;
}
.wordmark .wm-im { color: var(--orange); }
.wordmark .wm-omics { color: #fff; }

.hero-tagline {
  margin: 0 0 1.1rem; font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 2.2rem); color: #fff; letter-spacing: -.01em;
}
.hero-manifesto {
  margin: 0 0 2rem; max-width: 760px;
  font-size: 1.15rem; line-height: 1.75; color: rgba(255, 255, 255, .88);
}
.hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

@media (max-width: 700px) {
  .hero { min-height: 640px; }
  .hero-overlay { padding: 7rem 0 3.5rem; }
  .hero-ctas { gap: 12px; }
}

/* ---------- Inner page hero (dark band ~44vh) ---------- */

.page-hero {
  position: relative; background-color: var(--navy-900);
  background-size: cover; background-position: center;
}
.page-hero--about     { background-image: url("../imgs/bg/bg-egg-gold.jpg"); }
.page-hero--science   { background-image: url("../imgs/bg/bg-neuron.jpg"); }
.page-hero--gip       { background-image: url("../imgs/bg/bg-pollen.jpg"); }
.page-hero--standards { background-image: url("../imgs/bg/bg-leaf.jpg"); }
.page-hero--community { background-image: url("../imgs/bg/bg-eggs.jpg"); }
.page-hero--news      { background-image: url("../imgs/bg/bg-vascular.jpg"); }
.page-hero--library   { background-image: url("../imgs/bg/bg-cell-red.jpg"); }

.page-hero-overlay {
  min-height: 44vh; display: flex; align-items: flex-end;
  background: linear-gradient(180deg, rgba(8, 18, 38, .62) 0%, rgba(8, 18, 38, .45) 45%, rgba(8, 18, 38, .88) 100%);
  padding: 9rem 0 3.2rem;
}
.page-hero h1 { color: #fff; margin: 0 0 .4rem; text-shadow: 0 2px 18px rgba(8, 18, 38, .5); }
.page-hero-lead { margin: 0; max-width: 780px; font-size: 1.15rem; color: rgba(255, 255, 255, .9); }

/* ---------- Dark bands (full-bleed fluorescence backgrounds) ---------- */

.band {
  position: relative; background-color: var(--navy-900);
  background-size: cover; background-position: center;
}
.band-tech      { background-image: url("../imgs/bg/bg-root-teal.jpg"); }
.band-proof     { background-image: url("../imgs/bg/bg-embryo-green.jpg"); }
.band-gip       { background-image: url("../imgs/bg/bg-coral.jpg"); }
.band-join      { background-image: url("../imgs/bg/bg-embryo.jpg"); }
.band-nodes     { background-image: url("../imgs/bg/bg-cell-blue.jpg"); }
.band-standards { background-image: url("../imgs/bg/bg-root-purple.jpg"); }
.band-status    { background-image: url("../imgs/bg/bg-eggs-silver.jpg"); }

.band-overlay {
  background: linear-gradient(120deg, rgba(8, 18, 38, .88) 0%, rgba(11, 29, 51, .78) 55%, rgba(8, 18, 38, .60) 100%);
  padding: 5.5rem 0;
}
@media (min-width: 960px) { .band-overlay { padding: 6.5rem 0; } }

.band h2, .band h3 { color: #fff; }
.band .lead { color: rgba(255, 255, 255, .85); }

.band-split { display: flex; }
.band-split-text { max-width: 720px; }
.band-lead { font-size: 1.2rem; color: rgba(255, 255, 255, .9); margin: 0 0 1.8rem; }
.band-note { margin: 1.4rem 0 0; font-size: .92rem; color: rgba(255, 255, 255, .65); }

.band-card {
  background: rgba(11, 29, 51, .62); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius); padding: 1.5rem 1.4rem;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.band-card h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.band-card p { margin: 0; font-size: .95rem; color: rgba(255, 255, 255, .82); }

.section-head-dark { color: #fff; }
.section-head-dark h2 { color: #fff; }

/* ---------- Sections ---------- */

.section { padding: 4.6rem 0; }
.section.tinted, .section-tight.tinted { background: var(--mist); }
.section-tight { padding: 3.2rem 0; }
.section-head { max-width: 780px; margin: 0 auto 2.6rem; text-align: center; }
.section-head .lead { color: var(--muted); font-size: 1.1rem; margin: 0; }

/* ---------- Cards & grids ---------- */

.grid { display: grid; gap: 20px; }
.grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
@media (min-width: 700px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-5 { grid-template-columns: repeat(5, 1fr); }
}

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1.7rem;
}
.lift-card { transition: transform .18s ease, box-shadow .18s ease; }
.lift-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card h3 { margin-top: 0; }
.card p { margin: 0 0 .8rem; }
.card p:last-child { margin-bottom: 0; }
.card-accent { border-top: 4px solid var(--orange); }

.mini-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.3rem; box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--blue);
}
.mini-card h3 { font-size: 1rem; margin: 0 0 .4rem; }
.mini-card p { margin: 0; font-size: .92rem; color: var(--muted); }

/* ---------- Omics continuum strip ---------- */

.continuum {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 10px 12px; text-align: center;
}
.continuum-item {
  font-weight: 700; font-size: clamp(1.05rem, 2.4vw, 1.5rem); color: var(--navy-700);
  padding: .35rem .9rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper);
}
.continuum-hot {
  color: #fff; background: var(--orange); border-color: var(--orange);
  box-shadow: 0 6px 18px rgba(232, 114, 12, .35);
}
.continuum-arrow { color: var(--muted); font-size: 1.2rem; }
.continuum-caption { text-align: center; color: var(--muted); margin: 1.2rem 0 0; }

/* ---------- Timeline (horizontal desktop / vertical mobile) ---------- */

.timeline {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 1.6rem;
  position: relative;
}
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
.timeline-item { position: relative; padding-left: 2rem; }
.timeline-item::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--orange); border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--orange);
}
.timeline-item.dot-blue::before { background: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
.timeline-year {
  display: inline-block; font-weight: 800; font-size: 1.05rem; color: var(--orange);
  letter-spacing: .02em; margin-bottom: .15rem;
}
.dot-blue .timeline-year { color: var(--blue); }
.timeline-item h3 { font-size: 1.05rem; margin: 0 0 .25rem; }
.timeline-item p { margin: 0; font-size: .9rem; color: var(--muted); line-height: 1.6; }

@media (min-width: 960px) {
  .timeline { flex-direction: row; gap: 1.2rem; padding-top: 2.2rem; }
  .timeline::before { left: 0; right: 0; top: 7px; bottom: auto; width: auto; height: 2px; }
  .timeline-item { flex: 1 1 0; min-width: 0; padding-left: 0; }
  .timeline-item::before { top: -2.2rem; }
  .timeline-short .timeline-item p { font-size: .95rem; }
}

/* ---------- Comparison tables ---------- */

.table-wrap { overflow-x: auto; }
.compare-table {
  width: 100%; border-collapse: collapse; background: var(--paper);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.compare-table th, .compare-table td {
  text-align: left; padding: .85rem 1.1rem; font-size: .97rem; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.compare-table thead th { background: var(--navy-800); color: #fff; font-size: .95rem; letter-spacing: .03em; }
.compare-table tbody tr:nth-child(even) td, .compare-table tbody tr:nth-child(even) th { background: var(--mist); }
.compare-table tbody th { font-weight: 700; color: var(--navy-800); }
.compare-table tr:last-child th, .compare-table tr:last-child td { border-bottom: none; }

/* ---------- KPI / stat numerals ---------- */

.kpi-card { text-align: center; }
.kpi-num {
  display: block; font-size: clamp(2.4rem, 4.5vw, 3.2rem); font-weight: 800;
  letter-spacing: -.02em; line-height: 1.1; color: var(--cyan); margin-bottom: .4rem;
}
.band-card .kpi-num { color: var(--cyan); }
.kpi-card h3 { margin: 0 0 .2rem; }

/* ---------- News ---------- */

.news-list { display: grid; gap: 18px; max-width: 900px; margin: 0 auto; }
.news-card h2, .news-card h3 { font-size: 1.25rem; margin: .5rem 0 .4rem; }
.news-card h2 a, .news-card h3 a { color: var(--navy-800); }
.news-card h2 a:hover, .news-card h3 a:hover { color: var(--orange); text-decoration: none; }
.news-card p { color: var(--muted); margin: 0 0 .8rem; }
.news-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.news-meta time { color: var(--muted); font-size: .88rem; font-weight: 600; }

.badge-cat {
  display: inline-block; padding: .18rem .7rem; border-radius: 999px;
  font-size: .76rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.badge-announcement { background: rgba(27, 127, 190, .12); color: var(--blue); border: 1px solid rgba(27, 127, 190, .35); }
.badge-position     { background: rgba(232, 114, 12, .12); color: var(--orange-dark); border: 1px solid rgba(232, 114, 12, .4); }
.badge-media        { background: rgba(63, 210, 192, .14); color: #0E7C70; border: 1px solid rgba(63, 210, 192, .45); }

/* ---------- GiP world dots ---------- */

.world-dots { display: block; width: 100%; max-width: 900px; margin: 0 auto 2.4rem; height: auto; }
.world-dots .dot-field circle { fill: rgba(255, 255, 255, .55); }
.world-dots .node-ring circle {
  fill: none; stroke: var(--cyan); stroke-width: 2; opacity: .9;
}

/* ---------- Governance clause (GiP) ---------- */

.gov-clause {
  margin-top: 1.6rem; padding: 1.4rem 1.5rem; background: var(--mist);
  border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: var(--radius-sm);
}
.gov-clause h3 { margin: 0 0 .4rem; }
.gov-clause p { margin: 0; color: var(--muted); }

/* ---------- Essay / rich text (mission & long-form) ---------- */

.essay { max-width: 800px; margin: 0 auto; }
.essay-card { padding: 2.4rem clamp(1.4rem, 4vw, 3rem); }
.essay h1 { margin-bottom: .2rem; }
.essay .subtitle { color: var(--muted); font-size: 1.12rem; margin: 0 0 1rem; }
.essay .byline { font-weight: 700; color: var(--orange-dark); margin: 0 0 1.6rem; }
.essay-body { font-family: var(--serif); font-size: 1.08rem; line-height: 1.85; color: #22303f; }
.essay-body p { margin: 0 0 1.15rem; }
.doi-chip {
  display: inline-block; margin-top: .4rem; background: var(--mist); border: 1px solid var(--line);
  border-radius: 999px; padding: .35rem .95rem; font-size: .9rem; font-weight: 600;
}
.refs { font-size: .95rem; color: var(--muted); }
.refs ul { padding-left: 1.2rem; }
.refs li { margin-bottom: .5rem; }

.rich-text h2 { font-size: 1.35rem; margin: 1.4rem 0 .5rem; }
.rich-text h3 { font-size: 1.15rem; margin: 0 0 .5rem; }
.rich-text p { color: var(--ink); margin: 0 0 .9rem; }
.rich-text ul { margin: 0 0 .9rem; padding-left: 1.2rem; }
.rich-text > h3:first-child { margin-top: 0; }

/* ---------- Advisors ---------- */

.advisor-card { display: flex; gap: 1.4rem; align-items: flex-start; }
.advisor-photo {
  flex: 0 0 132px; width: 132px; height: 158px; object-fit: cover; object-position: top;
  border-radius: var(--radius-sm); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  background: var(--mist);
}
.advisor-card h3 { margin-bottom: .15rem; }
.advisor-role { color: var(--orange-dark); font-weight: 600; font-size: .9rem; margin: 0 0 .6rem; }
.advisor-bio { color: var(--muted); font-size: .95rem; margin: 0 0 .7rem; }
.more-info { font-weight: 600; font-size: .95rem; }
.more-info::after { content: " ↗"; }

@media (max-width: 560px) {
  .advisor-card { flex-direction: column; }
  .advisor-photo { width: 150px; height: 180px; }
}

/* ---------- Page intro (light inner pages) ---------- */

.page-intro {
  background: var(--mist); border-bottom: 1px solid var(--line);
  padding: 9.5rem 0 2.6rem;
}
.page-intro h1 { margin-bottom: .4rem; }
.page-intro p { color: var(--muted); margin: 0; max-width: 780px; font-size: 1.1rem; }

.breadcrumb { font-size: .9rem; margin-bottom: 1.2rem; color: var(--muted); }
.breadcrumb a { font-weight: 600; }

/* ---------- Contact ---------- */

.info-card { text-align: center; }
.info-card .icon-circle {
  width: 58px; height: 58px; margin: 0 auto .8rem; border-radius: 50%;
  background: var(--mist); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--blue);
}
.info-card h3 { margin-bottom: .3rem; }
.info-card p { color: var(--muted); margin: 0 0 .9rem; }

/* ---------- Forms ---------- */

.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.8rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .35rem; color: var(--navy-800); }
.field .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
.field .check-label { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.field .check-label input { width: auto; }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="url"], .field input[type="number"], .field select, .field textarea {
  width: 100%; padding: .65rem .85rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 1rem; color: var(--ink); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27, 127, 190, .15);
}
.field textarea { min-height: 130px; resize: vertical; }
.form-row { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } }
.honeypot { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 1.2rem; }

/* ---------- Flash messages ---------- */

.flash { max-width: var(--wrap); margin: 1rem auto; padding: .9rem 1.2rem; border-radius: var(--radius-sm); font-weight: 500; }
.flash-success { background: #eaf7ee; border: 1px solid #bfe5c9; color: #1c6b38; }
.flash-error { background: #fdeeea; border: 1px solid #f5c9b8; color: #a33c12; }
.flash-info { background: var(--mist); border: 1px solid var(--line); color: var(--navy-700); }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy-900); color: #b9c8d9; }
.footer-grid {
  display: grid; gap: 2rem; padding: 3.2rem 20px 2.6rem; grid-template-columns: 1fr;
}
@media (min-width: 700px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1.2fr; } }
.footer-brand .logo-chip { box-shadow: none; }
.footer-tagline { margin: 1.1rem 0 0; font-size: .95rem; max-width: 400px; color: #93a7bd; }
.site-footer h2 { color: #fff; font-size: .95rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: .8rem; }
.footer-nav a { display: block; color: #b9c8d9; padding: .18rem 0; font-size: .96rem; }
.footer-nav a:hover { color: #fff; text-decoration: none; }
.footer-contact p { margin: 0 0 .6rem; font-size: .96rem; }
.footer-contact a { color: #fff; }
.footer-bar { border-top: 1px solid rgba(255, 255, 255, .12); padding: 1.1rem 0; font-size: .88rem; color: #8499b0; }
.footer-bar-inner { display: flex; gap: .6rem 1.6rem; flex-wrap: wrap; align-items: center; }
.footer-bar-inner a { color: #b9c8d9; font-weight: 600; }
.footer-bar-inner a:hover { color: #fff; }

/* ---------- Scroll reveal (JS-gated, reduced-motion safe) ---------- */

@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0; transform: translateY(18px);
    transition: opacity .6s ease, transform .6s ease;
  }
  html.js .reveal.is-visible { opacity: 1; transform: none; }
}

/* ==========================================================================
   Admin
   ========================================================================== */

.admin-body { background: var(--mist); }

.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem 16px; background: linear-gradient(160deg, var(--navy-900), var(--navy-700));
}
.auth-card { width: 100%; max-width: 430px; }
.auth-card .brand-center { text-align: center; margin-bottom: 1.2rem; }
.auth-note { text-align: center; color: rgba(255, 255, 255, .75); font-size: .9rem; margin-top: 1rem; }
.auth-note a { color: #fff; }

.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  flex: 0 0 250px; background: var(--navy-800); color: #b9c8d9;
  display: flex; flex-direction: column; padding: 1.2rem 0;
}
.admin-brand { padding: 0 1.2rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, .14); display: flex; align-items: center; gap: .6rem; }
.admin-brand .logo-chip { padding: 4px 8px; border-radius: 8px; box-shadow: none; }
.admin-brand:hover { text-decoration: none; }
.admin-badge {
  background: var(--orange); color: #fff; font-size: .72rem; font-weight: 800;
  padding: .15rem .55rem; border-radius: 999px; letter-spacing: .06em;
}
.admin-nav { display: flex; flex-direction: column; padding: 1rem .8rem; gap: 2px; }
.admin-nav a {
  color: #b9c8d9; padding: .6rem .9rem; border-radius: 9px; font-size: .97rem; font-weight: 500;
  display: flex; align-items: center; gap: .5rem; justify-content: space-between;
}
.admin-nav a:hover { background: rgba(255, 255, 255, .09); color: #fff; text-decoration: none; }
.admin-nav a.active { background: var(--blue); color: #fff; }
.pill-count {
  background: var(--orange); color: #fff; border-radius: 999px; font-size: .74rem;
  font-weight: 800; padding: .05rem .5rem;
}
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: 1rem 1.6rem;
}
.admin-topbar h1 { font-size: 1.35rem; margin: 0; }
.admin-content { padding: 1.6rem; }
.admin-content .flash { margin: 0 0 1.2rem; max-width: none; }

@media (max-width: 900px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { flex: none; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
}

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 1.6rem; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); }
.stat-card .num { font-size: 1.9rem; font-weight: 800; color: var(--blue); display: block; line-height: 1.1; }
.stat-card .lbl { color: var(--muted); font-size: .9rem; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-table th, .admin-table td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); font-size: .95rem; vertical-align: top; }
.admin-table th { background: var(--mist); color: var(--navy-800); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .thumb { width: 56px; height: 42px; object-fit: contain; background: var(--mist); border-radius: 6px; border: 1px solid var(--line); }
.admin-table .thumb.round { width: 46px; height: 54px; object-fit: cover; object-position: top; }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions form { display: inline; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
.toolbar .spacer { flex: 1; }
.toolbar select, .toolbar input[type="text"] {
  padding: .5rem .8rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: .95rem; background: #fff;
}

.msg-unread td { background: #fff8f2; font-weight: 600; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--mist); color: var(--blue); border: 1px solid var(--line); }
.badge.orange { background: #fff3e8; color: var(--orange-dark); border-color: #f5d3b3; }

.pages-form .field textarea { min-height: 110px; font-size: .95rem; }
.pages-group { margin-bottom: 2rem; }
.pages-group > h2 { font-size: 1.15rem; border-bottom: 2px solid var(--line); padding-bottom: .4rem; margin-bottom: 1.2rem; }

/* Utility */
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.mt-0 { margin-top: 0; }
.mt-3 { margin-top: 1.8rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.narrow-card { max-width: 860px; margin-left: auto; margin-right: auto; }
.lead-text { font-size: 1.1rem; }
.center-actions { justify-content: center; }
.form-narrow { max-width: 520px; }
.plain-link { text-decoration: none; color: inherit; }
.plain-link:hover { text-decoration: none; color: inherit; }
.plain-list { margin: 0; padding-left: 1.2rem; color: var(--muted); }

/* ==========================================================================
   Flux Library (public front end) — "lib-" prefixed, Dark Fluorescence theme
   ========================================================================== */

/* ---------- Live statistics strip (dark, fluorescent numerals) ---------- */

.lib-stats {
  background: linear-gradient(120deg, var(--navy-900) 0%, var(--navy-800) 60%, var(--navy-700) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  padding: 2.2rem 0;
}
.lib-stats-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 700px) { .lib-stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .lib-stats-grid { grid-template-columns: repeat(6, 1fr); } }
.lib-stat { text-align: center; }
.lib-stat-num {
  display: block; font-weight: 800; letter-spacing: -.02em; line-height: 1.05;
  font-size: clamp(2rem, 4vw, 2.9rem); color: var(--cyan);
  text-shadow: 0 0 18px rgba(63, 210, 192, .45), 0 0 42px rgba(63, 210, 192, .18);
}
.lib-stat-label {
  display: block; margin-top: .3rem; font-size: .76rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .72);
}

/* ---------- Landing: clickable sub-library cards ---------- */

.lib-link-card { display: block; color: inherit; text-decoration: none; }
.lib-link-card:hover { color: inherit; text-decoration: none; }
.lib-link-card h3 { color: var(--navy-800); }
.lib-link-card:hover h3 { color: var(--orange-dark); }
.lib-card-count {
  font-weight: 700; font-size: .95rem; color: var(--blue);
  border-top: 1px solid var(--line); padding-top: .7rem; margin-top: .4rem;
}

/* ---------- Ask the Library ---------- */

.lib-ask {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
  border: 1px solid rgba(63, 210, 192, .35); border-radius: var(--radius);
  box-shadow: var(--shadow-md), 0 0 34px rgba(63, 210, 192, .10);
  padding: 1.6rem;
}
.lib-ask-form { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.lib-ask-form input {
  flex: 1 1 320px; padding: .78rem 1rem; border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .96);
  font-family: var(--font); font-size: 1rem; color: var(--ink);
}
.lib-ask-form input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(63, 210, 192, .25); }
.lib-ask-result { margin-top: 1.1rem; }
.lib-ask-hint { margin: 0; color: rgba(255, 255, 255, .62); font-size: .92rem; }
.lib-ask-answer {
  background: rgba(255, 255, 255, .97); border-left: 4px solid var(--cyan);
  border-radius: var(--radius-sm); padding: 1.1rem 1.3rem;
}
.lib-ask-answer p { margin: 0 0 .8rem; }
.lib-ask-answer p:last-child { margin-bottom: 0; }
.lib-ask-answer ul { margin: 0 0 .8rem; padding-left: 1.2rem; }
.lib-ask-refs { font-size: .92rem; }
.lib-ask-refs-label { font-weight: 700; color: var(--navy-700); }
.lib-ref-chip {
  display: inline-block; padding: .08rem .6rem; margin: .1rem .1rem;
  border-radius: 999px; font-size: .84rem; font-weight: 700;
  background: rgba(27, 127, 190, .10); border: 1px solid rgba(27, 127, 190, .35); color: var(--blue);
}
a.lib-ref-chip:hover { background: var(--blue); color: #fff; text-decoration: none; }
.lib-ask-meta { margin-top: .7rem; font-size: .82rem; color: var(--muted); }
.lib-badge-cached, .lib-badge-fresh {
  display: inline-block; padding: .05rem .55rem; border-radius: 999px;
  font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.lib-badge-cached { background: rgba(63, 210, 192, .14); color: #0E7C70; border: 1px solid rgba(63, 210, 192, .45); }
.lib-badge-fresh { background: rgba(232, 114, 12, .12); color: var(--orange-dark); border: 1px solid rgba(232, 114, 12, .4); }

/* Pure-CSS waiting spinner (border ring, no images — CSP-safe). Inserted by
   library.js while an Ask request is in flight, removed when it settles. */
.lib-spinner {
  display: inline-block; width: 20px; height: 20px; flex: 0 0 auto;
  border: 3px solid rgba(255, 255, 255, .28); border-top-color: var(--cyan);
  border-radius: 50%; animation: lib-spin .8s linear infinite;
}
@keyframes lib-spin { to { transform: rotate(360deg); } }
.lib-ask-wait {
  display: flex; align-items: center; gap: .7rem; margin: 0;
  color: rgba(255, 255, 255, .88); font-size: .94rem; line-height: 1.45;
}

/* ---------- Filter forms ---------- */

.lib-filters {
  display: grid; gap: 14px; align-items: end;
  grid-template-columns: 1fr;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1.3rem 1.3rem; margin-bottom: 1.4rem;
}
@media (min-width: 700px) { .lib-filters { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .lib-filters { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.lib-filters .field { margin-bottom: 0; }
.lib-filters-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lib-result-count { color: var(--muted); font-size: .92rem; margin: 0 0 .8rem; }

/* ---------- Result tables ---------- */

.lib-table-scroll { overflow-x: auto; }
.lib-table {
  width: 100%; min-width: 760px; border-collapse: collapse;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.lib-table th, .lib-table td {
  text-align: left; padding: .72rem .9rem; font-size: .93rem; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.lib-table thead th {
  background: var(--navy-800); color: #fff; font-size: .82rem;
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.lib-table tbody tr:nth-child(even) td { background: var(--mist); }
.lib-table tbody tr:last-child td { border-bottom: none; }
.lib-truncate {
  display: inline-block; max-width: 300px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; cursor: help;
}
.lib-detail-row td { background: rgba(63, 210, 192, .07) !important; font-size: .9rem; }
.lib-expand-btn {
  display: inline-block; margin-left: .5rem; padding: .05rem .55rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--mist);
  color: var(--blue); font-size: .76rem; font-weight: 700; cursor: pointer;
}
.lib-expand-btn::after { content: " ▾"; }
.lib-expand-btn.open::after { content: " ▴"; }
.lib-expand-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* Direction badges: efflux warm, influx cold */
.lib-badge-dir {
  display: inline-block; padding: .12rem .6rem; border-radius: 999px;
  font-size: .8rem; font-weight: 800; white-space: nowrap;
}
.lib-badge-efflux { background: rgba(232, 114, 12, .12); color: var(--orange-dark); border: 1px solid rgba(232, 114, 12, .4); }
.lib-badge-influx { background: rgba(27, 127, 190, .12); color: var(--blue); border: 1px solid rgba(27, 127, 190, .38); }

/* ---------- Pagination ---------- */

.lib-pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 1.4rem; }
.lib-pager-link, .lib-pager-current {
  display: inline-block; min-width: 2.2rem; text-align: center;
  padding: .38rem .7rem; border-radius: 999px; font-size: .92rem; font-weight: 600;
}
.lib-pager-link { border: 1px solid var(--line); background: var(--paper); }
.lib-pager-link:hover { background: var(--navy-800); border-color: var(--navy-800); color: #fff; text-decoration: none; }
.lib-pager-current { background: var(--orange); color: #fff; }
.lib-pager-gap { padding: .38rem .3rem; color: var(--muted); }

/* ---------- Empty / status messages ---------- */

.lib-empty { text-align: center; color: var(--muted); padding: 1.8rem 1rem; }
.lib-loading { color: var(--muted); font-style: italic; }
.lib-error {
  background: #fdeeea; border: 1px solid #f5c9b8; color: #a33c12;
  border-radius: var(--radius-sm); padding: .8rem 1rem; font-weight: 500;
}
.lib-ask .lib-loading { color: rgba(255, 255, 255, .75); }

/* ---------- Comparator ---------- */

.lib-compare { margin-bottom: 1.8rem; border-top: 4px solid var(--cyan); }
.lib-compare-title { font-size: 1.3rem; margin-bottom: .3rem; }
.lib-compare-form {
  display: grid; gap: 14px; align-items: end; grid-template-columns: 1fr;
  margin-top: 1rem;
}
@media (min-width: 700px) { .lib-compare-form { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .lib-compare-form { grid-template-columns: repeat(3, 1fr); } }
.lib-compare-form .field { margin-bottom: 0; }
.lib-compare-result { margin-top: 1.2rem; }
.lib-compare-summary { margin: .5rem 0 0; }
.lib-chart {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1rem 1rem 1.6rem; overflow-x: auto;
}
.lib-compare-svg, .lib-atlas-svg { display: block; width: 100%; height: auto; }
.lib-cmp-whisker { stroke: var(--navy-700); stroke-width: 2; }
.lib-cmp-iqr { fill: rgba(63, 210, 192, .25); stroke: var(--cyan); stroke-width: 1.5; rx: 6; }
.lib-cmp-median { stroke: var(--navy-800); stroke-width: 3; }
.lib-cmp-user { stroke: var(--orange); stroke-width: 3; }
.lib-cmp-user-label { font-size: 12px; font-weight: 800; fill: var(--orange-dark); }
.lib-cmp-tick { font-size: 11px; fill: var(--muted); }
.lib-cmp-tick-name { font-size: 9.5px; fill: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.lib-cmp-oob { fill: var(--orange); }
.lib-cmp-tick-leader { stroke: var(--line); stroke-width: 1; }

/* ---------- Trend Atlas ---------- */

.lib-axis-grid { stroke: var(--line); stroke-width: 1; }
.lib-axis-line { stroke: var(--navy-700); stroke-width: 1.5; }
.lib-atlas-zero { stroke: var(--navy-800); stroke-width: 2.6; stroke-dasharray: 7 4; }
.lib-axis-text { font-size: 11px; fill: var(--muted); }
.lib-axis-caption { font-size: 12px; font-weight: 700; fill: var(--navy-700); }
.lib-atlas-line { transition: stroke-width .12s ease; }
.lib-atlas-line:hover { stroke-width: 4; }
.lib-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin: .9rem 0 0; }
.lib-legend-item { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; }
.lib-legend-chip { display: inline-block; vertical-align: -2px; border-radius: 3.5px; }
.lib-section-title { margin: 2.2rem 0 .9rem; font-size: 1.25rem; }

/* ---------- Paper detail ---------- */

.lib-paper-meta { margin-bottom: .6rem; }
.lib-meta-grid {
  display: grid; gap: 1rem 1.6rem; margin: 0;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) { .lib-meta-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .lib-meta-grid { grid-template-columns: repeat(3, 1fr); } }
.lib-meta-grid dt { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lib-meta-grid dd { margin: .15rem 0 0; font-weight: 600; color: var(--navy-800); }
.lib-meta-nav { margin: 1.1rem 0 .4rem; font-weight: 600; }
.lib-spark { display: block; background: var(--mist); border: 1px solid var(--line); border-radius: 6px; }
.lib-spark-line { fill: none; stroke: var(--blue); stroke-width: 1.8; }
.lib-spark-zero { stroke: var(--navy-700); stroke-width: 1; stroke-dasharray: 4 3; }

/* ---------- Responsive: tables scroll horizontally below 960px ---------- */

@media (max-width: 960px) {
  .lib-filters, .lib-compare-form { grid-template-columns: 1fr 1fr; }
  .lib-truncate { max-width: 200px; }
}
@media (max-width: 640px) {
  .lib-filters, .lib-compare-form { grid-template-columns: 1fr; }
  .lib-ask-form { flex-direction: column; }
  .lib-ask-form .btn { align-self: stretch; }
}

/* ---------- Sign convention: MIFE ⇄ NMT (direction-first model) ---------- */

/* Generic small pill + the "MIFE source (influx-positive paper)" marker.
   .lib-badge-converted kept as an alias for backwards compatibility. */
.lib-badge {
  display: inline-block; padding: .08rem .5rem; border-radius: 999px;
  font-size: .72rem; font-weight: 800; letter-spacing: .03em; white-space: nowrap;
  vertical-align: baseline;
}
.lib-badge-source, .lib-badge-converted {
  background: rgba(142, 92, 247, .12); color: #6D3FD4; border: 1px solid rgba(142, 92, 247, .42);
}

/* Muted grey + green variants of the admin .badge (sign column, audit card). */
.badge.grey { background: #EEF1F4; color: var(--muted); border-color: #DDE4EA; }
.badge.green { background: rgba(90, 168, 39, .12); color: #4A8A1F; border-color: rgba(90, 168, 39, .4); }

/* Atlas view-time normalisation toggle. */
.lib-atlas-opts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 .9rem; }
.lib-atlas-norm { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; cursor: pointer; }
.lib-atlas-norm input { margin: 0; }

/* Caption under the comparator chart (view-time normalisation note). */
.lib-cmp-note { margin: .6rem 0 0; }

/* Sign converter card (library-benchmarks.php) — same card grammar as .lib-compare. */
.lib-signconv { margin-bottom: 1.8rem; border-top: 4px solid #8E5CF7; }
.lib-signconv-title { font-size: 1.3rem; margin-bottom: .3rem; }
.lib-signconv-form {
  display: grid; gap: 14px; align-items: end; grid-template-columns: 1fr;
  margin-top: 1rem;
}
@media (min-width: 700px) { .lib-signconv-form { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .lib-signconv-form { grid-template-columns: 1fr 1fr auto; } }
.lib-signconv-form .field { margin-bottom: 0; }
.lib-signconv-result { margin-top: 1.1rem; }
.lib-signconv-line { font-size: 1.05rem; margin: 0 0 .4rem; }
.lib-signconv-num { color: #6D3FD4; }
.lib-signconv-table {
  width: 100%; max-width: 560px; margin-top: 1.1rem; border-collapse: collapse;
  font-size: .9rem; background: var(--paper);
}
.lib-signconv-table th, .lib-signconv-table td {
  text-align: left; padding: .5rem .8rem; border: 1px solid var(--line);
}
.lib-signconv-table thead th {
  background: var(--mist); color: var(--navy-700); font-size: .78rem;
  letter-spacing: .05em; text-transform: uppercase;
}

/* Review queue: CSP-safe SVG progress bar (width set via SVG attributes). */
.review-progress { display: block; width: 100%; max-width: 560px; height: 10px; }
.review-progress-track { fill: var(--mist); }
.review-progress-fill { fill: #5AA827; }
details.card summary { cursor: pointer; }

/* ---------- Admin: PDF upload progress + spinner (Flux Library) ----------
   Same look as the batch-extraction bar (which is styled via CSSOM); these
   classes serve the XHR upload panel rendered by admin/library-papers.php. */
.adm-progress { margin: 1rem 0 .4rem; }
.adm-progress-track {
  width: 100%; max-width: 480px; height: 10px;
  background: #e6edf3; border-radius: 6px; overflow: hidden;
}
.adm-progress-bar {
  height: 100%; width: 0; background: #1b7fbe; transition: width .3s ease;
}
/* Light-background sibling of .lib-spinner (reuses the lib-spin keyframes). */
.adm-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 3px solid rgba(27, 127, 190, .22); border-top-color: var(--blue);
  border-radius: 50%; animation: lib-spin .8s linear infinite;
  vertical-align: -3px; margin-right: .45rem;
}

/* ---------- Library member accounts (register / login / account bar) ---------- */

/* Account strip on the Library landing page (dark, sits above the stats). */
.lib-account-bar {
  background: linear-gradient(120deg, var(--navy-900) 0%, var(--navy-800) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  padding: .7rem 0;
}
.lib-account-row {
  display: flex; gap: .7rem; align-items: center; justify-content: flex-end;
  flex-wrap: wrap; margin: 0; color: rgba(255, 255, 255, .85); font-size: .95rem;
}
.lib-account-row a:not(.btn) { color: var(--cyan); }
.lib-account-label { font-weight: 700; letter-spacing: .05em; color: rgba(255, 255, 255, .6); }

/* Members-only notice shown below the three sub-library cards. */
.lib-member-note {
  margin-top: 1.4rem; padding: .95rem 1.2rem; border-radius: var(--radius-sm);
  background: #fff8f2; border: 1px solid #f5d3b3; color: var(--navy-700);
}
.lib-member-note a { color: var(--orange-dark); font-weight: 700; }

/* Locked placeholder replacing the Ask form for signed-out visitors. */
.lib-locked { color: rgba(255, 255, 255, .88); }
.lib-locked p { margin: 0 0 .9rem; }
.lib-locked p:last-child { margin-bottom: 0; }
.lib-locked .lib-locked-title { font-weight: 800; color: #fff; font-size: 1.05rem; }

/* Registration success card (green tick). */
.lib-success-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(90, 168, 39, .15); color: #4A8A1F;
  font-size: 1.8rem; font-weight: 800; margin-bottom: 1rem;
}

/* Small-print link row under auth forms. */
.lib-auth-foot { text-align: center; margin-top: 1rem; }
.lib-auth-foot.small-print { font-size: .82rem; color: var(--muted); }

/* ---------- Admin: Library Users page ---------- */

.lib-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.lib-tabs a {
  padding: .45rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; color: var(--navy-700); font-weight: 600; font-size: .92rem;
  text-decoration: none;
}
.lib-tabs a:hover { border-color: var(--blue); color: var(--blue); }
.lib-tabs a.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.lib-tabs .pill-count { margin-left: .3rem; }

.badge.red { background: #fdeeea; color: #a33c12; border-color: #f5c9b8; }
.user-note-form input[type="text"] {
  padding: .4rem .7rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: .88rem; width: 100%; max-width: 240px;
}
.form-narrow-center { margin-left: auto; margin-right: auto; }

/* ---------- Language switcher (EN | 中文) ---------- */

/* Public header: subtle outlined pill inside the main nav; in the mobile
   dropdown it becomes a full-width row so it stays reachable. */
.site-nav a.lang-switch {
  margin-left: .35rem;
  border: 1px solid rgba(255, 255, 255, .38);
  font-weight: 600;
  color: #fff;
}
.site-nav a.lang-switch:hover {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .65);
  text-decoration: none;
}
@media (max-width: 960px) {
  .site-nav a.lang-switch {
    margin: .45rem 0 0;
    text-align: center;
    border-color: rgba(255, 255, 255, .3);
  }
}

/* Admin topbar: light-theme pill on the right side. */
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.admin-topbar-right { flex: 0 0 auto; }
.admin-topbar a.lang-switch {
  display: inline-block; padding: .35rem .95rem; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff;
  font-size: .88rem; font-weight: 600; color: var(--navy-700);
}
.admin-topbar a.lang-switch:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
