/* 第4章 ネットワークの部品（w-c4-net.js） */
.w-c4-net { background: #fff; border: 1px solid var(--line, #e2e8f0); border-radius: 14px; padding: 12px; margin: 8px 0 14px; }
.cn-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.cn-chip { font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer; min-height: 44px; padding: 4px 12px; border: 2px solid var(--line, #e2e8f0); background: #fff; border-radius: 999px; color: var(--sub, #4b5563); }
.cn-chip[aria-pressed="true"] { border-color: var(--blue, #2563eb); color: var(--blue-d, #1d4ed8); background: var(--blue-l, #eaf1ff); }
.cn-fig { margin: 4px 0; }
.cn-fig svg, .cn-svg { width: 100%; height: auto; display: block; max-width: 560px; margin: 0 auto; }
.cn-msg { margin: 8px 0 0; padding: 8px 10px; background: #f8fafc; border-left: 4px solid var(--blue, #2563eb); border-radius: 6px; font-size: 0.95rem; min-height: 3em; }
.cn-note { font-size: 0.85rem; color: var(--sub, #4b5563); margin: 4px 0 8px; }
.cn-nt { margin: 6px 0 4px; font-size: 0.85rem; font-weight: 700; color: var(--sub, #4b5563); }
.cn-ctrl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.cn-ctrl .dn-b { min-height: 44px; min-width: 44px; }
.cn-count { font-size: 0.85rem; color: var(--sub, #4b5563); margin-left: auto; }
/* packet */
.cn-shelf { min-height: 4.5em; }
.cn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.cn-box { display: inline-flex; flex-direction: column; align-items: center; min-width: 4.6em; padding: 4px 6px; border: 2px solid #f59e0b; background: #fff4dc; border-radius: 8px; font-weight: 700; color: #1f2937; font-size: 0.92rem; }
.cn-box small { font-size: 0.75rem; color: #b45309; }
.cn-box.miss { border-style: dashed; border-color: #b91c1c; background: #fef2f2; color: #b91c1c; }
.cn-box.ok { border-color: #0f766e; background: #e7f7ef; }
.cn-empty { color: var(--sub, #4b5563); font-size: 0.88rem; }
.cn-done { font-weight: 700; color: #0f766e; margin: 6px 0 0; }
/* design */
.cn-form { display: grid; gap: 10px; }
.cn-grp { border: 1px solid var(--line, #e2e8f0); border-radius: 10px; padding: 8px; }
.cn-sel { display: grid; gap: 2px; font-size: 0.88rem; color: var(--sub, #4b5563); margin: 4px 0; }
.cn-sel select, .cn-sel input { font: inherit; font-size: 1rem; min-height: 44px; padding: 4px 8px; border: 2px solid #cbd5e1; border-radius: 8px; background: #fff; color: #1f2937; max-width: 100%; box-sizing: border-box; }
.cn-devs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.cn-dev { font: inherit; font-weight: 700; font-size: 0.9rem; min-height: 52px; cursor: pointer; border: 2px solid var(--blue, #2563eb); background: #fff; color: #1f2937; border-radius: 10px; padding: 4px 6px; text-align: left; }
.cn-dev small { display: block; font-weight: 400; font-size: 0.78rem; color: var(--blue-d, #1d4ed8); }
.cn-dev:disabled { border-color: #cbd5e1; cursor: default; }
.cn-dev:disabled small { color: var(--sub, #4b5563); }
/* dns */
.cn-dnsin { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.cn-dnsin .cn-sel { flex: 1 1 220px; margin: 0; }
.cn-dnsin input { font-family: var(--mono, monospace); width: 100%; }
.cn-dnsin .dn-b { min-height: 44px; }
/* subnet */
.cn-ipin { display: grid; gap: 6px; }
.cn-iprow { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.cn-iplab { font-size: 0.85rem; font-weight: 700; color: var(--sub, #4b5563); min-width: 8.5em; }
.cn-iprow input { width: 4.2em; min-height: 44px; font: 1rem var(--mono, monospace); text-align: center; border: 2px solid #cbd5e1; border-radius: 8px; }
.cn-dot { font-weight: 700; padding: 0 1px; }
.cn-range { display: grid; gap: 2px; font-size: 0.9rem; color: var(--sub, #4b5563); margin: 8px 0; }
.cn-range input { width: 100%; min-height: 44px; accent-color: #2563eb; }
.cn-bitrow { display: grid; gap: 0; margin: 4px 0; }
.cn-bitrow code { font: 0.95rem/1.5 var(--mono, monospace); word-break: break-all; letter-spacing: 0.02em; }
.cn-sub .nb { color: #1d4ed8; background: #eaf1ff; font-weight: 700; }
.cn-sub .hb { color: #b45309; background: #fff4dc; }
.cn-sep { color: #94a3b8; }
.cn-legend { font-size: 0.85rem; margin: 4px 0; }
.cn-tab th { text-align: left; white-space: normal; width: 42%; }
/* speed */
.cn-speed { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .cn-speed { grid-template-columns: 1fr; } }
.cn-speed .cn-range { grid-column: 1 / -1; }
.cn-line { display: flex; gap: 6px; }
.cn-line input { flex: 1 1 6em; min-width: 0; font-family: var(--mono, monospace); }
.cn-line select { flex: 0 0 auto; }
.cn-calc { margin: 10px 0 0; padding-left: 1.4em; font-size: 0.95rem; line-height: 1.7; word-break: break-word; }
.cn-ans { color: #b45309; font-size: 1.05rem; }
/* flow（光らせる図） */
.w-c4-net [data-k] rect, .w-c4-net [data-k] polyline, .w-c4-net [data-k] line, .w-c4-net [data-k] polygon { transition: stroke .25s, fill .25s; }
.w-c4-net [data-k].on rect { stroke: #f59e0b !important; stroke-width: 3 !important; fill: #fff4dc !important; }
.w-c4-net [data-k].on polyline, .w-c4-net [data-k].on line { stroke: #f59e0b !important; stroke-width: 4 !important; }
.w-c4-net [data-k].on polygon { fill: #f59e0b !important; stroke: #f59e0b !important; }
.w-c4-net [data-k].on text.lab { fill: #b45309 !important; }
@media (prefers-reduced-motion: reduce) {
  .w-c4-net [data-k] rect, .w-c4-net [data-k] polyline, .w-c4-net [data-k] line, .w-c4-net [data-k] polygon { transition: none; }
}
.cn-form > *, .cn-grp, .cn-sel { min-width: 0; }
.cn-sel select { width: 100%; }
.cn-dev { position: relative; padding-left: 30px; }
.cn-dev .cn-mark { position: absolute; left: 8px; top: 6px; font-size: 1.05rem; font-weight: 700; }
.cn-dev.ok { border-color: #0f766e; background: #f3fbf7; }
.cn-dev.ok .cn-mark { color: #0f766e; }
.cn-dev.ng { border-color: #b91c1c; background: #fef2f2; }
.cn-dev.ng .cn-mark, .cn-dev.ng .cn-why { color: #b91c1c; }
.cn-dev .cn-why { color: #4b5563; margin-top: 2px; }
.cn-dev[aria-disabled="true"] { cursor: default; }
.cn-devs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cn-sel .cn-line select { width: auto; flex: 0 0 auto; }
.cn-sel .cn-line input { width: auto; flex: 1 1 6em; min-width: 4em; }
