/* TAEF: shared site styles and framework pages. */

:root {
  color-scheme: light;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --surface-3: #eaecf0;
  --surface-inverse: #18181b;

  --text: #18181b;
  --text-2: #52525b;
  --text-3: #6b6b74;
  --text-inverse: #fafafa;

  --border: rgb(24 24 27 / 10%);
  --border-2: rgb(24 24 27 / 17%);
  --border-3: rgb(24 24 27 / 27%);

  --accent: #3b5bdb;
  --accent-hover: #2f4bc0;
  --accent-text: #2c47b8;
  --accent-soft: rgb(59 91 219 / 9%);
  --accent-soft-2: rgb(59 91 219 / 16%);
  --focus: #3b5bdb;

  --success: #22794a;
  --fig-warn: #b4540a;
  --fig-warn-soft: rgb(180 84 10 / 12%);
  --fig-on-accent: #ffffff;

  --code-bg: rgb(24 24 27 / 6%);
  --code-text: #2b2b31;
  --pre-bg: #17181b;
  --pre-text: #e6e6ea;

  --shadow-1: 0 1px 2px rgb(24 24 27 / 4%);
  --shadow-2: 0 1px 2px rgb(24 24 27 / 4%), 0 12px 32px -16px rgb(24 24 27 / 18%);
  --header-bg: rgb(255 255 255 / 82%);

  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius: 8px;
  --radius-lg: 10px;
  --radius-pill: 999px;

  --header-h: 60px;
  --max-width: 1240px;
  --measure: 68ch;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur: 160ms;

}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #15161a;
  --surface: #1c1d22;
  --surface-2: #24262c;
  --surface-3: #2f3138;
  --surface-inverse: #f4f4f5;

  --text: #e9e9ec;
  --text-2: #b4b5bd;
  --text-3: #878890;
  --text-inverse: #18181b;

  --border: rgb(255 255 255 / 11%);
  --border-2: rgb(255 255 255 / 19%);
  --border-3: rgb(255 255 255 / 32%);

  --accent: #7d93ff;
  --accent-hover: #98aaff;
  --accent-text: #aab9ff;
  --accent-soft: rgb(125 147 255 / 13%);
  --accent-soft-2: rgb(125 147 255 / 22%);
  --focus: #98aaff;

  --success: #5cc48a;
  --fig-warn: #f0a35a;
  --fig-warn-soft: rgb(240 163 90 / 16%);
  --fig-on-accent: #15161a;

  --code-bg: rgb(255 255 255 / 8%);
  --code-text: #f3f3f5;
  --pre-bg: #0d0e11;
  --pre-text: #e6e6ea;

  --shadow-1: 0 1px 2px rgb(0 0 0 / 30%);
  --shadow-2: 0 1px 2px rgb(0 0 0 / 30%), 0 16px 40px -20px rgb(0 0 0 / 70%);
  --header-bg: rgb(21 22 26 / 82%);

}

@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #15161a;
    --surface: #1c1d22;
    --surface-2: #24262c;
    --surface-3: #2f3138;
    --surface-inverse: #f4f4f5;

    --text: #e9e9ec;
    --text-2: #b4b5bd;
    --text-3: #878890;
    --text-inverse: #18181b;

    --border: rgb(255 255 255 / 11%);
    --border-2: rgb(255 255 255 / 19%);
    --border-3: rgb(255 255 255 / 32%);

    --accent: #7d93ff;
    --accent-hover: #98aaff;
    --accent-text: #aab9ff;
    --accent-soft: rgb(125 147 255 / 13%);
    --accent-soft-2: rgb(125 147 255 / 22%);
    --focus: #98aaff;

    --success: #5cc48a;
    --fig-warn: #f0a35a;
    --fig-warn-soft: rgb(240 163 90 / 16%);
    --fig-on-accent: #15161a;

    --code-bg: rgb(255 255 255 / 8%);
    --code-text: #f3f3f5;
    --pre-bg: #0d0e11;
    --pre-text: #e6e6ea;

    --shadow-1: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow-2: 0 1px 2px rgb(0 0 0 / 30%), 0 16px 40px -20px rgb(0 0 0 / 70%);
    --header-bg: rgb(21 22 26 / 82%);

  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  font-feature-settings: "palt" 1, "kern" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent-soft-2);
}

