/* Public site palette. Identity boards and source artwork retain their colors. */
:root, html[data-theme="dark"] {
  --bg:#241713; --panel:#30211b; --panel-raised:#3b2a22;
  --ink:#fff1df; --muted:#c9ad96; --line:#654a3a;
  --cyan:#ffe873; --blue:#ffe873;
  --qiaohetao-action:#ffe873; --qiaohetao-on-action:#241713;
  --theme-soft:#35251d; --theme-tint:#3a291d;
  --theme-accent-line:#b98b61; --theme-control-line:#b98b61;
  --theme-shadow:0 6px 20px #160c0712;
}
html[data-theme="light"] {
  --bg:#fdf5e8; --panel:#fffaf2; --panel-raised:#fff3be;
  --ink:#482b1e; --muted:#73584a; --line:#dac5ad;
  --cyan:#b44b29; --blue:#b44b29;
  --qiaohetao-action:#482b1e; --qiaohetao-on-action:#fdf5e8;
  --theme-soft:#fff3be; --theme-tint:#fff3be;
  --theme-accent-line:#a26c43; --theme-control-line:#987052;
  --theme-shadow:0 6px 20px #38241f0a;
}
html body, html .vis-page { background:var(--bg); color:var(--ink); }
html ::selection { background:#ffe873; color:#241713; }
html :focus-visible { outline:2px solid var(--cyan); outline-offset:4px; }
html .site-header { height:80px; padding-top:12px; }
html .site-header .nav-shell {
  height:60px; gap:28px; border-color:var(--line); background:var(--panel);
  border-radius:12px; box-shadow:0 3px 12px #24171308; backdrop-filter:none;
}
html .site-header .brand span, html .site-footer .brand span { color:var(--ink); font-size:21px; letter-spacing:.01em; }
html .site-header .brand img { width:32px; height:32px; border-radius:0; }
html .desktop-nav a { color:var(--muted); min-height:44px; display:flex; align-items:center; }
html .desktop-nav a:hover, html .desktop-nav .nav-active { background:var(--theme-soft); color:var(--ink); }
html .site-header :is(.nav-cta,.menu-toggle), html .site-header :is(.langup-language-select,.langup-theme-toggle) {
  min-height:44px; border-color:var(--line); background:var(--panel); color:var(--ink);
}
html .site-header .nav-cta:hover { background:var(--theme-soft); }
html .site-header .langup-theme-toggle { width:44px; height:44px; }
html .site-header .mobile-menu { background:var(--panel); border-color:var(--line); box-shadow:var(--theme-shadow); }
html .mobile-menu a { color:var(--ink); min-height:44px; }
html .homepage .vision-hero {
  min-height:0; max-width:none;
  grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr);
  margin-top:12px; padding:48px clamp(20px,4vw,48px); gap:clamp(28px,3vw,44px);
  border-radius:16px;
}
html .vision-hero h1 { font-size:clamp(46px,5.2vw,72px); line-height:1.15; margin:12px 0 16px; white-space:normal; letter-spacing:.025em; }
html .vision-hero .eyebrow { color:var(--muted); letter-spacing:.2em; }
html .qiaohetao-tagline { color:var(--cyan); font-size:clamp(20px,2.2vw,28px); line-height:1.5; text-wrap:balance; margin:0 0 26px; }
html .vision-statements { margin:22px 0; gap:12px; }
html .vision-statements > div { grid-template-columns:4.4em minmax(0,1fr); }
html .vision-values { grid-template-columns:repeat(auto-fit,minmax(min(100%,12em),1fr)); gap:10px 32px; }
html .vis-hero {
  grid-template-columns:minmax(0,1fr) minmax(0,1.03fr);
  margin-top:12px; padding:44px clamp(20px,4vw,48px) 40px;
  gap:clamp(28px,3vw,44px); border-radius:16px;
}
html .vis-hero > * { min-width:0; }
html .vis-hero :is(.vis-hero-lead,.vis-hero-description), html .vision-values, html .sketch-figure figcaption { color:var(--muted); }
html .identity-cover { width:100%; transform:none; background:var(--panel); border-color:var(--line); box-shadow:none; }
html .identity-cover .cover-logo { height:auto; object-fit:contain; }
html .identity-cover :is(.cover-topline,.cover-bottom) { color:var(--muted); }
html .site-footer { border-color:var(--line); color:var(--muted); }
html .homepage .site-footer > p { color:var(--muted); }
html .subtle-button { color:var(--ink); border-color:var(--line); background:var(--panel); }
html .button-primary { background:var(--qiaohetao-action); color:var(--qiaohetao-on-action); border-color:var(--qiaohetao-action); box-shadow:none; }
html .brand-slogan { margin:14px 0 0; padding-top:12px; border-top:1px solid var(--line); }
html .brand-slogan-title { font-size:15px; color:var(--ink); }
html .brand-slogan-note { font-size:12px; color:var(--muted); }
@media(max-width:960px) {
  html .site-header { height:76px; }
  html .site-header .nav-shell { width:calc(100% - 32px); gap:12px; padding:0 12px; }
  html .site-header .brand img { width:28px; height:28px; }
  html .site-header .brand span { font-size:19px; }
  html .site-header .nav-right { margin-left:auto; }
  html .site-header .mobile-menu { max-height:calc(100dvh - 92px); overflow-y:auto; }
  html .mobile-menu .website-preferences { display:flex; padding:12px 4px 4px; border-top:1px solid var(--line); gap:12px; }
  html .mobile-menu .langup-language-select { flex:1; width:auto; }
  html .research-app .mobile-reading .reader-toolbar { top:76px; }
  html .homepage .vision-hero { grid-template-columns:minmax(0,1fr); padding-top:32px; padding-bottom:32px; gap:28px; }
  html .vis-hero { grid-template-columns:minmax(0,1fr); padding-block:32px; gap:28px; }
}
@media(max-width:480px) {
  html .site-header .nav-shell { width:calc(100% - 24px); gap:8px; padding:0 8px; }
  html .site-header .brand { gap:5px; }
  html .site-header .brand span { font-size:18px; }
  html .site-header .nav-cta { padding:6px 8px; gap:5px; }
  html .site-header .menu-toggle { padding:0 8px; gap:5px; }
  html .vision-values { grid-template-columns:1fr; }
  html .vision-statements > div { grid-template-columns:minmax(0,1fr); gap:4px; }
  html .vision-hero h1 { font-size:48px; }
  html .qiaohetao-tagline { font-size:22px; }
}
/* Match the theme layer's specificity without changing candidate specimens. */
html[data-theme] .site-header .desktop-nav a { color:var(--muted); }
html[data-theme] .site-header .desktop-nav :is(a:hover,.nav-active) { color:var(--ink); background:var(--theme-soft); }
html[data-theme] .site-header .account-trigger { color:var(--ink); background:var(--panel); border-color:var(--line); min-height:44px; }
html[data-theme] :is(.sketch-action,.subtle-button) { color:var(--ink); background:var(--panel); border-color:var(--line); }
html[data-theme] .identity-cover { background:var(--panel); border-color:var(--line); box-shadow:none; }
html[data-theme] .research-app {
  --bg:#fdf5e8; --paper:#fffaf2; --ink:#482b1e; --body:#61483c; --muted:#73584a;
  --line:#dac5ad; --accent:#b44b29; --soft:#fff3be; --raised:#fff3be; --selected:#fff3be;
  --shadow:none;
}
html[data-theme="dark"] .research-app {
  --bg:#241713; --paper:#30211b; --ink:#fff1df; --body:#e4c8b0; --muted:#c9ad96;
  --line:#654a3a; --accent:#ffe873; --soft:#3a291d; --raised:#3b2a22; --selected:#483223;
}
html[data-theme] .vis-page { background:var(--bg); }
html[data-theme] .vis-hero h1 span { color:var(--cyan); }
html[data-theme] .vis-hero .hero-actions .button-primary { background:var(--qiaohetao-action); border-color:var(--qiaohetao-action); color:var(--qiaohetao-on-action); box-shadow:none; }
html[data-theme] .vis-hero .hero-actions .button-quiet { background:transparent; color:var(--muted); }
html[data-theme] .site-header .brand span { display:inline; }
html[data-theme] .vis-hero { min-height:0; }

