:root {
  color-scheme: dark;
  --page: #08111f;
  --panel: #101d2d;
  --line: #293b4e;
  --soft-line: #213244;
  --text: #eef5fc;
  --muted: #a7b9cd;
  --secondary: #8da7bd;
  --cyan: #76def5;
  --amber: #ffc779;
  --surface: #112436;
  --radius: 14px;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --canvas-height: clamp(25rem, 37vw, 32rem);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 100%;
  font-synthesis: none;
}

:root:lang(en) {
  --body-leading: 1.68;
  --body-tracking: .012em;
  --heading-leading: 1.24;
  --heading-tracking: normal;
}

:root:lang(ja) {
  --japanese-sans: 'Hiragino Sans', 'Yu Gothic', Meiryo, 'Noto Sans CJK JP', system-ui, sans-serif;
  font-family: var(--japanese-sans);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; color: var(--text); background: var(--page); line-height: var(--body-leading, 1.55); letter-spacing: var(--body-tracking, normal); }
button, input { font: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--cyan); text-underline-offset: .23em; }
a:hover { color: #bbf3ff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: var(--heading-leading, 1.18); }
:root:lang(en) p { text-wrap: pretty; }
code, pre, svg { letter-spacing: normal; }
code { font-family: var(--mono); }
.wrap { width: min(1344px, calc(100% - clamp(2rem, 6vw, 5.5rem))); margin-inline: auto; }
.muted { color: var(--muted); }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; z-index: 5; top: .75rem; left: .75rem; padding: .65rem .85rem; background: var(--panel); }

.masthead { border-bottom: 1px solid var(--soft-line); background: #0a1423; }
.masthead-inner {
  min-height: 4.15rem;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .5rem 1rem;
  padding-block: .55rem;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; font-size: 1.08rem; font-weight: 680; color: var(--text); text-decoration: none; white-space: nowrap; }
.masthead .brand { justify-self: start; }
.brand img { display: block; flex: none; }
.masthead nav { display: flex; align-items: center; gap: clamp(.75rem, 2.2vw, 1.8rem); }
.masthead nav a { color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 560; white-space: nowrap; }
.masthead nav a:hover, .masthead nav .current { color: var(--text); }
.language-switch { position: relative; justify-self: end; white-space: nowrap; }
.use-case-menu { position: relative; }
.use-case-menu summary {
  display: flex;
  align-items: center;
  gap: .36rem;
  min-height: 2.75rem;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 560;
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
}
.language-switch summary {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 2.75rem;
  padding-inline: .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--page);
  color: var(--text);
  font-size: .9rem;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}