a {
  color: var(--accent-text);
  text-decoration: none;
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
  transition: color var(--dur) var(--ease);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

:is(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

img,
svg {
  max-width: 100%;
  vertical-align: middle;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
  font-feature-settings: normal;
}

code {
  padding: 0.1em 0.38em;
  border-radius: var(--radius-xs);
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

pre {
  max-width: 100%;
  margin: 1rem 0;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--pre-bg);
  color: var(--pre-text);
  font-size: 0.84rem;
  line-height: 1.65;
  scrollbar-width: thin;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

h1,
h2,
h3,
h4 {
  margin-top: 0;
  color: var(--text);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: 0;
  font-feature-settings: "palt" 1;
  text-wrap: balance;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem);
}

h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.3rem, 1rem + 1.2vw, 1.75rem);
}

h3 {
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
}

p {
  margin-top: 0;
  text-wrap: pretty;
}

small {
  font-size: 0.82em;
}

.eyebrow {
  display: flex;
  margin-bottom: 0.6rem;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-3);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.external-mark {
  display: inline-block;
  margin-left: 0.2em;
  font-size: 0.72em;
  opacity: 0.7;
  transform: translateY(-0.1em);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

a:hover .external-mark {
  opacity: 1;
  transform: translate(0.08em, -0.18em);
}

.header-inner,
.site-main,
.footer-inner {
  width: min(calc(100% - 3rem), var(--max-width));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 999;
  padding: 0.6rem 0.9rem;
  transform: translateY(-200%);
  border-radius: var(--radius-sm);
  background: var(--surface-inverse);
  color: var(--text-inverse);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-2);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}

