/* フロントエンドの基礎。style.css と flow.css の上に重ねる（HTML は橙・CSS は青・JavaScript は緑、○ は緑・✕ は赤、AI は紫） */
:root {
  --f-html: #c2410c;
  --f-css: #2563eb;
  --f-js: #047857;
  --f-ok: #15803d;
  --f-ng: #b91c1c;
  --f-ai: #6d28d9;
  --f-ai-soft: #ede9fe;
  --f-code: #0f172a;
}
.subh { margin: 22px 0 10px; font-size: 15px; }
.hint { display: inline-block; font-size: 11px; font-weight: 700; line-height: 1.5; color: #475569; background: #f8fafc; border: 1px dashed #94a3b8; border-radius: 999px; padding: 0 8px; white-space: nowrap; vertical-align: 2px; margin-left: 6px; }
.sref { margin: 0; font-size: 11.5px; color: var(--muted); }
.sref a, .jl a, .fhead p a { color: #1d4ed8; text-underline-offset: 2px; }
.jl { margin: 0; font-size: 12.5px; }
.inl { font-weight: 700; }
.code { margin: 0; font-family: var(--latin); font-size: 12px; line-height: 1.6; background: var(--f-code); color: #e2e8f0; border-radius: 10px; padding: 9px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.code code { font: inherit; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg button { appearance: none; font: inherit; font-family: var(--latin); font-size: 12px; font-weight: 600; border: 1px solid var(--line); background: var(--paper); color: var(--ink2); border-radius: 8px; padding: 5px 9px; cursor: pointer; min-height: 32px; }
.seg button:hover { border-color: #94a3b8; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.card { min-width: 0; }

/* ① 3 つの材料 */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tri { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.trih { display: flex; align-items: baseline; gap: 10px; }
.trih b { font-family: var(--latin); font-size: 20px; font-weight: 600; }
.trih span { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 8px; }
.tri-html .trih span { background: #ffedd5; color: #9a3412; }
.tri-css .trih span { background: #dbeafe; color: #1e40af; }
.tri-js .trih span { background: #d1fae5; color: #065f46; }
.tri p { margin: 0; font-size: 13px; color: var(--ink2); }
.trilook { margin-top: auto; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--ink2); background: var(--line2); border-radius: 10px; padding: 8px 10px; }
.trilook .panel { font-size: 11.5px; font-weight: 700; color: var(--ink); }
.triall { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--paper); border: 1px dashed #cbd5e1; border-radius: 14px; padding: 10px 16px; font-size: 13px; color: var(--ink2); }
.triall b { color: var(--ink); }
.send { appearance: none; font: inherit; font-weight: 700; padding: 8px 16px; border-radius: 8px; border: 0; background: var(--f-css); color: #fff; cursor: pointer; }
.send:hover { background: #1d4ed8; }
.dtkeys { margin-top: 10px; padding: 12px 16px; display: grid; gap: 6px; }
.dth { font-size: 13px; }
.dtkeys ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dtkeys li { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; font-size: 13px; }
kbd { font-family: var(--latin); font-size: 11.5px; font-weight: 600; background: var(--paper); border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.dtkeys .mac { font-size: 12px; color: var(--muted); }
.dtw { color: var(--ink2); }
.dtnote { margin: 0; font-size: 12.5px; color: var(--ink2); }

/* ② HTML の ✕ と ○ */
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pair { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pair h3 { margin: 0; font-size: 14.5px; }
.pv { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; align-items: start; }
.pv b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; margin-top: 4px; }
.pv.bad b { background: var(--f-ng); }
.pv.good b { background: var(--f-ok); }
.pv pre { margin: 0; font-family: var(--latin); font-size: 12px; line-height: 1.55; border-radius: 8px; padding: 6px 9px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pv.bad pre { background: #fef2f2; color: #7f1d1d; }
.pv.good pre { background: #f0fdf4; color: #14532d; }
.pair > p { margin: 0; font-size: 12.5px; color: var(--ink2); }
.pair .sref { margin-top: auto; }

/* ③ 箱の大きさ */
.boxdemo { padding: 14px 16px; }
.bdhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.bdhead h3 { margin: 0; font-size: 15px; }
.bdbody { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.bdfig { min-width: 0; }
.bdm { position: relative; border: 1.5px dashed #cbd5e1; border-radius: 10px; padding: 22px 12px 12px; }
.bdb { position: relative; background: #334155; border-radius: 4px; padding: 6px; margin: 0 auto; }
.bdp { position: relative; background: #dbeafe; border-radius: 2px; padding: 22px 18px 18px; }
.bdc { background: var(--paper); border: 1.5px dashed #93c5fd; border-radius: 2px; min-height: 64px; display: grid; place-items: center; font-size: 13px; color: var(--ink2); text-align: center; padding: 6px; }
.bdc b { font-family: var(--latin); font-size: 18px; color: var(--ink); margin: 0 2px; }
.bdl { position: absolute; font-family: var(--latin); font-size: 10.5px; font-weight: 600; line-height: 1; }
.bdl-m { top: 6px; left: 10px; color: var(--muted); }
.bdl-b { top: -16px; right: 0; color: #334155; }
.bdl-p { top: 6px; left: 8px; color: #1e40af; }
.bdruler { position: relative; margin: 10px auto 0; height: 22px; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); }
.bdruler::before { content: ''; position: absolute; left: 0; right: 0; top: 10px; border-top: 1.5px solid var(--ink); }
.bdruler span { position: absolute; left: 50%; top: 0; transform: translateX(-50%); background: var(--paper); padding: 0 8px; font-family: var(--latin); font-size: 12px; font-weight: 600; white-space: nowrap; }
.bdside { display: grid; gap: 8px; min-width: 0; }
.bdcalc { margin: 0; font-size: 13.5px; }
.bdnote { margin: 0; font-size: 12px; color: var(--muted); }
.laygrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.lay { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.layh { display: flex; align-items: baseline; gap: 10px; }
.layh h3 { margin: 0; font-size: 16px; }
.layh span { font-size: 12px; font-weight: 700; color: var(--ink2); background: var(--line2); border-radius: 6px; padding: 1px 8px; }
.lay p { margin: 0; font-size: 12.5px; color: var(--ink2); }
.laymini { display: grid; gap: 5px; background: var(--line2); border-radius: 8px; padding: 8px; }
.laymini.f { grid-template-columns: 1fr 1.6fr 1fr; }
.laymini.g { grid-template-columns: repeat(3, 1fr); }
.laymini i { height: 18px; border-radius: 4px; background: #93c5fd; }

/* 目玉 1: Flexbox の遊び場 */
.flexlab { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 14px; align-items: start; }
.flexctrl { padding: 13px 15px; display: grid; gap: 11px; }
.flexctrl > * { min-width: 0; }
.fpre b, .fprop b { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; margin-bottom: 5px; }
.fprop b code { font-family: var(--latin); font-size: 11px; font-weight: 600; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { appearance: none; font: inherit; font-size: 12.5px; font-weight: 700; border: 1px solid #bfdbfe; background: #eff6ff; color: #1e40af; border-radius: 999px; padding: 4px 11px; cursor: pointer; }
.chip:hover { background: #dbeafe; }
.fnote { margin: 0; font-size: 12px; color: var(--ink2); background: var(--line2); border-radius: 8px; padding: 7px 9px; }
.flexout { display: grid; gap: 10px; min-width: 0; position: sticky; top: 12px; }
.fstage { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 34px 12px 12px 34px; }
.fbox { display: flex; height: 250px; border: 1.5px dashed #94a3b8; border-radius: 10px; padding: 8px; background: repeating-linear-gradient(45deg, #fbfcfe 0 8px, #f4f6fa 8px 16px); overflow: auto; }
.fbox.grow { height: auto; min-height: 250px; }
.fit { flex: 0 1 auto; display: grid; place-items: center; font-family: var(--latin); font-size: 15px; font-weight: 600; color: #1e3a8a; background: #dbeafe; border-radius: 8px; box-shadow: inset 0 0 0 1.5px #93c5fd; width: var(--w); min-height: var(--h); min-width: 30px; }
.fbox.col .fit { width: auto; min-height: 0; height: calc(var(--h) * .7); min-width: var(--w); }
.fit[hidden] { display: none; }
.axis { position: absolute; color: #94a3b8; }
.axis.main { color: var(--f-css); }
.axis i { position: absolute; display: block; }
.axis i::after { content: ''; position: absolute; }
.axis span { position: absolute; font-size: 11px; font-weight: 700; white-space: nowrap; line-height: 1; }
.ax-h { left: 34px; right: 12px; top: 8px; height: 20px; }
.ax-h i { left: 0; right: 0; bottom: 3px; border-top: 2px solid currentColor; }
.ax-h i::after { right: -2px; top: -6px; border-left: 9px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.ax-h.rev i::after { right: auto; left: -2px; border-left: 0; border-right: 9px solid currentColor; }
.ax-h span { left: 0; top: 0; }
.ax-h.rev span { left: auto; right: 0; }
.ax-v { top: 34px; bottom: 12px; left: 8px; width: 20px; }
.ax-v i { top: 0; bottom: 0; right: 3px; border-left: 2px solid currentColor; }
.ax-v i::after { bottom: -2px; left: -6px; border-top: 9px solid currentColor; border-left: 5px solid transparent; border-right: 5px solid transparent; }
.ax-v.rev i::after { bottom: auto; top: -2px; border-top: 0; border-bottom: 9px solid currentColor; }
.ax-v span { left: 0; top: 0; writing-mode: vertical-rl; }
.ax-v.rev span { top: auto; bottom: 0; }
.fcssbox { display: grid; gap: 6px; }
.fcss { margin: 0; font-family: var(--latin); font-size: 12.5px; line-height: 1.7; background: var(--f-code); color: #e2e8f0; border-radius: 12px; padding: 11px 14px; overflow-x: auto; white-space: pre; }
.fcss .chg { color: #fde68a; font-weight: 600; }
.fcss .dim { color: #64748b; }
.fexp { margin: 0; font-size: 13px; color: var(--ink2); min-height: 1.6em; }
.fexp code { font-family: var(--latin); font-size: 12px; font-weight: 600; background: var(--line2); border-radius: 6px; padding: 1px 6px; color: var(--ink); }

/* スマホ対応・JavaScript */
.respgrid, .jsgrid, .speedgrid, .trgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rcard, .jcard, .scard, .trcard, .fp, .tp, .acard { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.rcard h3, .jcard h3, .scard h3, .trcard h3, .fp h3, .tp h3, .acard h3 { margin: 0; font-size: 14.5px; }
.rcard p, .jcard p, .scard p, .trcard p, .fp p, .tp p, .acard p { margin: 0; font-size: 12.5px; color: var(--ink2); }
.rcard .sref, .jcard .sref, .scard .sref, .trcard .sref, .fp .sref, .tp .sref, .acard .sref { margin-top: auto; }
.fetchlab { padding: 13px 15px; display: grid; gap: 10px; }
.fetchlab > *, .formlab > *, .fmgrid > * { min-width: 0; }
.fgrid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.fcode { white-space: normal; padding: 8px 0; }
.fcode .ln { display: block; white-space: pre-wrap; overflow-wrap: anywhere; padding: 0 12px; min-height: 1.6em; transition: background-color .2s, color .2s; }
.fcode .ln.on { background: rgba(96, 165, 250, .22); color: #f8fafc; }
.fcode .ln.off { color: #64748b; }
.fres { background: var(--line2); border-radius: 10px; padding: 10px 12px; }
.fres b { font-size: 12px; color: var(--muted); }
.fres p { margin: 4px 0 0; font-size: 13.5px; }
.fnote2 { margin: 0; font-size: 12.5px; color: var(--ink2); }

/* 目玉 2: フォームの入力チェック */
.formlab { padding: 14px 16px; }
.fmodes { display: flex; gap: 6px; flex-wrap: wrap; }
.fmodes [role="tab"] { appearance: none; font: inherit; font-size: 13.5px; font-weight: 700; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink2); border-radius: 10px; padding: 7px 14px; cursor: pointer; }
.fmodes [role="tab"]:hover { border-color: #94a3b8; color: var(--ink); }
.fmodes [aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.fmwhat { margin: 10px 0 12px; font-size: 13px; color: var(--ink2); }
.fmgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.cform { display: grid; gap: 12px; }
.cf { display: grid; gap: 4px; }
.cf label { font-size: 13px; font-weight: 700; }
.cf input, .cf textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1.5px solid #cbd5e1; border-radius: 10px; padding: 8px 11px; width: 100%; resize: vertical; }
.cf input:focus-visible, .cf textarea:focus-visible { outline: 3px solid #93c5fd; outline-offset: 1px; border-color: #2563eb; }
.cf [aria-invalid="true"] { border-color: var(--f-ng); background: #fffafa; }
.cfrule { font-family: var(--latin); font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.ferr { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--f-ng); }
.ferr::before { content: '⚠ '; }
.cfbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.cfsend { appearance: none; font: inherit; font-weight: 700; border: 0; background: var(--ink); color: #fff; border-radius: 10px; padding: 9px 18px; cursor: pointer; min-width: 112px; }
.cfsend:disabled { background: #94a3b8; cursor: progress; }
.cfsub { appearance: none; font: inherit; font-size: 13px; font-weight: 700; border: 1px solid var(--line); background: var(--paper); color: var(--ink2); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.cfsub:hover { border-color: #94a3b8; color: var(--ink); }
.cres { display: grid; gap: 8px; min-width: 0; }
.rwait { margin: 0; font-size: 13px; color: var(--muted); background: var(--line2); border-radius: 10px; padding: 10px 12px; }
.rs { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); }
.rs > b { display: block; font-size: 12px; padding: 6px 11px; background: var(--line2); color: var(--ink2); }
.rs.stop > b { background: #fef3c7; color: #78350f; }
.rs.res > b { background: #fee2e2; color: #7f1d1d; }
.rs.ok > b { background: #dcfce7; color: #14532d; }
.rs > p { margin: 0; padding: 9px 11px; font-size: 13px; color: var(--ink2); }
.rs pre { margin: 0; font-family: var(--latin); font-size: 11.5px; line-height: 1.55; background: var(--f-code); color: #e2e8f0; padding: 9px 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.rs pre .st { color: #fca5a5; font-weight: 600; }
.rs.ok pre .st { color: #86efac; }
.rnote { margin: 0; font-size: 12.5px; color: var(--ink2); }
.rjs summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: #1d4ed8; padding: 2px 0; }
.rjs .code { margin-top: 6px; }
.fpoints { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }

/* ⑥ TypeScript */
.tslab { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.tscode { background: var(--f-code); border-radius: 14px; overflow: hidden; }
.tsbar { background: #1e293b; padding: 7px 14px; }
.tsbar span { font-family: var(--latin); font-size: 12px; color: #cbd5e1; border-bottom: 2px solid #60a5fa; padding-bottom: 5px; }
.tspre { border-radius: 0; padding: 12px 14px; font-size: 13px; }
.squig { text-decoration: underline wavy #f87171; text-decoration-skip-ink: none; text-underline-offset: 4px; }
.tserr { display: grid; gap: 3px; margin: 0 12px 12px; background: #1e293b; border: 1px solid #7f1d1d; border-radius: 10px; padding: 9px 11px; }
.tserr b { font-size: 11px; color: #fca5a5; }
.tserr code { font-family: var(--latin); font-size: 12px; color: #fecaca; overflow-wrap: anywhere; }
.tserr span { font-size: 12px; color: #cbd5e1; }
.tspoints { display: grid; gap: 8px; }

/* ⑦ アクセシビリティ */
.a11ygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.sc { align-self: flex-start; font-family: var(--latin); font-size: 11px; font-weight: 600; color: #1e40af; background: #dbeafe; border-radius: 6px; padding: 1px 7px; }
.webaim { margin-top: 12px; padding: 16px 18px; }
.wahead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.wahead h3 { margin: 0 0 4px; font-size: 15.5px; }
.wahead p { margin: 0; font-size: 12.5px; color: var(--ink2); max-width: 40em; }
.wastat { display: flex; align-items: baseline; gap: 10px; max-width: 360px; }
.wastat b { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -.01em; }
.wastat span { font-size: 12.5px; color: var(--ink2); }
.walegend { display: flex; gap: 16px; margin: 14px 0 6px; font-size: 12px; color: var(--ink2); }
.walegend span { display: inline-flex; align-items: center; gap: 6px; }
.walegend i { display: inline-block; }
.walegend .k26 { width: 14px; height: 10px; background: var(--f-css); border-radius: 0 3px 3px 0; }
.walegend .k25 { width: 2px; height: 14px; background: var(--ink); }
.wabars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.wabars li { position: relative; display: grid; grid-template-columns: minmax(0, 15em) minmax(0, 1fr); gap: 12px; align-items: center; padding: 5px 6px; border-radius: 8px; outline: none; }
.wabars li:hover, .wabars li:focus { background: var(--line2); }
.wabars li:focus-visible { box-shadow: 0 0 0 3px #93c5fd; }
.wan { font-size: 13px; }
.wat { position: relative; height: 22px; display: flex; align-items: center; padding-right: 54px; }
.wat::before { content: ''; position: absolute; left: 0; right: 54px; top: 3px; bottom: 3px; background: var(--line2); border-radius: 0 4px 4px 0; }
.wat .bar { position: relative; display: block; height: 16px; width: calc((100% - 0px) * var(--v) / 100); background: var(--f-css); border-radius: 0 4px 4px 0; }
.wat .tick { position: absolute; top: 0; bottom: 0; left: calc((100% - 54px) * var(--v) / 100 - 1px); width: 2px; background: var(--ink); border-radius: 1px; }
.wav { position: absolute; right: 0; font-family: var(--latin); font-size: 12.5px; font-weight: 600; width: 50px; text-align: right; }
.watip { position: absolute; z-index: 2; right: 6px; top: calc(100% - 2px); background: var(--ink); color: #fff; font-size: 12px; border-radius: 8px; padding: 5px 9px; white-space: nowrap; opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity .15s, transform .15s; }
.wabars li:hover .watip, .wabars li:focus .watip { opacity: 1; transform: none; }
.wanote { margin: 10px 0 4px; font-size: 12px; color: var(--muted); }

/* ⑧ 表示の速さ */
.vitals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.vt { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.vth { display: flex; align-items: baseline; gap: 10px; }
.vth b { font-family: var(--latin); font-size: 24px; font-weight: 600; }
.vth span { font-size: 13px; font-weight: 700; color: var(--ink2); }
.vgood { align-self: flex-start; display: inline-flex; align-items: baseline; gap: 6px; font-size: 15px; font-weight: 700; color: #14532d; background: #dcfce7; border-radius: 8px; padding: 3px 10px; }
.vgood small { font-size: 11px; }
.vt p { margin: 0; font-size: 12.5px; color: var(--ink2); }
.vt .ven { font-family: var(--latin); font-size: 11px; color: var(--muted); }
.vt .sref { margin-top: auto; }
.vnote { margin: 10px 0 12px; font-size: 12.5px; color: var(--ink2); }
.vnote .sref { display: inline; }

/* ⑨ フレームワーク */
.fwgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.way { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.way.vite { background: var(--any-bg); border-style: dashed; }
.wno { align-self: flex-start; font-size: 11px; font-weight: 700; color: var(--ink2); background: var(--line2); border-radius: 6px; padding: 1px 8px; }
.way h3 { margin: 0; font-size: 15px; }
.wtools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wtools span { font-size: 12.5px; font-weight: 700; color: #1e3a8a; background: #dbeafe; border-radius: 8px; padding: 2px 9px; }
.wtools i { font-style: normal; color: var(--muted); }
.way p { margin: 0; font-size: 12.5px; color: var(--ink2); }
.way .sref { margin-top: auto; }
.statetree { padding: 16px 18px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: center; }
.tree { display: grid; justify-items: center; min-width: 0; }
.tnode { background: var(--paper); border: 1.5px solid #94a3b8; border-radius: 10px; padding: 8px 12px; display: grid; gap: 3px; text-align: center; min-width: 0; }
.tnode b { font-family: var(--latin); font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.tnode small { font-size: 11.5px; color: var(--ink2); }
.tnode.root { border-color: #0d9488; box-shadow: 0 0 0 3px #ccfbf1; }
.tstate { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 3px; }
.tstate span { font-size: 11.5px; font-weight: 700; color: #115e59; background: #ccfbf1; border-radius: 6px; padding: 1px 7px; }
.tlines { position: relative; width: 50%; height: 26px; border-left: 1.5px solid #94a3b8; border-right: 1.5px solid #94a3b8; border-top: 1.5px solid #94a3b8; margin-top: 13px; }
.tlines::before { content: ''; position: absolute; left: 50%; top: -14px; height: 13px; border-left: 1.5px solid #94a3b8; }
.tlines i { display: none; }
.tkids { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; }
.ttext p { margin: 0 0 8px; font-size: 13px; color: var(--ink2); }
.ttext .tex { background: var(--line2); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; }

/* ⑩ AI 時代 */
.aitag2 { font-size: 12px; font-weight: 700; color: var(--f-ai); background: var(--f-ai-soft); border-radius: 6px; padding: 2px 8px; margin-right: 8px; vertical-align: 2px; }
.aigrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.aicard { background: #fcfbff; border: 1px solid #ddd6fe; border-radius: 14px; padding: 13px 15px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.aicard h3 { margin: 0; font-size: 14.5px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.aicard .hint { margin-left: 0; }
.aitag { font-style: normal; font-family: var(--latin); font-size: 10.5px; font-weight: 600; background: var(--f-ai-soft); color: #5b21b6; border-radius: 5px; padding: 1px 5px; }
.aicard p { margin: 0; font-size: 12.5px; color: var(--ink2); }
.aicard .sref { margin-top: auto; }

/* チェックリスト */
.mlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; }
.mlist label { display: flex; gap: 10px; align-items: flex-start; padding: 7px 4px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.mlist label:hover { background: var(--line2); }
.mlist input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--f-js); flex: none; }
.mlist input:checked + span { color: var(--muted); text-decoration: line-through; }
.ckfoot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.mcount { font-size: 12.5px; font-weight: 700; color: var(--f-js); }
.ckreset { appearance: none; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink2); cursor: pointer; }
#check .src { margin-top: 14px; }

.seg button:focus-visible, .chip:focus-visible, .send:focus-visible, .fmodes [role="tab"]:focus-visible, .cfsend:focus-visible, .cfsub:focus-visible, .rjs summary:focus-visible, .mlist input:focus-visible, .ckreset:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }

@media (max-width: 1100px) {
  .respgrid, .jsgrid, .speedgrid, .trgrid, .aigrid, .fwgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flexlab { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); }
  .fmgrid, .tslab, .bdbody, .statetree { grid-template-columns: 1fr; }
  .vitals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .trio, .laygrid, .respgrid, .jsgrid, .speedgrid, .trgrid, .aigrid, .fwgrid, .vitals, .fpoints, .mlist, .flexlab { grid-template-columns: minmax(0, 1fr); }
  .pairs { grid-template-columns: minmax(0, 1fr); }
  .fgrid { grid-template-columns: minmax(0, 1fr); }
  .flexout { display: contents; }
  .fstage { order: 1; padding: 32px 8px 8px 30px; }
  .flexctrl { order: 2; gap: 9px; }
  .fcssbox { order: 3; }
  .flexctrl .seg, .flexctrl .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -15px; padding: 0 15px 2px; scrollbar-width: none; }
  .flexctrl .seg::-webkit-scrollbar, .flexctrl .chips::-webkit-scrollbar { display: none; }
  .flexctrl .seg button, .flexctrl .chip { flex: none; }
  .ax-h { left: 30px; right: 8px; }
  .ax-v { top: 32px; bottom: 8px; left: 6px; }
  .fbox { height: 200px; }
  .wabars li { grid-template-columns: 1fr; gap: 2px; }
  .wastat b { font-size: 34px; }
  .watip { right: 6px; white-space: normal; max-width: 260px; }
  .tkids { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .fcode .ln, .watip { transition: none; }
}