.masthead summary::-webkit-details-marker { display: none; }
.masthead summary:hover, .masthead details[open] summary { color: var(--cyan); }
.disclosure-chevron, .case-arrow {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  background-color: currentColor;
  -webkit-mask: url('./dropdown-chevron.svg') center / contain no-repeat;
  mask: url('./dropdown-chevron.svg') center / contain no-repeat;
}
.case-arrow { transform: rotate(-90deg); }
.masthead details[open] .disclosure-chevron { transform: rotate(180deg); }
.use-case-menu:not([open]) .use-case-options { display: none; }
.use-case-options {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  inset-block-start: calc(100% + .55rem);
  inset-inline-start: 50%;
  width: min(40.5rem, calc(100vw - 2rem));
  max-height: min(34rem, calc(100dvh - 7rem));
  overflow: hidden;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 .85rem 2rem #111b3824;
}
.use-case-options ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .15rem;
  margin: 0;
  padding: .55rem;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  list-style: none;
}
.masthead .use-case-options ul a {
  display: grid;
  align-content: start;
  gap: .15rem;
  min-height: 100%;
  padding: .55rem .65rem;
  border-radius: 6px;
  white-space: normal;
  line-height: 1.4;
}
.use-case-options strong { color: var(--text); font-size: .89rem; font-weight: 650; }
.use-case-options ul span { color: var(--muted); font-size: .8rem; }
.masthead .use-case-options :is(a:hover, a:focus-visible, a[aria-current]) { color: var(--cyan); background: var(--language-current, var(--surface)); }
.use-case-options a:focus-visible { outline-offset: -3px; }
.masthead .use-case-options .all-cases {
  display: flex;
  flex: none;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .68rem 1.2rem;
  border-top: 1px solid var(--soft-line);
  color: var(--cyan);
  white-space: normal;
  font-weight: 650;
}
.language-switch:not([open]) .language-options { display: none; }
.language-options {
  position: absolute;
  z-index: 4;
  inset-block-start: calc(100% + .4rem);
  inset-inline-end: 0;
  width: min(10rem, calc(100vw - 2rem));
  max-height: max(2.5rem, calc(100dvh - 7.5rem));
  overflow: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: .25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 .65rem 1.6rem #111b3829;
  list-style: none;
}
.masthead .language-options :is(a, span) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 2.65rem;
  padding: .35rem .6rem;
  border-radius: 5px;
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}
.masthead .language-options :is(a:hover, [aria-current]) {
  background: var(--language-current, var(--surface));
  color: var(--cyan);
}
.language-options a:focus-visible { outline-offset: -2px; }
.language-options [aria-current]::after {
  content: '';
  flex: 0 0 .36rem;
  height: .65rem;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-.09rem) rotate(45deg);
}
.intro { padding-block: clamp(2rem, 4.3vw, 4.15rem) clamp(1.5rem, 2.9vw, 2.65rem); }
.intro h1 { font-size: clamp(2.35rem, 5.1vw, 4.2rem); letter-spacing: -.045em; font-weight: 700; line-height: 1.04; }
:root:lang(en) .intro h1 { letter-spacing: -.012em; font-weight: 650; line-height: 1.12; }
[lang='zh-CN'] .intro h1 { letter-spacing: -.035em; }
.intro p { color: var(--muted); max-width: 49rem; font-size: clamp(1rem, 1.6vw, 1.15rem); margin-top: .95rem; }
.demo-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18.5rem, 24%); }
.graph-workspace {
  color-scheme: light;
  --canvas-height: clamp(31rem, 42vw, 40rem);
  --panel: #fff;
  --line: #d1ddd4;
  --soft-line: #e2e9e3;
  --text: #20382d;
  --muted: #506458;
  --secondary: #60766a;
  --cyan: #176680;
  --amber: #925019;
  --surface: #f2f6f2;
  --incoming: #416db1;
  --outgoing: #267454;
  --edge: #7a9c8e;
  --card-shadow: 0 3px 14px #23382d12;
  background-color: #f5f8f5;
  background-image: radial-gradient(circle, #cfd9d1 .8px, transparent .9px);
  background-size: 18px 18px;
  border-radius: 0 0 13px 13px;
  color: var(--text);
}
.map { min-width: 0; position: relative; }
.map-controls { position: absolute; z-index: 2; inset: .8rem .8rem auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--card-shadow); }
.toolbar { padding: .43rem .48rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .45rem .65rem; }
.control-group, .toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem; max-width: 100%; }
.toolbar-actions { gap: .5rem; }
.control-group { border: 1px solid var(--line); border-radius: 7px; padding: .13rem; background: var(--surface); }
.control-group button, .resource-button, .zoom button { color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 5px; min-height: 2rem; padding: .2rem .55rem; font-size: .84rem; font-weight: 550; white-space: nowrap; }
.control-group button:hover, .zoom button:hover, .resource-button:hover { background: #e8f0eb; color: var(--text); }
.control-group button[aria-pressed='true'], .resource-button[aria-pressed='true'] { color: #245e45; border-color: #c6d9ce; background: #e8f2eb; }
.resource-button { color: var(--text); border-color: var(--line); min-height: 2.36rem; padding-inline: .7rem; }
.hop-group > span { margin-inline: .55rem .4rem; color: var(--muted); font-size: .88rem; }
.hop-group button { min-width: 2rem; }
.node-search { display: flex; align-items: center; width: clamp(10rem, 16vw, 15rem); min-height: 2.36rem; background: #f8faf8; border: 1px solid var(--line); border-radius: 7px; }
.node-search:focus-within { border-color: var(--cyan); }
.node-search input { width: 100%; min-width: 0; padding: .42rem .55rem .42rem 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: .88rem; }
.node-search input::placeholder { color: var(--secondary); opacity: 1; }
.search-icon { position: relative; align-self: stretch; flex: 0 0 2rem; background: transparent; border: 0; color: var(--secondary); }
.search-icon::before { position: absolute; content: ''; width: .65rem; height: .65rem; border: 1.5px solid currentColor; border-radius: 50%; top: calc(50% - .4rem); left: .62rem; }
.search-icon::after { position: absolute; content: ''; width: .34rem; height: 1.5px; background: currentColor; transform: rotate(45deg); top: calc(50% + .21rem); left: 1.09rem; }
.search-results { position: relative; padding: .8rem; max-height: 14rem; overflow: auto; border-top: 1px solid var(--line); }
.search-results .kicker { display: none; }
.search-results h2 { font-size: .95rem; margin-bottom: .55rem; }
.search-results .item-list { grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); }

.canvas { position: relative; }
#graph { display: block; width: 100%; height: var(--canvas-height); touch-action: none; cursor: grab; user-select: none; }
#graph.is-panning, #graph.is-panning * { cursor: grabbing; }
#graph:focus { outline: none; }
#graph:focus-visible:not(.has-pointer-focus, .is-panning) { outline: 2px solid var(--cyan); outline-offset: -3px; }
.cloud-boundary { --group: #4774a5; pointer-events: none; }
.cloud-boundary[data-group='aws'] { --group: #497654; }
.cloud-boundary[data-group='eks'] { --group: #91522d; }
.cloud-boundary[data-group='azure'] { --group: #5267a1; }
.cloud-boundary[data-group='external'] { --group: #795e9e; }
.cloud-frame { fill: #eaf2eb; fill-opacity: .32; stroke: #cadacb; stroke-width: 1; }
[data-group='eks'] .cloud-frame { fill: #fff0e6; stroke: #dac4b6; }
[data-group='external'] .cloud-frame { fill: #f0eaf8; stroke: #dbd0e6; stroke-dasharray: 5 4; }
.cloud-dot, .cloud-label { fill: var(--group); }
.cloud-label { font-size: 14px; font-weight: 680; }
.cloud-region { fill: #60776b; text-anchor: end; font: 12px var(--mono); }
.graph-node { cursor: pointer; --node-accent: #4275a4; }
.graph-node.service[data-group='aws'] { --node-accent: #ad4d0a; }
.graph-node.resource { --node-accent: #506955; }
.graph-node.external { --node-accent: #735294; }
.node-background { fill: #fff; stroke: #a9c5b4; stroke-width: 1.15; }
.resource .node-background { fill: #f9fbf9; stroke: #baccc0; }
.external .node-background { fill: #fdfaff; stroke: #c8b8d8; }
.node-icon-background { fill: var(--node-accent); fill-opacity: .12; }
.node-icon { fill: none; stroke: var(--node-accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.node-label { fill: #233d31; font-size: 13px; font-weight: 650; }
.node-meta, .node-version { fill: #526d5c; font-size: 11px; }
.node-version { font: 9.5px var(--mono); }
.graph-node text, .node-icon, .node-icon-background { pointer-events: none; }
.graph-node:focus { outline: none; }
.graph-node.is-highlighted .node-background { stroke: var(--outgoing); fill: #edf6ee; }
.graph-node.is-highlighted.is-incoming .node-background { stroke: var(--incoming); fill: #eff4fc; }
.graph-node:hover .node-background, .graph-node:focus-visible .node-background, .graph-node.is-selected .node-background { stroke: var(--cyan); stroke-width: 2.3; fill: #eaf6fa; }
.graph-node.is-risk .node-background { stroke: var(--amber); stroke-width: 2.2; fill: #fff3e4; }
.graph-node.is-risk { --node-accent: var(--amber); }
.graph-node.is-risk:focus-visible .node-background { stroke-width: 3; }
.node-port { visibility: hidden; pointer-events: none; }
.node-port text { font-family: var(--mono); }
.graph-node:is(.is-highlighted, :hover, :focus-visible) .node-port { visibility: visible; }
.edge-line { fill: none; stroke: var(--edge); stroke-width: 1.25; opacity: .65; }
.edge-hit { fill: none; stroke: transparent; stroke-width: 11; pointer-events: stroke; cursor: pointer; }
.graph-edge:hover .edge-line, .graph-edge.is-highlighted .edge-line { stroke: var(--outgoing); stroke-width: 2.15; opacity: 1; }
.graph-edge.is-incoming .edge-line { stroke: var(--incoming); }
.graph-edge.is-selected .edge-line { stroke: var(--cyan); stroke-width: 3; }
.arrow.filled { fill: var(--edge); }
.arrow.open { fill: none; stroke: var(--edge); }
.arrow-outgoing.filled { fill: var(--outgoing); }
.arrow-outgoing.open { fill: none; stroke: var(--outgoing); }
.arrow-incoming.filled { fill: var(--incoming); }
.arrow-incoming.open { fill: none; stroke: var(--incoming); }
.has-selection .graph-edge:not(.is-highlighted, :hover) { opacity: .27; }
.has-selection .graph-node:not(.is-highlighted, :hover, :focus-visible) { opacity: .32; }
.impact-mode .graph-edge:not(.is-highlighted) .edge-hit { pointer-events: none; }

.canvas-dock { position: absolute; inset: auto .8rem .75rem; display: flex; justify-content: space-between; align-items: end; gap: .5rem; pointer-events: none; }
.canvas-dock > * { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--card-shadow); pointer-events: auto; }
.canvas-legend { position: relative; font-size: .82rem; }
.canvas-legend summary { padding: .56rem .65rem; cursor: pointer; white-space: nowrap; }
#canvas-counts { color: var(--secondary); margin-inline-start: .45rem; font-size: .75rem; }
.legend-content { position: absolute; z-index: 1; inset: auto auto calc(100% + .45rem) 0; width: min(16rem, calc(100vw - 4rem)); padding: .7rem .75rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--card-shadow); color: var(--muted); }
.legend-scope { font-weight: 630; color: var(--text); }
.legend-content ul { display: grid; gap: .27rem; margin: .5rem 0; padding: 0; list-style: none; }
.legend-content li { display: flex; align-items: center; gap: .5rem; }
.legend-content li::before { content: ''; width: .85rem; height: .14rem; background: var(--outgoing); }
.legend-content .legend-incoming::before { background: var(--incoming); }
.legend-content .legend-risk::before { background: var(--amber); }
.zoom { display: flex; align-items: center; padding: .14rem; }
.zoom button { min-width: 2.15rem; color: var(--text); padding-inline: .5rem; }
.zoom button + button { border-inline-start-color: var(--soft-line); }
#zoom-level { min-width: 2.75rem; color: var(--secondary); font: .75rem var(--mono); text-align: center; }

.evidence-panel { min-width: 0; max-height: calc(var(--canvas-height) + 6.5rem); overflow-y: auto; padding: 1.25rem 1.2rem 1.35rem; }
.graph-workspace .evidence-panel { margin: .8rem .8rem .8rem 0; max-height: calc(var(--canvas-height) - 1.6rem); border: 1px solid var(--line); border-radius: 11px; background: var(--panel); box-shadow: var(--card-shadow); }
.clear-selection { float: right; margin: -.4rem -.35rem 0 .4rem; width: 2rem; height: 2rem; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 1.45rem; line-height: 1; }
.clear-selection:hover { background: var(--surface); color: var(--text); }
.evidence-panel:focus-visible { outline-offset: -3px; }
.evidence-panel h2 { font-size: 1.35rem; font-weight: 650; letter-spacing: var(--heading-tracking, -.02em); overflow-wrap: anywhere; }
.evidence-panel > .muted, .segment-evidence > .muted { font-size: .91rem; margin: .55rem 0 .85rem; }
.kicker { color: var(--cyan); text-transform: uppercase; font: 680 .75rem var(--mono); letter-spacing: .075em; margin-bottom: .6rem; }
:is(:lang(zh-CN), :lang(ja)) .kicker { font-family: inherit; }
.counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: 1.15rem 0; }
.counts div { display: flex; flex-direction: column-reverse; padding: .6rem .7rem; border-radius: 8px; border: 1px solid var(--soft-line); background: var(--surface); }
.counts dt { font-size: .75rem; color: var(--muted); }
.counts dd { font: 560 1.18rem var(--mono); color: var(--text); margin: 0 0 .2rem; }
.legend { display: grid; grid-template-columns: 1fr; gap: .4rem; padding: 0 0 .85rem; margin: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: .52rem; color: var(--muted); font-size: .86rem; }
.legend li::before { content: ''; width: .65rem; height: .65rem; border: 1px solid #88b79c; background: #eaf4ed; border-radius: .14rem; }
.legend .resource::before { border-color: #a1b8a8; background: #eff4ef; }
.legend .external::before { border-color: #b7a2ca; background: #f3ebfa; }
.revision { border-top: 1px solid var(--soft-line); padding: .75rem 0; color: var(--secondary); font-size: .82rem; }
.revision code { color: var(--muted); }
.panel-link { display: inline-block; color: var(--cyan); background: transparent; border: 0; padding: 0; font-size: .88rem; text-align: start; text-decoration: underline; text-underline-offset: .25em; }
.panel-link:hover { color: #bbf3ff; }
.graph-workspace .panel-link:hover { color: #134e61; }
.overview-actions { display: grid; justify-items: start; gap: .45rem; }
.panel-subtitle { margin: 1.1rem 0 .5rem; font-size: .89rem; font-weight: 660; }
.properties { display: grid; grid-template-columns: minmax(4rem, .8fr) minmax(0, 1.4fr); gap: .32rem .65rem; border-top: 1px solid var(--soft-line); margin: .6rem 0 .85rem; padding-top: .6rem; }
.properties dt { color: var(--secondary); font-size: .8rem; }
.properties dd { margin: 0; color: var(--text); font-size: .77rem; overflow-wrap: anywhere; }
.item-list { display: grid; list-style: none; gap: .35rem; margin: .4rem 0 .6rem; padding: 0; }
.item-button { width: 100%; display: flex; flex-wrap: wrap; gap: .12rem .45rem; justify-content: space-between; align-items: center; border: 1px solid #30475c; border-radius: 7px; color: var(--text); background: #112437; padding: .42rem .65rem; text-decoration: none; font-size: .85rem; text-align: start; min-height: 2.3rem; }
.item-button:hover, .item-button[aria-current] { color: var(--cyan); border-color: #4c88a4; background: #18374c; }
.graph-workspace .item-button { border-color: var(--line); background: var(--surface); }
.graph-workspace .item-button:hover, .graph-workspace .item-button[aria-current] { border-color: #9eb9a9; background: #e5f0e8; }
.item-button small { color: var(--muted); font-size: .75rem; }
.item-button .hop-pill { color: var(--cyan); font: 500 .72rem var(--mono); }
.impact-count { color: var(--amber); font-weight: 620; font-size: .89rem; margin-top: .55rem; }
.segment-evidence { margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--soft-line); }
.segment-evidence h2 { font-size: 1.04rem; }

.agent-layout {
  color-scheme: light;
  --panel: #fff;
  --text: #1d352b;
  --muted: #506459;
  --line: #d2dfd4;
  --soft-line: #e5ece6;
  --surface: #f2f7f3;
  --cyan: #235f47;
  --amber: #86501b;
  display: grid;
  grid-template-columns: minmax(10.75rem, 18%) minmax(0, 1fr);
  height: clamp(36rem, 47vw, 43rem);
  overflow: hidden;
  border-radius: 0 0 13px 13px;
  background: var(--panel);
  color: var(--text);
}
.chat-sidebar { min-width: 0; overflow: auto; padding: 1rem .85rem; border-inline-end: 1px solid var(--line); background: var(--surface); }
.chat-sidebar h2 { margin-bottom: .75rem; font-size: 1rem; }
.chat-new, .chat-send { min-height: 2.5rem; border: 1px solid var(--cyan); border-radius: 7px; padding: .45rem .7rem; font-size: .87rem; font-weight: 650; background: var(--cyan); color: #fff; }
.chat-new { width: 100%; }
.chat-new::before { content: '+'; margin-inline-end: .35rem; }
.chat-new:hover, .chat-send:hover:not(:disabled) { background: #184b38; }
.chat-history { display: grid; gap: .4rem; margin-top: .85rem; }
.chat-history p { color: var(--muted); font-size: .84rem; }
.chat-history-entry, .chat-preset, .chat-evidence-toggle { min-height: 2.25rem; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); padding: .4rem .58rem; color: var(--text); font-size: .83rem; text-align: start; }
.chat-history-entry:hover, .chat-preset:hover, .chat-evidence-toggle:hover:not(:disabled) { border-color: #95b6a4; background: #edf5ef; }
.chat-history-entry[aria-current], .chat-preset[aria-pressed='true'] { border-color: #83aa95; background: #e3f0e7; color: var(--cyan); }
.chat-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.chat-header { display: flex; justify-content: space-between; align-items: start; gap: .7rem; border-bottom: 1px solid var(--line); padding: .9rem clamp(.75rem, 2.5vw, 1.6rem); }
.chat-heading { min-width: 0; }
.chat-heading h2 { font-size: clamp(1.05rem, 2vw, 1.4rem); font-weight: 690; overflow-wrap: anywhere; }
.chat-context { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin-top: .4rem; color: var(--muted); font-size: .79rem; }
.simulation { display: inline-flex; border: 1px solid #e9d3b8; border-radius: 5px; background: #fbf2e3; padding: .11rem .4rem; color: var(--amber); font-size: .75rem; font-weight: 650; }
.chat-evidence-toggle { flex: none; }
.chat-evidence-toggle:disabled, .chat-send:disabled { cursor: default; }
.chat-evidence-toggle:disabled { color: #64746b; background: var(--surface); }
.chat-content { position: relative; display: flex; min-height: 0; }
.chat-log { min-width: 0; flex: 1; overflow: auto; }
.chat-log:focus-visible { outline-offset: -2px; }
.chat-thread { margin: 0 auto; width: min(100%, 57rem); padding: 1rem clamp(.85rem, 3vw, 1.8rem) 1.25rem; }
.chat-welcome { margin: clamp(1.2rem, 8vh, 4rem) 0 0; text-align: center; font-size: clamp(1.25rem, 2.4vw, 1.7rem); }
.chat-user { display: grid; justify-items: end; margin-bottom: 1rem; }
.chat-speaker { margin-bottom: .25rem; color: var(--muted); font-size: .77rem; }
.chat-bubble { max-width: min(88%, 34rem); border-radius: 12px 12px 3px 12px; background: #e3f0e7; padding: .6rem .85rem; font-size: .94rem; overflow-wrap: anywhere; }
.chat-agent-heading { display: flex; flex-wrap: wrap; gap: .4rem .55rem; align-items: center; margin-bottom: .7rem; font-size: .91rem; }
.chat-agent-icon { display: grid; place-items: center; width: 1.85rem; height: 1.85rem; border-radius: 7px; background: #e3f0e7; color: var(--cyan); }
.chat-status { color: var(--cyan); background: #e9f3ec; border-radius: 5px; padding: .13rem .42rem; font-size: .76rem; }
.chat-status.working::before { display: inline-block; content: ''; width: .38rem; height: .38rem; margin-inline-end: .32rem; border-radius: 50%; background: currentColor; animation: chat-pulse .9s alternate infinite; }
@keyframes chat-pulse { from { opacity: .3; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chat-status.working::before { animation: none; } }
.chat-progress, .chat-steps ol { margin: .45rem 0 0; padding-inline-start: 1.35rem; color: var(--muted); font-size: .9rem; }
.chat-progress li + li, .chat-steps li + li { margin-top: .25rem; }
.chat-response-section { margin-top: .75rem; }
.chat-response-section h3 { margin-bottom: .25rem; font-size: .92rem; }
.chat-response-section p { font-size: .91rem; }
.chat-response-section p + p { margin-top: .3rem; }
.chat-findings p:first-of-type { font-weight: 630; }
.chat-gap { border: 1px solid #eed9b6; border-radius: 8px; padding: .65rem .75rem; background: #fdf5e7; color: var(--amber); }
.chat-citations { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .53rem; }
.chat-citation, .chat-reference { border: 1px solid #bcd2c2; border-radius: 6px; background: #edf5ee; padding: .2rem .43rem; color: var(--cyan); font-size: .83rem; text-decoration: none; }
.chat-citation { font-family: var(--mono); }
.chat-citation:hover, .chat-reference:hover { background: #deede3; color: #184b38; text-decoration: underline; }
.chat-steps { margin-top: .75rem; color: var(--muted); font-size: .87rem; }
.chat-steps summary { cursor: pointer; }
.chat-evidence { flex: 0 0 min(30%, 16.5rem); min-width: 0; padding: .8rem; overflow: auto; border-inline-start: 1px solid var(--line); background: var(--surface); }
.chat-evidence-heading { display: flex; justify-content: space-between; align-items: center; gap: .3rem; }
.chat-evidence-heading h3 { font-size: .93rem; }
.chat-close { flex: none; width: 1.85rem; height: 1.85rem; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.chat-close:hover { border-color: var(--line); background: var(--panel); }
.chat-reference { display: block; margin-top: .45rem; padding: .4rem .55rem; overflow-wrap: anywhere; }
.chat-composer { min-width: 0; border-top: 1px solid var(--line); background: #f9fbf9; padding: .65rem clamp(.7rem, 2.8vw, 1.5rem) .85rem; }
.chat-questions, .chat-box { width: min(100%, 54rem); margin-inline: auto; }
.chat-questions { min-width: 0; padding: 0; border: 0; }
.chat-questions legend { padding: 0; color: var(--muted); font-size: .79rem; font-weight: 630; }
.chat-preset-list { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.chat-box { display: flex; align-items: end; gap: .55rem; margin-top: .55rem; padding: .4rem; border: 1px solid #b8cfc0; border-radius: 9px; background: var(--panel); }
.chat-box:focus-within { border-color: var(--cyan); }
.chat-message { flex: 1; min-width: 0; min-height: 2.65rem; resize: none; border: 0; padding: .35rem .45rem; color: var(--text); font: inherit; font-size: .91rem; }
.chat-message::placeholder { color: var(--muted); }
.chat-send { white-space: nowrap; }
.chat-send:disabled { border-color: #b7cbbf; background: #e1eae4; color: #526c5d; }

@media (max-width: 760px) {
  .agent-layout { height: auto; grid-template-columns: minmax(0, 1fr); }
  .chat-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .4rem; border-inline-end: 0; border-bottom: 1px solid var(--line); padding: .55rem .7rem; }
  .chat-sidebar h2 { margin: 0; font-size: .93rem; }
  .chat-new { width: auto; min-height: 2.15rem; }
  .chat-history { display: flex; grid-column: 1 / -1; margin-top: .15rem; overflow: auto; padding: .15rem; }
  .chat-history-entry { flex: 0 0 auto; max-width: 15rem; }
  .chat-main { height: clamp(36rem, 88vh, 44rem); }
  .chat-evidence { position: absolute; z-index: 1; inset: 0 0 0 auto; width: min(16rem, 85%); box-shadow: -3px 0 12px #23453417; }
}

.contact { display: flex; align-items: center; justify-content: space-between; gap: 1.15rem 2.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.2rem, 3.5vw, 2.5rem); margin-block: 3rem 3.7rem; }
.contact h2 { font-size: clamp(1.45rem, 2.7vw, 2.1rem); letter-spacing: var(--heading-tracking, -.035em); }
.contact p { color: var(--muted); margin-top: .43rem; max-width: 38rem; }
.contact-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #507994; border-radius: 7px; padding: .59rem .85rem; min-height: 2.6rem; text-decoration: none; color: #d9f5fd; font-size: .92rem; font-weight: 620; white-space: nowrap; }
.button:hover { background: #1e394e; }
.button.primary { color: #081825; background: var(--cyan); border-color: var(--cyan); }
.button.primary:hover { background: #a0edfc; }
:lang(ja) .button { white-space: normal; text-align: center; }
.footer { display: flex; align-items: center; justify-content: space-between; color: var(--secondary); border-top: 1px solid var(--soft-line); padding-block: 1.2rem 2rem; font-size: .87rem; }

.docs { max-width: 1120px; }
.doc-layout { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); gap: 2.5rem; }
.doc-nav { display: grid; align-self: start; position: sticky; top: 1rem; gap: .2rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.doc-nav a { color: var(--muted); font-size: .88rem; text-decoration: none; padding: .35rem 0; }
.doc-nav a:hover { color: var(--cyan); }
.doc-article { border-top: 1px solid var(--line); max-width: 51rem; }
.doc-article section { padding: 1.5rem 0 1.6rem; border-bottom: 1px solid var(--soft-line); scroll-margin-top: 1rem; }
.doc-article h2 { font-size: clamp(1.3rem, 2.5vw, 1.75rem); letter-spacing: var(--heading-tracking, -.025em); }
.doc-article p { color: var(--muted); margin-top: .8rem; }
.doc-article code { color: var(--cyan); font-size: .86em; }
.doc-article pre { overflow: auto; tab-size: 2; border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem; line-height: 1.65; background: var(--surface); }
.docs-index { max-width: 1280px; }
.docs-sections a { padding: .55rem .65rem; border-inline-start: 2px solid transparent; border-radius: 4px; }
.docs-sections a[aria-current="location"] { border-inline-start-color: var(--cyan); background: var(--surface); color: var(--cyan); font-weight: 650; }
.docs-index .doc-article { grid-column: 2; min-width: 0; scroll-margin-top: 1rem; }
.doc-panel-heading { padding: 1rem 0 1.25rem; border-bottom: 1px solid var(--soft-line); }
.doc-panel-heading h2 { font-size: clamp(1.6rem, 3.3vw, 2.3rem); }
.doc-panel-heading p { max-width: 45rem; }
.docs-index .doc-article h3 { font-size: clamp(1.3rem, 2.5vw, 1.75rem); letter-spacing: var(--heading-tracking, -.025em); }
.concept-reference { max-width: 62rem; }
.concept-nav { display: flex; flex-wrap: wrap; gap: .45rem 1rem; padding-block: .9rem; border-bottom: 1px solid var(--soft-line); font-size: .88rem; }
.engineering-model { max-width: 962px; min-width: 0; }
.engineering-figure { container-type: inline-size; margin: .9rem 0 0; }
.engineering-canvas { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.engineering-canvas svg { display: block; width: 100%; min-width: 960px; height: auto; }
.engineering-scroll-hint, .engineering-figure figcaption { color: var(--muted); font-size: .9rem; }
.engineering-scroll-hint { display: none; margin-bottom: .5rem; }
.engineering-figure figcaption { margin-top: .65rem; }
.engineering-terms { display: flex; flex-wrap: wrap; gap: .45rem 1.25rem; margin-top: .75rem; font-size: .95rem; }
@container (width < 962px) {
  .engineering-scroll-hint { display: block; }
}
@media print {
  .engineering-canvas { overflow: visible; }
  .engineering-canvas svg { min-width: 0; }
  .engineering-scroll-hint { display: none; }
}
.concept-walkthrough { display: grid; gap: .9rem; margin: .85rem 0 0; padding-inline-start: 1.35rem; }
.concept-walkthrough a { font-weight: 650; }
.concept-walkthrough p { margin-top: .25rem; }
.concept-search { padding-block: 1.25rem; border-bottom: 1px solid var(--soft-line); }
.concept-search label { display: block; font-weight: 650; font-size: .95rem; }
.concept-search input { width: 100%; max-width: 31rem; margin-top: .45rem; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); font: inherit; }
.concept-search input::placeholder { color: var(--muted); }
.concept-search p { margin-top: .4rem; font-size: .9rem; }
.concept-search p:empty { margin: 0; }
.concept-list { margin: .65rem 0 0; }
.concept-term { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: .3rem 1rem; padding: .8rem 0; border-bottom: 1px solid var(--soft-line); scroll-margin-top: 1rem; overflow-wrap: anywhere; }
.concept-term[hidden] { display: none; }
.concept-term:last-child { border-bottom: 0; }
.concept-term:target { border-inline-start: 2px solid var(--cyan); padding-inline-start: .65rem; }
.concept-term dt { font-weight: 650; }
.concept-term dd { color: var(--muted); margin: 0; }
.guide-index { display: inline-block; margin-bottom: .75rem; font-size: .92rem; font-weight: 600; }
.guide-links { display: grid; gap: .55rem; margin: .85rem 0 0; padding-inline-start: 1.25rem; }
.guide-diagram { margin: 1rem 0 0; padding: 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.guide-diagram figcaption { color: var(--muted); font-size: .87rem; margin-top: .8rem; }
.guide-paths { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.guide-paths li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; overflow-wrap: anywhere; }
.guide-paths strong { padding: .2rem .48rem; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); font-size: .87rem; }
.guide-paths span { color: var(--cyan); }
.guide-table { margin-top: 1rem; overflow-x: auto; }
.guide-table table { border-collapse: collapse; width: 100%; font-size: .93rem; }
.guide-table :is(th, td) { border: 1px solid var(--line); padding: .55rem .8rem; text-align: start; }
.guide-table th { background: var(--panel); }
.guide-table td { color: var(--muted); }

.solution-intro h1 { text-wrap: balance; }
.solution-actions { margin-top: 1.4rem; }

@media (max-width: 920px) {
  .demo-layout { grid-template-columns: minmax(0, 1fr); }
  .evidence-panel { max-height: none; overflow: visible; }
  .graph-workspace .evidence-panel { margin: .35rem .8rem .8rem; max-height: none; }
  .evidence-panel .counts { max-width: 22rem; }
  .properties { grid-template-columns: minmax(6rem, .6fr) minmax(0, 1.4fr); }
  .doc-layout { gap: 1.5rem; grid-template-columns: 11rem minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .graph-workspace { --canvas-height: clamp(22rem, 110vw, 28rem); }
  .masthead-inner { min-height: 3.75rem; grid-template-columns: minmax(0, 1fr) auto; }
  .masthead nav { grid-column: 1 / -1; grid-row: 2; gap: .55rem 1rem; flex-wrap: wrap; }
  .masthead nav > a, .use-case-menu summary { display: flex; align-items: center; min-height: 2.15rem; }
  .language-switch { grid-row: 1; grid-column: 2; }
  .use-case-options { max-height: calc(100dvh - 7.25rem); }
  .use-case-options ul { grid-template-columns: minmax(0, 1fr); }
  .map-controls { position: relative; inset: auto; margin: .6rem; }
  .toolbar { padding: .45rem .42rem; gap: .45rem; }
  .toolbar-actions { width: 100%; }
  .node-search { flex: 1 1 8rem; }
  .node-search input { font-size: 1rem; }
  .contact { flex-wrap: wrap; }
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 1.15rem; }
  .doc-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: .65rem; }
  .docs-sections a:first-child { grid-column: 1 / -1; }
  .docs-index .doc-article { grid-column: 1; }
  .concept-term { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 410px) {
  #canvas-counts { display: none; }
  .control-group { gap: .04rem; }
  .control-group button, .resource-button { padding-inline: .34rem; font-size: .8rem; }
  .masthead nav { gap: .45rem .65rem; }
  .masthead nav > a, .use-case-menu summary { font-size: .84rem; }
}

@media (max-width: 768px) {
  .use-case-menu { position: static; }
  .use-case-options { inset-block-start: 100%; inset-inline: 0; width: auto; transform: none; }
}
