/* FJAI_LEGACY_SHELL_V2 */
html[data-site-shell="fjai-v2"] {
  --parchment: #f5f4ed;
  --ivory: #faf9f5;
  --paper: #ffffff;
  --ink: #141413;
  --charcoal: #242422;
  --muted: #66655f;
  --stone: #8a8982;
  --line: #dcdad0;
  --line-dark: #b9b7ad;
  --terracotta: #c96442;
  --coral: #d97757;
  --sage: #687154;
  --steel: #52676e;
  --soft-sage: #e6eadf;
  --soft-steel: #e5edef;
  --wide: 1240px;
  --reading: 760px;
  --radius: 4px;
  scroll-behavior: smooth;
}

html[data-site-shell="fjai-v2"] body.fjai-legacy-page {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}

body.fjai-legacy-page.fjai-menu-open { overflow: hidden; }
body.fjai-legacy-page *, body.fjai-legacy-page *::before, body.fjai-legacy-page *::after { box-sizing: border-box; }
body.fjai-legacy-page img, body.fjai-legacy-page video, body.fjai-legacy-page canvas { max-width: 100%; }
body.fjai-legacy-page h1,
body.fjai-legacy-page h2,
body.fjai-legacy-page h3 {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: 0 !important;
  overflow-wrap: anywhere;
}
body.fjai-legacy-page h1 { font-size: 56px !important; line-height: 1.04; }
body.fjai-legacy-page h2 { font-size: 34px !important; line-height: 1.14; }
body.fjai-legacy-page h3 { font-size: 23px !important; line-height: 1.2; }
body.fjai-legacy-page a { overflow-wrap: anywhere; }
body.fjai-legacy-page :is(p, li, dd, dt, td, th) { overflow-wrap: anywhere; word-break: break-word; }
body.fjai-legacy-page :is(pre, code) { max-width: 100%; overflow-x: auto; }
body.fjai-legacy-page ::selection { background: var(--terracotta); color: var(--paper); }

body.fjai-legacy-page > header.nav,
body.fjai-legacy-page > header.site-nav,
body.fjai-legacy-page > header.topbar,
body.fjai-legacy-page > header.report-header,
body.fjai-legacy-page > nav,
body.fjai-legacy-page > footer:not(.fjai-shell-footer) { display: none !important; }
body.fjai-legacy-page > header:not(.fjai-shell-header) nav,
body.fjai-legacy-page > header:not(.fjai-shell-header) .brand { display: none !important; }

.fjai-shell-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 1000;
  width: 100%;
  background: rgba(245, 244, 237, 0.94);
  border-bottom: 1px solid rgba(20, 20, 19, 0.14);
  backdrop-filter: blur(18px);
}
.fjai-shell-site { width: min(var(--wide), calc(100% - 64px)); margin-inline: auto; }
.fjai-shell-inner { min-height: 76px; display: flex; align-items: center; gap: 30px; }
.fjai-shell-brand { display: inline-flex; align-items: baseline; gap: 10px; flex: 0 0 auto; color: var(--ink) !important; text-decoration: none !important; }
.fjai-shell-brand-word { font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 600; line-height: 1; }
.fjai-shell-brand-note { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; text-transform: uppercase; }
.fjai-shell-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.fjai-shell-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  padding: 4px 11px;
  color: var(--muted) !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
}
.fjai-shell-nav a:hover,
.fjai-shell-nav a[aria-current="page"] { color: var(--ink) !important; border-color: var(--ink); }
.fjai-shell-status { display: flex; align-items: center; gap: 8px; margin-left: 8px; color: var(--sage); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; text-transform: uppercase; white-space: nowrap; }
.fjai-shell-status::before { content: ""; width: 6px; height: 6px; background: var(--sage); border-radius: 50%; }
.fjai-shell-toggle { display: none; width: 42px; height: 42px; margin-left: auto; padding: 0; border: 1px solid var(--line-dark); border-radius: 0; background: transparent; color: var(--ink); font: inherit; }
.fjai-shell-toggle span { display: block; width: 17px; height: 1px; margin: 4px auto; background: currentColor; transition: transform 180ms ease, opacity 180ms ease; }
.fjai-shell-toggle[aria-expanded="true"] span:first-child { transform: translateY(5px) rotate(45deg); }
.fjai-shell-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.fjai-shell-toggle[aria-expanded="true"] span:last-child { transform: translateY(-5px) rotate(-45deg); }

body.fjai-legacy-page :is(.card, .paper-card, .summary, .note, .source-card, .panel, .callout, .metric, .stat, .result-card) {
  border-radius: var(--radius) !important;
  box-shadow: none !important;
}
body.fjai-legacy-page :is(.button, .btn, button, input, select, textarea) { border-radius: var(--radius) !important; }
body.fjai-legacy-page :is(.pill, .chip, .tag, .badge, .score span, .meta span) { border-radius: 2px !important; }
body.fjai-legacy-page :is(.button, .btn):hover { transform: translateY(-1px); }
body.fjai-legacy-page :focus-visible { outline: 2px solid var(--terracotta); outline-offset: 3px; }
body.fjai-legacy-page table { border-collapse: collapse; }
body.fjai-legacy-page th, body.fjai-legacy-page td { border-color: var(--line-dark); }

.fjai-shell-footer { margin: 72px 0 0; background: var(--charcoal); color: var(--paper); }
.fjai-shell-footer-main { min-height: 230px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 60px; align-items: end; padding-block: 50px; }
.fjai-shell-footer-brand { font-family: Georgia, "Times New Roman", serif; font-size: 44px; line-height: 1; }
.fjai-shell-footer-copy { max-width: 500px; margin: 17px 0 0; color: #aaa9a2; }
.fjai-shell-footer-links { display: grid; grid-template-columns: repeat(2, auto); gap: 9px 28px; }
.fjai-shell-footer-links a { color: var(--paper) !important; font-size: 13px; text-decoration: none !important; }
.fjai-shell-footer-links a:hover { color: var(--coral) !important; }
.fjai-shell-footer-base { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid #44443f; padding-block: 18px 28px; color: #878780; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; text-transform: uppercase; }

@media (max-width: 900px) {
  .fjai-shell-site { width: min(100% - 40px, var(--wide)); }
  .fjai-shell-status { display: none; }
}

@media (max-width: 760px) {
  .fjai-shell-site { width: min(100% - 32px, var(--wide)); }
  .fjai-shell-inner { min-height: 66px; }
  .fjai-shell-brand-note { display: none; }
  .fjai-shell-toggle { display: block; }
  .fjai-shell-nav { position: fixed; inset: 66px 0 0; z-index: 1001; display: none; align-content: start; margin: 0; padding: 28px 16px; background: var(--parchment); border-top: 1px solid var(--line); overflow-y: auto; }
  .fjai-shell-nav[data-open="true"] { display: grid; }
  .fjai-shell-nav a { min-height: 56px; border-bottom: 1px solid var(--line); padding-inline: 0; color: var(--ink) !important; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; }
  body.fjai-legacy-page h1 { font-size: 40px !important; }
  body.fjai-legacy-page h2 { font-size: 29px !important; }
  body.fjai-legacy-page h3 { font-size: 21px !important; }
  .fjai-shell-footer-main { min-height: 0; grid-template-columns: 1fr; align-items: start; }
  .fjai-shell-footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fjai-shell-footer-base { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-site-shell="fjai-v2"] { scroll-behavior: auto; }
  body.fjai-legacy-page *, body.fjai-legacy-page *::before, body.fjai-legacy-page *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
