/* Shared, JavaScript-independent layout for GemFit docs and utility pages. */
:root {
  color-scheme: light;
  --bg: #f6f4f0; --panel: #fff; --text: #16181d; --muted: #49505e;
  --line: #dcd8d0; --accent: #b6380c; --accent-soft: #fff0e6;
  --code-bg: #17191e; --code-text: #edf0f5;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0f; --panel: #1a1b1f; --text: #f5f6f8; --muted: #b6bbc5;
  --line: #383a42; --accent: #ff8a4c; --accent-soft: #302018;
  --code-bg: #101116; --code-text: #edf0f5;
}
.gfd-page, .gfd-page * { box-sizing: border-box; }
.gfd-page { margin: 0; color: var(--text); background: var(--bg); font-family: Inter,ui-sans-serif,system-ui,-apple-system,sans-serif; line-height: 1.65; }
.gfd-page a { color: var(--accent); overflow-wrap: anywhere; text-underline-offset: 3px; }
.gfd-page :is(a,button,summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.gfd-page .gfd-skip { position: fixed; left: 16px; top: -100px; padding: 12px 20px; background: var(--panel); z-index: 100; }
.gfd-page .gfd-skip:focus { top: 8px; }
.gfd-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.gfd-header-inner { width: min(1240px,calc(100% - 40px)); min-height: 70px; margin: auto; display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.gfd-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text) !important; text-decoration: none; white-space: nowrap; font-size: 19px; font-weight: 750; letter-spacing: -.035em; }
.gfd-brand img { width: 38px; height: 42px; object-fit: contain; }
.gfd-desktop-nav { display: flex; align-items: center; gap: 24px; margin: auto; }
.gfd-desktop-nav a { display: flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--muted); }
.gfd-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.gfd-theme, .gfd-connect { min-height: 44px; border: 1px solid var(--line); padding: 10px 15px; border-radius: 24px; font: 600 13px/1.4 Inter,system-ui,sans-serif; cursor: pointer; color: var(--text); background: var(--panel); }
.gfd-connect { display: inline-flex; align-items: center; background: #ff6a20; color: #16100a !important; text-decoration: none; border-color: transparent; }
.gfd-theme[hidden] { display: none; }
.gfd-menu { display: none; }
.gfd-page main { width: min(1040px,calc(100% - 40px)); margin: auto; padding: 52px 0 72px; min-width: 0; }
.gfd-page h1 { margin: 0 0 22px; font-size: clamp(36px,5vw,68px); line-height: 1.04; letter-spacing: -.045em; max-width: 20ch; font-weight: 650; text-wrap: balance; }
.gfd-page h2 { margin: 36px 0 14px; font-size: 24px; line-height: 1.25; letter-spacing: -.025em; scroll-margin-top: 24px; }
.gfd-page h3 { margin: 25px 0 10px; font-size: 18px; color: var(--text); }
.gfd-page :is(p,li) { color: var(--muted); font-size: 16px; overflow-wrap: anywhere; }
.gfd-page p { margin: 0 0 18px; max-width: 78ch; }
.gfd-page ul, .gfd-page ol { padding-left: 22px; min-width: 0; }
.gfd-page li + li { margin-top: 10px; }
.gfd-page .kicker { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 15px; }
.gfd-page .hero { margin-bottom: 32px; }
.gfd-page .lead { font-size: 18px; line-height: 1.65; }
.gfd-page :is(.panel,.card) { margin-top: 28px; padding: 28px; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; min-width: 0; max-width: 100%; }
.gfd-page :is(.panel,.card) > h2:first-child { margin-top: 0; }
.gfd-page .grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; align-items: start; }
.gfd-page .grid .card { margin: 0; }
.gfd-page code, .gfd-page pre { font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 13px; }
.gfd-page code { overflow-wrap: anywhere; color: var(--accent); background: var(--accent-soft); padding: 2px 4px; border-radius: 4px; }
.gfd-page pre { margin: 14px 0 22px; padding: 16px; color: var(--code-text); background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: auto; max-width: 100%; line-height: 1.7; }
.gfd-page .pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.gfd-page .pill { padding: 5px 10px; font-size: 12px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line); border-radius: 20px; }
.gfd-page .warn { color: var(--muted); border-left: 3px solid var(--accent); padding-left: 14px; }
.gfd-page .accent { color: var(--accent); }
.gfd-page .footer, .gfd-footer { border-top: 1px solid var(--line); margin-top: 38px; padding-top: 22px; color: var(--muted); font-size: 14px; }
.gfd-footer { width: min(1040px,calc(100% - 40px)); margin: 0 auto; padding: 24px 0 40px; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.gfd-footer a { display: inline-flex; min-height: 44px; align-items: center; }
.gfd-page .legal-body { max-width: 80ch; }
.gfd-page .button-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 30px; }
.gfd-page .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); font-weight: 600; font-size: 14px; text-decoration: none; }
.gfd-page .button.primary { background: #ff6a20; color: #16100a; border-color: transparent; }
@media (max-width: 1000px) {
  .gfd-desktop-nav { gap: 16px; }
  .gfd-header-inner { gap: 16px; }
}
@media (max-width: 840px) {
  .gfd-desktop-nav { display: none; }
  .gfd-menu { display: block; margin: 0 0 12px; width: 100%; }
  .gfd-menu summary { min-height: 44px; cursor: pointer; font-weight: 600; font-size: 14px; padding: 10px 0; }
  .gfd-menu nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 20px; border-top: 1px solid var(--line); padding-block: 10px; }
  .gfd-menu a { display: flex; align-items: center; min-height: 44px; padding: 8px 0; font-size: 14px; text-decoration: none; color: var(--text); }
  .gfd-header-inner { padding-top: 12px; gap: 6px 12px; }
  .gfd-page .grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .gfd-page main { padding-top: 34px; }
  .gfd-page :is(.panel,.card) { padding: 20px; }
  .gfd-brand { font-size: 17px; gap: 6px; }
  .gfd-brand img { width: 30px; height: 36px; }
  .gfd-actions { gap: 6px; }
  .gfd-theme, .gfd-connect { font-size: 12px; padding-inline: 10px; }
}