/* Public lockup is separate from the historical VIS and ballot artwork. */
html :is(.site-header,.site-footer) .brand img.site-brand-lockup {
  width:124px; height:auto; object-fit:contain; border-radius:0; flex:none;
}
html .site-brand-lockup + [data-site-brand-name] {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0;
}
html .site-brand-lockup,
html .login-card img[src$="/qiaohetao-approved-symbol.svg"] {
  filter:none;
}
html[data-theme="light"] .site-brand-lockup,
html[data-theme="light"] .login-card img[src$="/qiaohetao-approved-symbol.svg"] {
  filter:none;
}
@media(max-width:960px) {
  html .site-header .brand img.site-brand-lockup { width:120px; height:auto; }
}

html[data-theme="light"] :is(.vision-hero,.vis-hero) {
  background:#ffe873; --cyan:#682413;
}

html :is(.site-header,.site-footer) .brand img.site-brand-lockup {
  content:url("assets/qiaohetao-nav-transparent-dark.svg");
}
html[data-theme="light"] :is(.site-header,.site-footer) .brand img.site-brand-lockup {
  content:url("assets/qiaohetao-nav-transparent-light.svg");
}
/* Keep the five-item navigation and account controls inside the header. */
@media (min-width:961px) and (max-width:1100px) {
  html .site-header .nav-shell { width:calc(100% - 32px); gap:12px; padding:0 12px; }
}
