/* Self-hosted fonts; OFL licenses in /fonts. */
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/publicsans.woff2?v=c1b6da516e) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/publicsans.woff2?v=c1b6da516e) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/publicsans.woff2?v=c1b6da516e) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/publicsans.woff2?v=c1b6da516e) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Site shell (2026-10-28 redesign): the same top bar and footer on every page, generator, chart and text pages alike.
   White bar, one accent, the current page marked; labels never change with the screen width (phones scroll the links sideways). */
@media screen {
  :root{--shell-ink:#0f1c24;--shell-muted:#5d6b73;--shell-line:#e3e8ec;--shell-accent:#0378b8;--shell-accent-l:#e6f3fb}
  body{font-family:'Public Sans',system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;padding-bottom:0!important}
  .top{position:relative;z-index:25;background:#fff;color:var(--shell-ink);border-bottom:1px solid var(--shell-line);padding:0 32px}
  .nav{position:relative;max-width:1336px;margin:auto;min-height:64px;display:flex;align-items:center;gap:12px}
  .logo{display:inline-flex;align-items:center;font-weight:700;font-size:21px;letter-spacing:-.03em;line-height:44px;text-decoration:none;color:var(--shell-ink);white-space:nowrap}
  .logo::before{content:"";width:26px;height:26px;margin-right:9px;flex:none;border-radius:7px;background:url(/favicon.svg?v=a18b823c20) center/contain no-repeat}
  .logo span{color:var(--shell-accent)}
  .nav nav{display:flex;gap:4px;margin-left:auto}
  .nav nav a{color:var(--shell-muted);text-decoration:none;font-size:15px;font-weight:500;line-height:40px;min-height:40px;padding:0 12px;border-radius:8px;display:inline-block;white-space:nowrap}
  .nav nav a:hover{color:var(--shell-ink);background:#f3f6f7}
  .nav nav a[aria-current]{color:var(--shell-accent);background:var(--shell-accent-l);font-weight:600}
  /* the other language: a plain link at the end of the bar (never an automatic redirect) */
  .nav .lang{display:inline-flex;align-items:center;min-height:36px;padding:0 12px;margin-left:8px;border:1px solid var(--shell-line);border-radius:99px;color:var(--shell-ink);font-size:14px;text-decoration:none;white-space:nowrap}
  .nav .lang:hover{border-color:var(--shell-accent);color:var(--shell-accent)}
  .footer{max-width:1400px;margin:0 auto;padding:28px 32px 44px;border-top:1px solid var(--shell-line);color:var(--shell-muted);font-size:14px;line-height:1.55;display:flex;flex-wrap:wrap;gap:6px 22px;align-items:center}
  .footer>*{min-width:0}
  .footer a{color:var(--shell-ink);text-decoration:none;min-height:40px;display:inline-flex;align-items:center}
  .footer a:hover{color:var(--shell-accent);text-decoration:underline}
  .footer .grow{flex:1 1 100%;max-width:90ch;margin-bottom:6px}
  .footer .usage-toggle{color:var(--shell-muted)!important}
  .footer .tw-xlinks a{color:var(--shell-accent)}
  @media (max-width:760px){
    .top{padding:0 16px}
    .nav{flex-wrap:wrap;min-height:0;gap:0;padding-top:6px}
    .logo{margin-right:auto}
    .nav .lang{order:2;margin-left:0}
    .nav nav{order:3;flex:0 0 calc(100% + 32px);margin:2px -16px 0;padding:0 12px 8px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
    .nav nav::-webkit-scrollbar{display:none}
    .nav nav a{flex:none;font-size:14px;padding:0 12px}
    .footer{padding:24px 16px 36px;gap:2px 18px}
  }
}

/* /zh/: system Chinese fonts after Public Sans, and the note on document text */
@media screen {
  html[lang|=zh] body{font-family:'Public Sans','PingFang SC','Hiragino Sans GB','Microsoft YaHei','Noto Sans CJK SC','Source Han Sans SC',sans-serif}
  html[lang|=zh] .en-tag{font-size:.85em;color:var(--muted)}
  .intro .zh-note{font-size:14px;line-height:1.6;color:var(--ink2);background:#fff;border:1px solid var(--line);border-radius:10px;padding:10px 14px;margin:16px 0 0;max-width:78ch}
  .intro .zh-note b{color:var(--teal-d)}
}
/* six header links (2026-10-29): between phone and wide screens they scroll sideways instead of overflowing */
@media screen and (min-width:761px) and (max-width:1140px){.nav nav{min-width:0;overflow-x:auto;scrollbar-width:none}.nav nav::-webkit-scrollbar{display:none}.nav nav a{flex:none;padding:0 9px;font-size:14px}}
/* account (2026-10-29): Sign in, then a round initial with a menu, at the end of the bar. The button stays hidden
   until the shared account script has loaded; the header menu script reveals and drives it. */
@media screen {
  .nav .account-wrap{position:relative;flex:none;margin-left:8px}
  .nav .account-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:0 16px;border:1px solid var(--shell-accent);border-radius:99px;background:var(--shell-accent);color:#fff;font-weight:600;font-size:14px;line-height:1;font-family:inherit;white-space:nowrap;cursor:pointer}
  .nav .account-btn[hidden]{display:none}
  .nav .account-btn:not(.is-member):hover{background:#0a5f93;border-color:#0a5f93}
  .nav .account-btn:focus-visible{outline:3px solid #7cc4ea;outline-offset:2px}
  .nav .account-btn.is-member{min-height:40px;padding:0 4px 0 2px;border-color:transparent;background:transparent;color:var(--shell-ink)}
  .nav .account-btn.is-member:hover,.nav .account-btn[aria-expanded=true]{background:#f3f6f7}
  .account-avatar,.account-menu-avatar{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;background:var(--shell-accent);color:#fff;font-weight:600;font-size:15px;line-height:1;font-family:inherit;flex:none}
  .account-avatar svg,.account-menu-avatar svg{width:19px;height:19px}
  .account-chevron{display:inline-flex;color:var(--shell-muted)}
  .account-chevron svg{width:16px;height:16px;transition:transform .15s}
  .account-btn[aria-expanded=true] .account-chevron svg{transform:rotate(180deg)}
  .account-menu{position:absolute;right:0;top:calc(100% + 10px);z-index:60;width:min(300px,calc(100vw - 32px));padding:8px;border:1px solid var(--shell-line);border-radius:14px;background:#fff;box-shadow:0 14px 40px -12px #0f1c2440;color:var(--shell-ink);font-size:14px;line-height:1.5}
  .account-menu[hidden]{display:none}
  .account-summary{display:flex;align-items:center;gap:12px;padding:12px 10px}
  .account-summary>div{min-width:0}
  .account-summary strong{display:block;font-size:15px;font-weight:600}
  .account-email{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--shell-muted);font-size:13px}
  .account-plan{display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin:0 8px 6px;padding:10px 0;border-top:1px solid var(--shell-line);border-bottom:1px solid var(--shell-line)}
  .account-plan span{padding:2px 8px;border-radius:6px;background:var(--shell-accent-l);color:#0a5f93;font-size:12px;font-weight:600}
  .account-plan small{color:var(--shell-muted);font-size:12.5px}
  .account-menu button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:44px;padding:10px 12px;border:0;border-radius:8px;background:#fff;color:var(--shell-ink);font-weight:500;font-size:14px;line-height:1.4;font-family:inherit;text-align:left;cursor:pointer}
  .account-menu button:hover,.account-menu button:focus-visible{background:#f3f6f7}
  .account-menu button svg{width:18px;height:18px;color:var(--shell-muted)}
  @media (max-width:760px){.nav .account-wrap{order:2}}
}