.header-inner {
  display: flex;
  height: var(--header-h);
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand-mark,
.footer-brand-mark {
  display: inline-block;
  height: auto;
  border-radius: var(--radius-xs);
  background: #ffffff;
}

.brand-mark {
  display: block;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 3px;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.primary-nav {
  display: flex;
  min-width: 0;
  height: 100%;
  margin-left: 0.5rem;
  align-items: stretch;
  gap: 0.1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.primary-nav::-webkit-scrollbar {
  display: none;
}

.primary-nav a {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  padding: 0 0.7rem;
  align-items: center;
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}

.primary-nav a::before {
  position: absolute;
  inset: 12px 0.15rem;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  content: "";
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  z-index: -1;
}

.primary-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.primary-nav a:hover::before {
  opacity: 1;
}

.primary-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.primary-nav a[aria-current="page"]::after {
  position: absolute;
  right: 0.7rem;
  bottom: -1px;
  left: 0.7rem;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--text);
  content: "";
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  margin-left: auto;
  align-items: center;
  gap: 0.9rem;
}

.icon-button {
  display: inline-flex;
  width: 32px;
  height: 32px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.icon-button:hover {
  background: var(--surface-3);
  color: var(--text);
  text-decoration: none;
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.nav-external {
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.nav-external:hover {
  color: var(--text);
  text-decoration: none;
}

.theme-toggle {
  display: none;
}

.js .theme-toggle {
  display: inline-flex;
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: none;
  }

:root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: block;
  }
}

.site-main {
  min-height: calc(100vh - var(--header-h) - 200px);
  padding-block: 2.25rem 5rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.82rem;
}

.footer-inner {
  display: grid;
  padding-block: 1.4rem 1.6rem;
  gap: 0.3rem;
}

.footer-line {
  margin: 0;
  color: var(--text-3);
  line-height: 1.8;
}

.footer-line strong {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.footer-brand-mark {
  width: 24px;
  margin-right: 0.35rem;
  padding: 2px;
}

.footer-line a {
  color: var(--text-2);
}

.footer-line a:hover {
  color: var(--text);
}

.footer-sep {
  margin: 0 0.5rem;
  color: var(--border-3);
}

.footer-license {
  font-size: 0.78rem;
}

.button {
  display: inline-flex;
  min-height: 36px;
  padding: 0.4rem 0.85rem;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.button:hover {
  border-color: var(--border-3);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.button-primary {
  border-color: transparent;
  background: var(--surface-inverse);
  color: var(--text-inverse);
}

.button-primary:hover {
  border-color: transparent;
  background: var(--text-2);
  color: var(--text-inverse);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.breadcrumbs {
  margin-bottom: 1.5rem;
  color: var(--text-3);
  font-size: 0.8rem;
}

.breadcrumbs ol {
  display: flex;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.45rem;
  list-style: none;
}

.breadcrumbs a {
  color: var(--text-3);
}

.breadcrumbs a:hover {
  color: var(--text);
  text-decoration: none;
}

.breadcrumbs li[aria-current="page"] {
  color: var(--text-2);
  font-weight: 500;
}

.breadcrumbs li:not(:last-child)::after {
  margin-left: 0.45rem;
  color: var(--border-3);
  content: "/";
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

th,
td {
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
  line-height: 1.7;
}

tr:last-child th,
tr:last-child td {
  border-bottom: 0;
}

thead th {
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 0.76rem;
  font-weight: 600;
}

.detail-table {
  table-layout: auto;
  min-width: 44rem;
}

.detail-table th,
.detail-table td {
  padding: 1.05rem 1.75rem 1.05rem 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.93rem;
  font-weight: 400;
  line-height: 1.85;
}

.detail-table th:last-child,
.detail-table td:last-child {
  padding-right: 0;
}

.detail-table tr:last-child th,
.detail-table tr:last-child td {
  border-bottom: 1px solid var(--border);
}

.detail-table thead th {
  padding-top: 0.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-2);
  color: var(--text-3);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  vertical-align: bottom;
}

.detail-table tbody th {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.detail-table tbody th code {
  display: inline-block;
  margin-top: 0;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: normal;
}

.detail-table td {
  color: var(--text);
  overflow-wrap: anywhere;
}

.detail-table td p {
  max-width: 72ch;
}

.detail-table td code {
  font-size: 0.82em;
}

.id-link {
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 0.9em;
  text-decoration: none;
  border-bottom: 1px dotted var(--border-3);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.id-link:hover {
  color: var(--accent-hover);
  border-bottom-color: currentColor;
  text-decoration: none;
}

.step-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  counter-reset: step;
  list-style: none;
}

.step-list li {
  position: relative;
  padding: 0.9rem 0 1rem 3rem;
  border-bottom: 1px solid var(--border);
  counter-increment: step;
}

.step-list li::before {
  position: absolute;
  top: 1.05rem;
  left: 0;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  content: counter(step, decimal-leading-zero);
}

.step-list strong,
.step-list span {
  display: block;
}

.step-list strong {
  font-size: 0.98rem;
  font-weight: 600;
}

.step-list span {
  max-width: var(--measure);
  margin-top: 0.25rem;
  color: var(--text-2);
  font-size: 0.9rem;
}

.fw-page {
  max-width: 74rem;
  word-break: auto-phrase;
}

.fw-masthead {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.fw-kicker {
  margin: 0 0 0.6rem;
  color: var(--text-3);
  font-size: 0.84rem;
  font-weight: 600;
}

.fw-masthead h1 {
  margin-bottom: 1rem;
  font-size: clamp(1.75rem, 1.25rem + 1.6vw, 2.35rem);
  line-height: 1.3;
}

.fw-lead {
  max-width: var(--measure);
  margin: 0;
  color: var(--text-2);
  font-size: 1.04rem;
  line-height: 1.9;
}

.fw-meta {
  display: flex;
  margin: 1.4rem 0 0;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  font-size: 0.84rem;
}

.fw-meta > div {
  display: flex;
  gap: 0.6rem;
}

.fw-meta dt {
  color: var(--text-3);
}

.fw-meta dd {
  margin: 0;
  color: var(--text);
}

.fw-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14rem;
  margin-top: 2.75rem;
  gap: 4rem;
  align-items: start;
}

.fw-main {
  min-width: 0;
}

.fw-main-single {
  margin-top: 2rem;
}

.fw-main > section {
  margin-top: 5rem;
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.fw-main > section:first-child {
  margin-top: 0;
}

.fw-main h2 {
  display: flex;
  margin-bottom: 1.25rem;
  padding-bottom: 0.65rem;
  align-items: baseline;
  gap: 0.8rem;
  border-bottom: 1px solid var(--border);
  font-size: clamp(1.3rem, 1.05rem + 0.8vw, 1.6rem);
}

.fw-step-no {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
}

.fw-main h3 {
  margin: 2.5rem 0 0.8rem;
  font-size: 1.05rem;
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.fw-main p {
  max-width: var(--measure);
  margin: 0 0 1.15rem;
  color: var(--text);
  font-size: 0.97rem;
  line-height: 1.9;
}

.fw-main .fw-note {
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.8;
}

.fw-main .fw-principle {
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.85;
}

.fw-main .table-scroll {
  margin-bottom: 1.5rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  scrollbar-width: thin;
}

.fw-main .detail-table {
  min-width: 0;
}

.fw-main .detail-table thead th,
.fw-main .detail-table code {
  white-space: nowrap;
}

.fw-main .detail-table th[scope="row"] {
  font-weight: 600;
  white-space: nowrap;
}

.fw-main .detail-table th[scope="row"] small {
  white-space: normal;
}

.fw-main .detail-table th small,
.fw-main .detail-table td small {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-3);
  font-size: 0.78rem;
  font-weight: 400;
}

.fw-main .fw-table-narrow {
  width: auto;
  min-width: 24rem;
}

.fw-decisions {
  table-layout: fixed;
}

.fw-decisions th[scope="col"]:first-child {
  width: 8rem;
}

.fw-decisions th[scope="col"]:nth-child(2) {
  width: 32%;
}

.fw-main .step-list {
  margin-bottom: 1.5rem;
}

.fw-main .step-list a {
  color: inherit;
  text-decoration: none;
}

.fw-main .step-list a:hover {
  color: var(--accent-text);
}

.fw-main .fw-step-lead {
  margin-bottom: 0.9rem;
  font-size: 1.02rem;
}

.fw-output {
  max-width: 52rem;
  margin: 1.75rem 0 1.25rem;
  padding: 1rem 1.35rem 0.25rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
}

.fw-main .fw-output-title {
  display: flex;
  margin: 0 0 0.2rem;
  align-items: baseline;
  gap: 0.9rem;
  font-size: 1rem;
  font-weight: 600;
}

.fw-output-title > span {
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 600;
}

.fw-main .fw-output-note {
  margin: 0 0 0.75rem;
  color: var(--text-2);
  font-size: 0.88rem;
}

.fw-output .table-scroll {
  margin-bottom: 0.5rem;
}

.fw-output .detail-table tr:last-child th,
.fw-output .detail-table tr:last-child td {
  border-bottom: 0;
}

.fw-output-list {
  max-width: var(--measure);
  margin: 0 0 0.9rem;
  padding-left: 1.25rem;
}

.fw-output-list li {
  margin: 0 0 0.35rem;
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.8;
}

.fw-output-list li::marker {
  color: var(--text-3);
}

.fw-main .fw-example-sub {
  margin: 1.25rem 0 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
}

.fw-example .fw-record-detail {
  background: var(--surface);
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.fw-example .fw-record-detail > div {
  grid-template-columns: 8rem minmax(0, 1fr);
}

.fw-example .fw-record-detail > div:last-child {
  border-bottom: 0;
}

.fw-example .fw-record-detail {
  border-top: 1px solid var(--border);
}

.fw-code {
  margin: 0 0 1rem;
  border-color: var(--border);
  background: var(--surface);
  color: var(--code-text);
  font-size: 0.8rem;
  line-height: 1.7;
}

.fw-more-body {
  margin: 0.5rem 0 1rem;
}

.fw-main .fw-records td,
.fw-main .fw-compare td {
  font-size: 0.86rem;
}

.fw-main .fw-compare-internal td:nth-child(5),
.fw-main .fw-records-wide td:nth-child(2),
.fw-main .fw-records-wide td:nth-child(3),
.fw-main .fw-sources td:nth-child(3),
.fw-main .fw-models-example td:nth-child(2),
.fw-main .fw-answer td,
.fw-main .fw-models td:nth-child(4),
.fw-main .fw-compare td:nth-child(2),
.fw-main .fw-compare td:nth-child(3),
.fw-main .fw-compare td:nth-child(4),
.fw-main .fw-records td:nth-child(4),
.fw-main .fw-records td:nth-child(5),
.fw-main .fw-third td:nth-child(2),
.fw-main .fw-third td:nth-child(4),
.fw-main .fw-compare-all td:nth-child(2),
.fw-main .fw-compare-all td:nth-child(3),
.fw-main .fw-compare-all td:nth-child(4),
.fw-main .fw-decisions-example td:nth-child(4),
.fw-main .fw-profile-example td:nth-child(2),
.fw-main .fw-profile-example td:nth-child(3),
.fw-main .fw-profile-example td:nth-child(5),
.fw-main .fw-record-weights td:nth-child(2),
.fw-main .fw-record-weights td:nth-child(3) {
  white-space: nowrap;
}

.fw-main .fw-compare-all td {
  font-size: 0.86rem;
}

.fw-main .fw-records-wide td:nth-child(4) {
  white-space: normal;
}

.fw-main .fw-sources small {
  font-size: 0.82rem;
}

.fw-main .fw-sources small a {
  overflow-wrap: anywhere;
}

.fw-main .fw-label {
  margin: 1.75rem 0 0.6rem;
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 600;
}

.fw-actions,
.fw-rule-list {
  max-width: var(--measure);
  margin: 0 0 1.5rem;
  padding-left: 1.5rem;
}

.fw-actions li,
.fw-rule-list li {
  margin: 0 0 0.55rem;
  padding-left: 0.25rem;
  color: var(--text);
  font-size: 0.97rem;
  line-height: 1.85;
}

.fw-actions li::marker,
.fw-rule-list li::marker {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.fw-rule-list strong {
  font-weight: 600;
}

.fw-example {
  max-width: 52rem;
  margin: 1.75rem 0 1.25rem;
  padding: 1.1rem 1.35rem 0.35rem;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.fw-main .fw-example-label {
  margin: 0 0 0.45rem;
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 600;
}

.fw-main .fw-example p {
  margin-bottom: 0.85rem;
  font-size: 0.94rem;
  line-height: 1.85;
}

.fw-example .table-scroll {
  margin-bottom: 0.75rem;
}

.fw-main .fw-example .fw-example-more {
  margin-top: -0.35rem;
  font-size: 0.86rem;
}

.fw-example.fw-example-full {
  margin-top: 0.5rem;
  padding: 0;
  background: transparent;
}

.fw-main .fw-example-back {
  margin: -0.25rem 0 1rem;
  font-size: 0.86rem;
}

.fw-example .detail-table tr:last-child th,
.fw-example .detail-table tr:last-child td {
  border-bottom: 0;
}

.fw-example .fw-deflist {
  margin-bottom: 0.75rem;
}

.fw-example .fw-deflist > div:last-child {
  border-bottom: 0;
}

.fw-more {
  max-width: 52rem;
  margin: 0 0 0.5rem;
}

.fw-main .fw-footnote {
  margin-top: 0.5rem;
}

.fw-fn-ref a {
  text-decoration: none;
}

.fw-more summary {
  display: inline-flex;
  padding: 0.35rem 0;
  align-items: center;
  gap: 0.45rem;
  color: var(--accent-text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.fw-more summary::-webkit-details-marker {
  display: none;
}

.fw-more summary::before {
  color: var(--text-3);
  font-weight: 400;
  content: "＋";
}

.fw-more[open] summary::before {
  content: "－";
}

.fw-more-list {
  max-width: var(--measure);
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}

.fw-more-list li {
  margin: 0 0 0.5rem;
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.85;
}

.fw-more-list li::marker {
  color: var(--text-3);
}

.fw-figure {
  margin: 1.75rem 0 1.5rem;
}

.fw-figure svg {
  display: block;
  width: 100%;
  min-width: 46rem;
  height: auto;
  color: var(--text-3);
  font-family: var(--font-sans);
}

.fw-figure-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
}

.fw-figure figcaption {
  margin-top: 0.75rem;
  color: var(--text-3);
  font-size: 0.82rem;
}

.fw-fig-band {
  fill: var(--surface-2);
}

.fw-fig-band-label {
  fill: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.fw-fig-node {
  fill: var(--surface);
  stroke: var(--border-3);
  stroke-width: 1;
}

.fw-fig-title {
  fill: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.fw-fig-sub,
.fw-fig-input {
  fill: var(--text-2);
  font-size: 12px;
}

.fw-fig-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
}

.fw-fig-loop {
  stroke-dasharray: 4 4;
}

.fw-fig-grid,
.fw-fig-rule {
  stroke: var(--border);
  stroke-width: 1;
}

.fw-fig-axis,
.fw-fig-key,
.fw-fig-note {
  fill: var(--text-3);
  font-size: 11px;
}

.fw-fig-group {
  fill: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.fw-fig-label {
  fill: var(--text);
  font-size: 12px;
}

.fw-fig-code {
  fill: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px;
}

.fw-fig-flag {
  fill: var(--fig-warn);
  font-size: 11px;
  font-weight: 600;
}

.fw-fig-qmark {
  fill: var(--text-3);
  font-size: 13px;
}

.fw-fig-bar-a {
  fill: var(--surface-3);
  stroke: var(--border-3);
}

.fw-fig-bar-b {
  fill: var(--accent-soft-2);
  stroke: var(--accent);
}

.fw-fig-track {
  stroke: var(--text-2);
  stroke-width: 3;
}

.fw-fig-track-gap {
  stroke: var(--text-3);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
}

.fw-fig-dot {
  fill: var(--text-2);
}

.fw-fig-node-a,
.fw-fig-node-b,
.fw-fig-node-dim {
  fill: var(--surface);
  stroke-width: 1.25;
}

.fw-fig-node-a {
  stroke: var(--border-3);
}

.fw-fig-node-b {
  stroke: var(--accent);
}

.fw-fig-node-dim {
  stroke: var(--border-2);
  stroke-dasharray: 3 3;
}

.fw-edge-solid,
.fw-edge-dash,
.fw-edge-dot {
  fill: none;
}

.fw-edge-solid,
.fw-edge-dash {
  stroke: var(--accent);
  stroke-width: 2;
}

.fw-edge-dash {
  stroke-dasharray: 7 5;
}

.fw-edge-dot {
  stroke: var(--text-3);
  stroke-width: 1.5;
  stroke-dasharray: 2 4;
}

.fw-cluster {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.25;
}

.fw-cluster-ext {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.25;
  stroke-dasharray: 7 5;
}

.fw-chip {
  stroke-width: 1;
}

.fw-chip-text {
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.fw-chip-m-strong {
  fill: var(--accent);
  stroke: var(--accent);
}

.fw-chip-m-strong-text {
  fill: var(--fig-on-accent);
}

.fw-chip-m-medium {
  fill: var(--accent-soft-2);
  stroke: var(--accent);
}

.fw-chip-m-weak {
  fill: var(--accent-soft);
  stroke: var(--accent-soft-2);
}

.fw-chip-m-medium-text,
.fw-chip-m-weak-text {
  fill: var(--accent-text);
}

.fw-chip-x-strong {
  fill: var(--fig-warn);
  stroke: var(--fig-warn);
}

.fw-chip-x-strong-text {
  fill: var(--fig-on-accent);
}

.fw-chip-x-medium {
  fill: var(--fig-warn-soft);
  stroke: var(--fig-warn);
}

.fw-chip-x-weak {
  fill: var(--surface);
  stroke: var(--fig-warn);
}

.fw-chip-x-medium-text,
.fw-chip-x-weak-text {
  fill: var(--fig-warn);
}

.fw-chip-off {
  fill: none;
  stroke: var(--border-3);
  stroke-dasharray: 3 2;
}

.fw-chip-off-text {
  fill: var(--text-3);
}

.fw-deflist {
  max-width: 52rem;
  margin: 0 0 1.5rem;
  border-top: 1px solid var(--border);
}

.fw-deflist > div {
  display: grid;
  padding: 0.75rem 0;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.fw-deflist dt {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
}

.fw-deflist dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.fw-deflist code {
  white-space: nowrap;
}

.fw-answer-parts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fw-answer-parts > li + li {
  margin-top: 0.4rem;
}

.fw-answer-parts strong {
  font-weight: 600;
}

.fw-deflist-compact > div {
  padding: 0.55rem 0;
  grid-template-columns: 4rem minmax(0, 1fr);
}

.fw-matrix th[scope="row"] {
  width: 8.5rem;
}

.fw-matrix th[scope="row"] small {
  white-space: nowrap;
}

.fw-matrix td {
  width: 22%;
}

.fw-matrix td strong {
  display: block;
  font-size: 0.93rem;
  font-weight: 600;
}

.fw-matrix td span {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-2);
  font-size: 0.85rem;
  line-height: 1.6;
}

.fw-matrix td.fw-span strong {
  display: inline;
}

.fw-matrix td.fw-span span {
  display: inline;
  margin: 0 0 0 0.6rem;
}

.fw-matrix td.fw-muted span {
  margin: 0;
  color: var(--text-3);
}

.fw-pattern th,
.fw-pattern td {
  text-align: center;
  vertical-align: middle;
}

.fw-main .fw-pattern th,
.fw-main .fw-pattern td {
  padding-right: 0.85rem;
}

.fw-pattern th[scope="row"],
.fw-pattern thead tr:first-child th:first-child {
  text-align: left;
}

.fw-main .fw-pattern th[scope="row"] {
  min-width: 0;
  white-space: nowrap;
}

.fw-pattern thead tr:first-child th {
  padding-bottom: 0.25rem;
  border-bottom: 0;
}

.fw-pattern thead tr + tr th {
  padding-top: 0.2rem;
}

.fw-pattern .fw-hypothesis {
  color: var(--text-2);
  font-size: 0.86rem;
  text-align: left;
  white-space: nowrap;
}

.fw-pattern td.fw-span {
  color: var(--text-2);
  font-size: 0.86rem;
}

.fw-sym {
  font-size: 0.95rem;
  line-height: 1;
}

.fw-sym-match {
  color: var(--text);
}

.fw-sym-mismatch,
.fw-sym-none {
  color: var(--text-3);
}

.fw-cell-note {
  color: var(--text-2);
  font-size: 0.78rem;
  white-space: nowrap;
}

.fw-main .fw-legend {
  color: var(--text-3);
  font-size: 0.82rem;
}

.fw-pitfalls {
  max-width: 52rem;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.fw-pitfalls li {
  padding: 1.05rem 0 1.1rem;
  border-bottom: 1px solid var(--border);
}

.fw-pitfalls strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 600;
}

.fw-main .fw-pitfalls p {
  margin: 0.35rem 0 0.4rem;
  font-size: 0.93rem;
  line-height: 1.85;
}

.fw-main .fw-pitfall-step {
  margin: 2rem 0 0.5rem;
  font-size: 0.98rem;
}

.fw-pitfall-step a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
}

.fw-pitfall-step a:hover {
  text-decoration: underline;
}

.fw-aside {
  position: sticky;
  top: calc(var(--header-h) + 1.75rem);
  max-height: calc(100vh - var(--header-h) - 3.5rem);
  overflow-y: auto;
  scrollbar-width: thin;
}

.fw-toc summary {
  display: none;
}

.fw-toc-group + .fw-toc-group {
  margin-top: 1.25rem;
}

.fw-toc-label {
  margin: 0 0 0.4rem;
  color: var(--text-3);
  font-size: 0.76rem;
  font-weight: 600;
}

.fw-toc ol {
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
  list-style: none;
}

.fw-toc a {
  display: flex;
  margin-left: -1px;
  padding: 0.3rem 0 0.3rem 0.85rem;
  gap: 0.5rem;
  border-left: 1px solid transparent;
  color: var(--text-2);
  font-size: 0.86rem;
  line-height: 1.5;
  text-decoration: none;
}

.fw-toc a:hover {
  color: var(--text);
}

.fw-toc a[aria-current="true"] {
  border-left-color: var(--text);
  color: var(--text);
  font-weight: 600;
}

.fw-toc .fw-toc-sub {
  border-left: 0;
}

.fw-toc .fw-toc-sub a {
  padding: 0.18rem 0 0.18rem 1.6rem;
  font-size: 0.8rem;
}

.fw-toc-no {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
}

@media (max-width: 1080px) {
.fw-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

.fw-aside {
    position: static;
    max-height: none;
    order: -1;
  }

.fw-toc {
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
  }

.fw-toc summary {
    display: flex;
    padding: 0.65rem 0.9rem;
    align-items: center;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
  }

.fw-toc summary::-webkit-details-marker {
    display: none;
  }

.fw-toc summary::after {
    margin-left: auto;
    color: var(--text-3);
    content: "＋";
  }

.fw-toc[open] summary::after {
    content: "－";
  }

.fw-toc nav {
    padding: 0.25rem 0.9rem 0.9rem;
  }
}

@media (max-width: 860px) {
.fw-deflist > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.3rem;
  }

.fw-deflist-compact > div {
    grid-template-columns: 3rem minmax(0, 1fr);
    gap: 0.75rem;
  }

.fw-main > section {
    margin-top: 3.75rem;
  }
}

.error-page {
  max-width: 560px;
  margin: 4rem auto;
  text-align: center;
}

.error-page .eyebrow {
  justify-content: center;
}

.error-page p {
  margin-bottom: 1.5rem;
  color: var(--text-2);
}

@media (max-width: 860px) {
.header-inner,
.site-main,
.footer-inner {
    width: min(calc(100% - 2rem), var(--max-width));
  }

.header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    height: auto;
    padding-block: 0.6rem 0;
    gap: 0.25rem 1rem;
  }

.header-actions {
    grid-row: 1;
    grid-column: 2;
    margin-left: 0;
  }

.primary-nav {
    grid-row: 2;
    grid-column: 1 / -1;
    height: 44px;
    margin: 0 -1rem;
    padding: 0 1rem;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 1rem, #000 calc(100% - 1.5rem), transparent);
    mask-image: linear-gradient(to right, transparent, #000 1rem, #000 calc(100% - 1.5rem), transparent);
  }

.primary-nav a:first-child {
    padding-left: 0;
  }

.primary-nav a[aria-current="page"]::after {
    left: 0;
    right: 0.7rem;
  }

.primary-nav a:not(:first-child)[aria-current="page"]::after {
    left: 0.7rem;
  }

html {
    scroll-padding-top: 7.5rem;
  }
}

@media (max-width: 560px) {
.site-main {
    padding-block: 1.5rem 3.5rem;
  }

.footer-sep {
    margin: 0 0.35rem;
  }

.detail-table th,
.detail-table td {
    padding-right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
html {
    scroll-behavior: auto;
  }

*,
*::before,
*::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
:root {
    color-scheme: light;
    --bg: #fff;
    --surface: #fff;
    --text: #000;
    --text-2: #333;
    --text-3: #555;
    --border: #ccc;
  }

.site-header,
.site-footer,
.skip-link,
.theme-toggle {
    display: none !important;
  }

body,
.site-main {
    width: 100%;
    background: #fff;
  }

.detail-table {
    min-width: 0;
  }

.detail-table tr {
    break-inside: avoid;
  }

a {
    color: #000;
  }
}

.fw-spec-quote {
  margin: 1.5rem 0 1.75rem;
  padding: 0.9rem 0 0.2rem;
  border-top: 1px solid var(--border-2);
  border-bottom: 1px solid var(--border);
}

.fw-main .fw-spec-quote-label {
  margin: 0 0 0.6rem;
  color: var(--text-2);
  font-size: 0.85rem;
}

.fw-spec-quote .table-scroll {
  margin-bottom: 1rem;
}

.fw-spec-quote .fw-figure {
  margin-top: 0.75rem;
}

.fw-more-body > .fw-spec-quote:first-child {
  margin-top: 0.5rem;
}

.fw-rule-refs {
  color: var(--text-2);
  font-size: 0.85rem;
}

.fw-rule-refs a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.fw-main .fw-output-source {
  margin: 0 0 0.75rem;
  color: var(--text-2);
  font-size: 0.82rem;
}

.fw-main .fw-spec-quote .fw-pattern th,
.fw-main .fw-spec-quote .fw-pattern td {
  padding-right: 0.45rem;
  padding-left: 0.1rem;
}

.fw-spec-quote .fw-pattern code {
  font-size: 0.74rem;
}

.fw-spec-quote .fw-pattern .fw-cell-note {
  display: block;
  white-space: normal;
}

.fw-spec-quote .fw-pattern thead th {
  white-space: normal;
}

.fw-mark {
  stroke-width: 1;
}

.fw-mark.fw-chip-off {
  stroke: var(--text-3);
  stroke-dasharray: none;
}

.fw-mark-text {
  fill: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
}

.fw-mark-text-off {
  fill: var(--text-3);
}

.fw-mark.fw-chip-m-weak {
  stroke: var(--accent);
}

.fw-main .fw-spec-table tbody th,
.fw-main .fw-spec-table th[scope="row"] {
  min-width: 7rem;
  white-space: normal;
}

.fw-main .fw-spec-table th[scope="row"] code {
  overflow-wrap: normal;
  white-space: normal;
}

.fw-main .fw-spec-table thead th {
  white-space: normal;
}

.fw-main .fw-spec-table th,
.fw-main .fw-spec-table td {
  padding-right: 0.9rem;
}

.fw-main .fw-spec-table td code {
  overflow-wrap: normal;
  white-space: normal;
}

.table-scroll {
  position: relative;
}

@media (max-width: 560px) {
.fw-main .detail-table td {
    min-width: 6.5rem;
  }

.fw-main .fw-pattern td {
    min-width: 0;
  }
}

.step-list.step-list-from-zero {
  counter-reset: step -1;
}
