:root {
  --ink: #101828;
  --muted: #667085;
  --paper: #f5f7fa;
  --panel: #ffffff;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --green: #2f5bd2;
  --green-soft: #edf3ff;
  --blue: #2f5bd2;
  --blue-soft: #edf3ff;
  --amber: #b54708;
  --amber-soft: #fff7ed;
  --red: #b42318;
  --red-soft: #fef3f2;
  --violet: #2f5bd2;
  --violet-soft: #edf3ff;
  --success: #067647;
  --success-soft: #ecfdf3;
  --shadow: 0 1px 2px rgb(16 24 40 / 5%);
  --radius: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a { color: inherit; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  padding: 9px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.brand strong { font-size: 15px; }
.brand small { color: var(--muted); font-size: 11px; }

.top-links { display: flex; gap: 8px; }
.top-links a {
  border: 0;
  border-radius: 7px;
  padding: 7px 10px;
  color: #475467;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.top-links a:hover { background: #f2f4f7; color: var(--ink); }

main { width: min(1480px, 100%); margin: 0 auto; padding: 32px clamp(18px, 4vw, 56px) 72px; }

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
}

.breadcrumb { display: flex; gap: 7px; margin: 0 0 10px; color: #98a2b3; font-size: 12px; }
.breadcrumb a { color: #475467; text-decoration: none; }
.page-heading h1 { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.page-heading-copy > p:last-child { max-width: 780px; margin: 9px 0 0; color: var(--muted); }
.runtime-state {
  display: grid;
  grid-template-columns: auto auto;
  gap: 1px 8px;
  align-items: center;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
  background: var(--panel);
  color: #344054;
  font-size: 12px;
  box-shadow: var(--shadow);
}
.runtime-state small { grid-column: 2; color: var(--muted); font-size: 10px; }
.runtime-dot { width: 8px; height: 8px; grid-row: 1 / 3; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }

.workflow-panel,
.overview-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.workflow-panel { margin-bottom: 16px; padding: 22px 24px 0; }
.overview-panel { padding: 22px 24px 18px; }
.panel-heading,
.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.panel-heading h2,
.workspace-heading h2 { margin: 2px 0 0; font-size: 19px; letter-spacing: -.015em; }
.panel-heading > p,
.workspace-heading > p { max-width: 620px; margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.section-label { margin: 0; color: var(--blue); font-size: 10px; font-weight: 750; letter-spacing: .09em; }
.workflow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 20px -24px 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.workflow-steps li { position: relative; min-width: 0; border-right: 1px solid var(--line); }
.workflow-steps li:last-child { border-right: 0; }
.workflow-steps li:not(:last-child)::after {
  position: absolute;
  z-index: 1;
  top: 26px;
  right: -9px;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #98a2b3;
  content: "→";
  font: 11px/16px sans-serif;
  text-align: center;
}
.workflow-steps a { display: block; min-height: 150px; padding: 19px 20px 17px; text-decoration: none; transition: background .15s; }
.workflow-steps a:hover { background: #f8faff; }
.workflow-number { display: block; color: #98a2b3; font: 650 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.workflow-steps strong { display: block; margin-top: 16px; font-size: 14px; }
.workflow-steps p { min-height: 40px; margin: 5px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.workflow-steps small { color: var(--blue); font-size: 10px; font-weight: 700; }
.workflow-note { margin: 0 -24px; border-top: 1px solid var(--line); padding: 11px 24px; background: #f8fafc; color: var(--muted); font-size: 11px; }
.workflow-note strong { margin-right: 8px; color: #344054; }

.workspace-heading { margin: 38px 0 14px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(460px, .95fr);
  gap: clamp(32px, 7vw, 96px);
  align-items: end;
  padding: 28px 0 48px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .18em;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(38px, 5vw, 66px);
  font-weight: 820;
  letter-spacing: -.055em;
  line-height: 1.08;
}

.hero-copy { max-width: 620px; margin: 22px 0 0; color: var(--muted); font-size: 16px; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; }
.summary-card {
  min-height: 92px;
  border-right: 1px solid var(--line);
  padding: 17px 18px;
  background: #fff;
}
.summary-card:last-child { border-right: 0; }
.summary-card strong { display: block; font-size: 25px; font-weight: 680; letter-spacing: -.035em; line-height: 1; }
.summary-card span { display: block; margin-top: 9px; color: #344054; font-size: 11px; font-weight: 650; }
.summary-card em { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-style: normal; }
.summary-card.skeleton { animation: pulse 1.5s infinite; background: linear-gradient(100deg, #f2f4f7 30%, #fcfcfd 50%, #f2f4f7 70%); background-size: 220% 100%; }

.notice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.notice {
  display: flex;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  background: #f8fafc;
}
.notice.secure,
.notice.assignment { border-color: var(--line); background: #f8fafc; }
.notice-icon { display: grid; width: 24px; height: 24px; flex: none; place-items: center; border-radius: 6px; background: #fff; color: var(--blue); font-size: 11px; font-weight: 800; box-shadow: inset 0 0 0 1px var(--line); }
.notice strong { color: #344054; font-size: 11px; }
.notice p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.save-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  background: #fff;
}
.save-panel p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.save-actions { display: flex; flex: none; gap: 8px; }
button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
button.primary { border-color: var(--blue); background: var(--blue); color: #fff; }
button.primary:hover:not(:disabled) { background: #2449ad; }
button:disabled { cursor: not-allowed; opacity: .48; }

.catalog-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }

.catalog-nav {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.nav-heading { display: flex; justify-content: space-between; padding: 8px 9px 10px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.catalog-nav nav { display: flex; flex-direction: column; gap: 3px; }
.catalog-nav a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-radius: 7px;
  padding: 9px;
  color: var(--muted);
  text-decoration: none;
}
.catalog-nav a:hover { background: #f2f4f7; color: var(--ink); }
.catalog-nav a span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-nav a span:last-child { border-radius: 999px; padding: 1px 7px; background: #f2f4f7; font-size: 10px; }

.toolbar {
  position: sticky;
  z-index: 10;
  top: 72px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 8px;
  margin-bottom: 18px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.search-field { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 10px; }
.search-field span { color: var(--muted); font-size: 20px; }
input, select { border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; }
input { width: 100%; border: 0; outline: 0; background: transparent; }
select { min-height: 38px; padding: 0 30px 0 10px; }
.setting-editor { display: flex; width: 100%; min-width: 0; gap: 8px; }
.setting-editor input,
.setting-editor select { width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; }
.setting-editor input { border: 1px solid var(--line); background: #fff; }
.setting-editor .clear-secret { flex: none; color: var(--red); }

.category-section { scroll-margin-top: 130px; margin-bottom: 34px; }
.category-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.category-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.category-heading p { max-width: 660px; margin: 5px 0 0; color: var(--muted); }
.category-count { flex: none; color: var(--muted); font-size: 12px; }

.parameter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.parameter-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--panel);
  box-shadow: 0 7px 24px rgb(30 39 35 / 4%);
}
.parameter-card.grouped-configuration {
  grid-column: 1 / -1;
  padding: clamp(20px, 3vw, 30px);
  border-color: #dcdedb;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 36px rgb(30 39 35 / 6%);
}
.memory-pipeline-card {
  grid-column: 1 / -1;
  overflow: hidden;
  padding: clamp(20px, 3vw, 30px);
  border-color: rgb(0 111 91 / 24%);
  border-radius: 20px;
  background:
    radial-gradient(circle at 98% 0, rgb(0 111 91 / 9%), transparent 24rem),
    #fff;
  box-shadow: 0 14px 42px rgb(30 39 35 / 7%);
}
.scene-flow-panel {
  grid-column: 1 / -1;
  padding: clamp(20px, 3vw, 30px);
  border-color: rgb(74 85 146 / 22%);
  border-radius: 20px;
  background: radial-gradient(circle at 100% 0, rgb(74 85 146 / 8%), transparent 25rem), #fff;
}
.scene-flow-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.scene-flow-header h3 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.scene-flow-header p { max-width: 760px; margin: 8px 0 0; color: var(--muted); }
.scene-flow-section-heading { margin-top: 26px; }
.scene-flow-section-heading h4 { margin: 0; font-size: 15px; }
.scene-flow-section-heading p { max-width: 820px; margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.scene-flow-issue-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.scene-flow-issue { min-width: 0; border: 1px solid var(--line); border-radius: 13px; padding: 15px; background: #f8f8f4; }
.scene-flow-issue > strong { display: block; margin-bottom: 8px; font-size: 13px; }
.scene-flow-score-rule { color: var(--muted); font-size: 11px; line-height: 1.65; }
.scene-flow-weight-formula { font-size: 13px; font-weight: 750; }
.scene-flow-issue p { margin: 0; color: #3f4945; font-size: 11px; line-height: 1.55; }
.scene-flow-config-note { margin: 14px 0 0; border-left: 3px solid var(--violet); padding: 8px 11px; background: var(--violet-soft); color: #505579; font-size: 10px; line-height: 1.6; }
.scene-flow-technical { margin-top: 12px; color: var(--muted); font-size: 10px; }
.scene-flow-technical summary { width: fit-content; cursor: pointer; font-weight: 750; }
.scene-flow-technical p { margin: 9px 0; line-height: 1.6; }
.scene-flow-technical dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 12px; margin: 0; }
.scene-flow-technical dt { color: #4f5854; font-weight: 750; }
.scene-flow-technical dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.scene-flow-section-heading.policy-heading { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 22px; }
.scene-flow-policy-list { display: grid; gap: 8px; margin-top: 22px; }
.scene-flow-policy { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.scene-flow-policy summary { font-size: 12px; font-weight: 780; cursor: pointer; }
.scene-flow-policy[open] summary { margin-bottom: 10px; }
.scene-flow-policy p { margin: 0 0 9px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.scene-flow-policy-explanation { margin: 10px 0; border-radius: 10px; padding: 12px; background: #f6f6f1; color: #3b4541; font-size: 10px; line-height: 1.65; }
.scene-flow-policy-explanation > strong { display: block; font-size: 11px; }
.scene-flow-policy-explanation ol { margin: 9px 0; padding-left: 20px; }
.scene-flow-policy-explanation li + li { margin-top: 5px; }
.scene-flow-policy .scene-flow-policy-note { margin: 9px 0 0; border-top: 1px solid var(--line); padding-top: 9px; color: #505579; }
.scene-flow-policy small { color: var(--muted); font-size: 9px; }
.memory-pipeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.memory-pipeline-header h3 { margin: 3px 0 0; font-size: 25px; letter-spacing: -.03em; }
.memory-pipeline-header p:last-child {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
}
.memory-pipeline-route {
  flex: none;
  border: 1px solid rgb(0 111 91 / 18%);
  border-radius: 999px;
  padding: 6px 11px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}
.memory-pipeline-section { margin-top: 28px; }
.memory-pipeline-section > h4,
.memory-section-heading h4,
.memory-formula-panel h4 {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: .01em;
}
.memory-context-overview {
  border: 1px solid rgb(47 91 210 / 18%);
  border-radius: 15px;
  padding: 18px;
  background: linear-gradient(135deg, #f7f9ff, #fff 62%);
}
.memory-context-summary { max-width: 900px; margin: 0; color: #35433e; font-size: 12px; line-height: 1.7; }
.memory-context-layers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 15px; }
.memory-context-layer { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 13px; background: #fff; }
.memory-context-layer-heading { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 7px; align-items: center; }
.memory-context-layer-heading > span { color: var(--blue); font: 800 9px/1 ui-monospace, monospace; }
.memory-context-layer-heading h5 { margin: 0; font-size: 12px; }
.memory-context-layer-heading em { color: var(--muted); font-size: 8px; font-style: normal; }
.memory-context-layer > p { margin: 9px 0 0; color: #535d59; font-size: 10px; line-height: 1.6; }
.memory-context-layer-controls { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 10px; }
.memory-context-layer-controls span { color: var(--muted); font-size: 8px; }
.memory-context-layer-controls strong { border-radius: 999px; padding: 3px 7px; background: var(--blue-soft); color: var(--blue); font-size: 8px; }
.memory-context-boundaries { margin-top: 12px; border-left: 3px solid var(--amber); padding: 9px 12px; background: var(--amber-soft); }
.memory-context-boundaries > strong { color: var(--amber); font-size: 10px; }
.memory-context-boundaries ul { display: grid; gap: 5px; margin: 7px 0 0; padding-left: 18px; color: #645633; font-size: 9px; line-height: 1.6; }
.memory-algorithm-overview {
  border: 1px solid rgb(0 111 91 / 18%);
  border-radius: 15px;
  padding: 17px;
  background: linear-gradient(135deg, var(--green-soft), #fbfcf8 58%);
}
.memory-overview-summary { max-width: 900px; margin: 0; color: #35433e; font-size: 12px; line-height: 1.7; }
.memory-overview-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin: 14px 0 0; }
.memory-overview-facts > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; border-top: 1px solid rgb(0 111 91 / 13%); padding: 9px 0; }
.memory-overview-facts dt { color: var(--green); font-size: 10px; font-weight: 800; }
.memory-overview-facts dd { margin: 0; color: #4c5854; font-size: 10px; line-height: 1.6; }
.memory-overview-exclusions { margin-top: 11px; border-left: 3px solid var(--amber); padding: 8px 11px; background: var(--amber-soft); }
.memory-overview-exclusions strong { color: var(--amber); font-size: 10px; }
.memory-overview-exclusions ul { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 6px 0 0; padding-left: 17px; color: #645633; font-size: 9px; line-height: 1.55; }
.memory-pipeline-stages {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.memory-pipeline-stage {
  position: relative;
  min-width: 0;
  border: 1px solid #e0e2dd;
  border-radius: 13px;
  padding: 14px;
  background: #f7f7f2;
}
.memory-pipeline-stage:not(:last-child)::after {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: -10px;
  width: 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  content: "→";
  font-size: 10px;
  line-height: 18px;
  text-align: center;
  transform: translateY(-50%);
}
.memory-pipeline-stage > span { color: var(--green); font: 800 10px/1 ui-monospace, monospace; }
.memory-pipeline-stage strong { display: block; margin-top: 13px; font-size: 13px; }
.memory-pipeline-stage p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.memory-stage-explanations { display: grid; gap: 6px; margin-top: 12px; }
.memory-stage-explanation { border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; background: #fff; }
.memory-stage-explanation summary { display: grid; grid-template-columns: 30px 120px minmax(0, 1fr); gap: 8px; align-items: baseline; cursor: pointer; }
.memory-stage-explanation summary > span:first-child { color: var(--green); font: 800 9px/1 ui-monospace, monospace; }
.memory-stage-explanation summary strong { font-size: 11px; }
.memory-stage-explanation summary > span:last-child { color: var(--muted); font-size: 10px; line-height: 1.55; }
.memory-stage-explanation dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin: 10px 0 0; border-top: 1px solid var(--line); padding-top: 4px; }
.memory-stage-explanation dl > div { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; padding: 6px 0; }
.memory-stage-explanation dt { color: var(--green); font-size: 9px; font-weight: 800; }
.memory-stage-explanation dd { margin: 0; color: #4e5955; font-size: 9px; line-height: 1.55; }
.memory-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.memory-section-heading h4 { margin-bottom: 4px; }
.memory-section-heading p { max-width: 760px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.memory-section-heading a { color: var(--blue); font-size: 11px; text-decoration: none; }
.memory-control-groups { display: grid; gap: 12px; margin-top: 14px; }
.memory-control-group { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #f8fafc; }
.memory-control-group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 11px; }
.memory-control-group-heading h5 { margin: 0; font-size: 13px; }
.memory-control-group-heading p { max-width: 700px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; text-align: right; }
.memory-business-controls { display: grid; gap: 10px; }
.memory-business-controls.long_memory { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.memory-business-controls.reply_context { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.memory-control-card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; padding: 15px; }
.memory-control-label { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.memory-control-label > span {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}
.memory-control-label h6 { margin: 0; font-size: 13px; }
.memory-control-description,
.memory-control-recommendation { margin: 0 0 8px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.memory-control-recommendation { color: var(--ink); }
.memory-control-options { display: grid; gap: 6px; }
.memory-control-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, .48fr);
  gap: 8px;
  align-items: start;
  min-height: 35px;
  border-radius: 9px;
  padding: 7px 9px;
  background: #f5f5ef;
}
.memory-control-option.default { background: var(--green-soft); }
.memory-control-option.active { box-shadow: inset 3px 0 0 var(--green); }
.memory-system-default-editor {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  border-radius: 11px;
  padding: 12px;
  background: var(--blue-soft);
}
.memory-system-default-editor > strong { color: var(--blue); font-size: 11px; }
.memory-control-option-copy { min-width: 0; }
.memory-control-option-copy strong { font-size: 10px; }
.memory-control-option-copy p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.memory-control-option-meta { display: flex; min-width: 0; flex-wrap: wrap; gap: 4px 6px; justify-content: flex-end; text-align: right; }
.memory-control-option-meta > span { width: 100%; overflow-wrap: anywhere; color: #535d59; font-size: 8px; line-height: 1.45; }
.memory-control-option em {
  border-radius: 999px;
  padding: 2px 6px;
  background: #fff;
  color: var(--green);
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}
.memory-control-options.recall_count { grid-template-columns: 1fr; }
.memory-diagnostics { display: grid; gap: 22px; }
.memory-technical-panel { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #f8fafc; }
.memory-technical-panel > summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; cursor: pointer; }
.memory-technical-panel > summary::before { flex: none; content: "＋"; color: var(--blue); font-weight: 800; }
.memory-technical-panel[open] > summary::before { content: "−"; }
.memory-technical-panel > summary strong { font-size: 12px; }
.memory-technical-panel > summary span { color: var(--muted); font-size: 9px; }
.memory-technical-panel[open] > summary { margin-bottom: 18px; }
.memory-formula-panel { min-width: 0; }
.memory-formula-introduction { max-width: 820px; margin: -5px 0 13px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.memory-formula-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.memory-formula-card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; padding: 15px; background: #fafaf6; }
.memory-formula-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.memory-formula-heading h5 { margin: 0; font-size: 12px; }
.memory-formula-heading span { color: var(--green); font-size: 9px; font-weight: 750; }
.memory-formula-card > code { display: block; overflow-wrap: anywhere; margin-top: 10px; border-radius: 9px; padding: 10px; background: #edf6f1; color: var(--green); font: 10px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.memory-formula-purpose { margin: 10px 0; color: #3f4b47; font-size: 10px; line-height: 1.65; }
.memory-formula-variables { display: grid; gap: 5px; margin: 0; border-top: 1px solid var(--line); padding-top: 9px; }
.memory-formula-variables > div { display: grid; grid-template-columns: minmax(90px, .45fr) minmax(0, 1fr); gap: 9px; }
.memory-formula-variables dt { overflow-wrap: anywhere; color: var(--green); font: 9px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.memory-formula-variables dd { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.memory-formula-interpretation { margin: 10px 0 0; color: #4c5753; font-size: 9px; line-height: 1.6; }
.memory-formula-range { margin: 7px 0 0; color: var(--green); font-size: 9px; font-weight: 750; }
.memory-implementation-panel { border: 1px solid var(--line); border-radius: 14px; padding: 15px; background: #fafaf6; }
.memory-implementation-panel summary { font-size: 12px; font-weight: 760; cursor: pointer; }
.memory-implementation-panel[open] summary { margin-bottom: 10px; }
.memory-implementation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.memory-implementation-row { min-width: 0; border-top: 1px solid #e7e8e2; padding: 11px 0; }
.memory-implementation-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.memory-implementation-heading span { color: #34403c; font-size: 10px; font-weight: 800; }
.memory-implementation-heading code { overflow-wrap: anywhere; color: var(--green); font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.memory-implementation-row small { display: block; margin-top: 3px; color: var(--blue); font-size: 8px; }
.memory-implementation-row p { margin: 7px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.memory-implementation-row .memory-implementation-impact { color: #4b5652; }
.memory-implementation-panel > p { margin: 10px 0 0; border-top: 1px solid var(--line); padding-top: 10px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.memory-pipeline-footer { display: grid; gap: 7px; margin: 24px 0 0; border-top: 1px solid var(--line); padding-top: 15px; }
.memory-pipeline-footer > div { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 10px; }
.memory-pipeline-footer dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.memory-pipeline-footer dd { margin: 0; color: #535d59; font-size: 10px; }
.evaluation-pipeline-card {
  grid-column: 1 / -1;
  overflow: hidden;
  padding: clamp(20px, 3vw, 30px);
  border-color: rgb(105 80 181 / 24%);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0, rgb(105 80 181 / 9%), transparent 25rem),
    #fff;
  box-shadow: 0 14px 42px rgb(30 39 35 / 7%);
}
.evaluation-pipeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.evaluation-pipeline-header h3 { margin: 3px 0 0; font-size: 25px; letter-spacing: -.03em; }
.evaluation-pipeline-header p:last-child {
  max-width: 790px;
  margin: 8px 0 0;
  color: var(--muted);
}
.evaluation-pipeline-route {
  flex: none;
  border: 1px solid rgb(105 80 181 / 18%);
  border-radius: 999px;
  padding: 6px 11px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 10px;
  font-weight: 800;
}
.evaluation-pipeline-section { margin-top: 28px; }
.evaluation-pipeline-section > h4,
.evaluation-section-heading h4 {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: .01em;
}
.evaluation-pipeline-overview {
  border: 1px solid rgb(105 80 181 / 18%);
  border-radius: 15px;
  padding: 17px;
  background: linear-gradient(135deg, var(--violet-soft), #fbfcf8 62%);
}
.evaluation-overview-summary {
  max-width: 950px;
  margin: 0;
  color: #3f3b51;
  font-size: 12px;
  line-height: 1.7;
}
.evaluation-overview-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
  margin: 14px 0 0;
}
.evaluation-overview-facts > div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  border-top: 1px solid rgb(105 80 181 / 13%);
  padding: 9px 0;
}
.evaluation-overview-facts dt { color: var(--violet); font-size: 10px; font-weight: 800; }
.evaluation-overview-facts dd { margin: 0; color: #53505e; font-size: 10px; line-height: 1.6; }
.evaluation-boundaries {
  margin-top: 11px;
  border-left: 3px solid var(--amber);
  padding: 9px 11px;
  background: var(--amber-soft);
}
.evaluation-boundaries strong { color: var(--amber); font-size: 10px; }
.evaluation-boundaries ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 24px;
  margin: 7px 0 0;
  padding-left: 17px;
  color: #645633;
  font-size: 9px;
  line-height: 1.55;
}
.evaluation-pipeline-stages {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.evaluation-pipeline-stage {
  position: relative;
  min-width: 0;
  border: 1px solid #e0e2dd;
  border-radius: 13px;
  padding: 14px;
  background: #f7f7f2;
}
.evaluation-pipeline-stage.relation { background: #f1f6ff; }
.evaluation-pipeline-stage.impression { background: #f6f1ff; }
.evaluation-pipeline-stage:not(:last-child)::after {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: -10px;
  width: 18px;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  content: "→";
  font-size: 10px;
  line-height: 18px;
  text-align: center;
  transform: translateY(-50%);
}
.evaluation-pipeline-stage > span {
  color: var(--violet);
  font: 800 10px/1 ui-monospace, monospace;
}
.evaluation-pipeline-stage strong { display: block; margin-top: 13px; font-size: 13px; }
.evaluation-pipeline-stage p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.evaluation-stage-explanations { display: grid; gap: 6px; margin-top: 12px; }
.evaluation-stage-explanation {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  background: #fff;
}
.evaluation-stage-explanation summary {
  display: grid;
  grid-template-columns: 30px 130px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  cursor: pointer;
}
.evaluation-stage-explanation summary > span:first-child {
  color: var(--violet);
  font: 800 9px/1 ui-monospace, monospace;
}
.evaluation-stage-explanation summary strong { font-size: 11px; }
.evaluation-stage-explanation summary > span:last-child {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.evaluation-stage-explanation dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  margin: 10px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}
.evaluation-stage-explanation dl > div {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
}
.evaluation-stage-explanation dt { color: var(--violet); font-size: 9px; font-weight: 800; }
.evaluation-stage-explanation dd {
  margin: 0;
  color: #4e5955;
  font-size: 9px;
  line-height: 1.55;
}
.evaluation-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.evaluation-section-heading p {
  max-width: 690px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}
.evaluation-parameter-groups { display: grid; gap: 12px; }
.evaluation-parameter-group {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 17px;
  background: #fafaf6;
}
.evaluation-parameter-group.relation { border-color: rgb(49 87 213 / 20%); }
.evaluation-parameter-group.impression { border-color: rgb(105 80 181 / 22%); }
.evaluation-parameter-group h5 { margin: 0; font-size: 13px; }
.evaluation-parameter-group > p {
  margin: 5px 0 13px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}
.evaluation-parameter-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.evaluation-parameter {
  min-width: 0;
  border: 1px solid #e1e2dc;
  border-radius: 12px;
  padding: 13px;
  background: #fff;
}
.evaluation-parameter-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.evaluation-parameter-header > div { min-width: 0; }
.evaluation-parameter-header code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
  font: 8px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.evaluation-parameter-header strong { display: block; margin-top: 3px; font-size: 11px; }
.evaluation-parameter-value {
  overflow: auto;
  max-height: 180px;
  margin: 10px 0;
  border-radius: 9px;
  padding: 9px 10px;
  background: var(--violet-soft);
  color: #55428b;
  font: 9px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}
.evaluation-parameter dl { display: grid; gap: 6px; margin: 0; }
.evaluation-parameter dl > div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
}
.evaluation-parameter dt { color: var(--violet); font-size: 9px; font-weight: 800; }
.evaluation-parameter dd { margin: 0; color: #535d59; font-size: 9px; line-height: 1.6; }
.evaluation-parameter-implementation {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 9px;
}
.evaluation-parameter-implementation summary { cursor: pointer; font-weight: 750; }
.evaluation-parameter-implementation p { margin: 7px 0; line-height: 1.55; }
.evaluation-parameter-implementation code {
  display: block;
  overflow-wrap: anywhere;
  color: #535d59;
  white-space: normal;
}
.evaluation-destination-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.evaluation-destination-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px;
  background: #f8f8f4;
}
.evaluation-destination-grid span {
  color: var(--violet);
  font: 800 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.evaluation-destination-grid strong { display: block; margin-top: 10px; font-size: 11px; }
.evaluation-destination-grid p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}
.evaluation-pipeline-footer {
  display: grid;
  gap: 7px;
  margin: 24px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
.evaluation-pipeline-footer > div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
}
.evaluation-pipeline-footer dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.evaluation-pipeline-footer dd { margin: 0; color: #535d59; font-size: 10px; }
.grouped-configuration .parameter-name { font-size: 23px; letter-spacing: -.025em; }
.grouped-configuration .parameter-head { align-items: center; }
.grouped-configuration .parameter-description {
  max-width: 780px;
  min-height: 0;
  margin: 0 0 22px;
  color: var(--muted);
}
.parameter-card.warning { border-color: rgb(156 101 0 / 40%); box-shadow: inset 3px 0 0 var(--amber); }
.parameter-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.parameter-id { margin: 0 0 2px; color: var(--muted); font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.parameter-name { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.badge { border-radius: 999px; padding: 3px 7px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.badge.env { background: var(--blue-soft); color: var(--blue); }
.badge.external_json { background: var(--violet-soft); color: var(--violet); }
.badge.code { background: #ecebe4; color: #535c57; }
.badge.derived { background: var(--green-soft); color: var(--green); }
.badge.policy { background: var(--amber-soft); color: var(--amber); }
.badge.configured { background: var(--green-soft); color: var(--green); }
.badge.unconfigured, .badge.invalid, .badge.warning { background: var(--amber-soft); color: var(--amber); }
.badge.deprecated { background: var(--red-soft); color: var(--red); }
.badge.sensitive { background: #202825; color: #fff; }

.value-block { margin: 16px 0 14px; border: 1px solid #e1e0d8; border-radius: 11px; padding: 10px 12px; background: #f4f3ed; }
.value-block > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.parameter-value { max-height: 160px; overflow: auto; margin: 0; color: #24322d; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.effective-model { margin: 7px 0 0; border-top: 1px solid var(--line); padding-top: 7px; color: var(--green); font-size: 11px; }
.grouped-configuration .value-block {
  margin: 18px 0 20px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}
.grouped-configuration .value-block > .value-label {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: .08em;
}
.configuration-fields { display: block; margin: 0; }
.configuration-fields[hidden] { display: none; }
.provider-route-line {
  display: inline-flex;
  margin: 0 0 20px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #f0f1ef;
  color: #626b67;
  font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.provider-field-list { display: grid; gap: 16px; }
.provider-field { min-width: 0; }
.provider-field-label {
  display: flex;
  min-height: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}
.provider-field-label strong { font-size: 13px; font-weight: 720; }
.provider-field-state { font-size: 10px; font-weight: 750; }
.provider-field-state.configured { color: var(--green); }
.provider-field-state.unconfigured,
.provider-field-state.warning { color: var(--amber); }
.provider-field-control {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  border: 1px solid #d8dbd8;
  border-radius: 13px;
  padding: 12px 15px;
  background: #fff;
  box-shadow: 0 2px 7px rgb(30 39 35 / 5%);
}
.provider-field.warning .provider-field-control {
  border-color: rgb(156 101 0 / 52%);
  background: #fffbf0;
}
.provider-field-control code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #1d2522;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}
.provider-field-control.secret code { letter-spacing: .12em; }
.provider-field-lock {
  display: grid;
  width: 26px;
  height: 26px;
  flex: none;
  place-items: center;
  border-radius: 999px;
  background: #f0f1ef;
  color: #818985;
  font-size: 7px;
}
.provider-advanced {
  margin-top: 22px;
  border-top: 1px solid #e4e6e3;
  padding-top: 16px;
}
.provider-advanced summary {
  width: fit-content;
  color: #343d39;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.provider-advanced[open] summary { margin-bottom: 16px; }
.provider-field-list.advanced { border-radius: 14px; padding: 16px; background: #f6f7f5; }
.provider-config-tip {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-top: 22px;
  border: 1px solid #ecd99f;
  border-radius: 13px;
  padding: 13px 15px;
  background: #fff9e8;
  color: #8a5a00;
}
.provider-config-tip > span {
  display: grid;
  width: 21px;
  height: 21px;
  flex: none;
  place-items: center;
  border-radius: 999px;
  background: #f6df95;
  font-size: 11px;
  font-weight: 850;
}
.provider-config-tip p { margin: 0; font-size: 11px; line-height: 1.65; }
.parameter-description { min-height: 44px; margin: 0 0 14px; color: #3f4945; }

.parameter-details { display: grid; gap: 9px; margin: 0; }
.parameter-details > div { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 9px; }
.parameter-details dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.parameter-details dd { margin: 0; color: #535d59; font-size: 11px; word-break: break-word; }
.parameter-formula { border-radius: 7px; padding: 5px 7px; background: var(--green-soft); color: var(--green) !important; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.usage-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.usage-details summary { color: var(--blue); font-size: 11px; cursor: pointer; }
.usage-list { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 11px; }

.loading-state, .empty-state, .error-state { display: grid; min-height: 260px; place-items: center; align-content: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.loading-ring { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.error-state strong { color: var(--red); }
.error-state button { border: 0; border-radius: 8px; padding: 8px 13px; background: var(--ink); color: #fff; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(4, 1fr); }
  .summary-card { min-height: 104px; padding: 16px; }
  .catalog-shell { grid-template-columns: 1fr; }
  .catalog-nav { position: static; max-height: none; }
  .catalog-nav nav { display: grid; grid-template-columns: repeat(4, 1fr); }
  .memory-pipeline-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .memory-pipeline-stage::after { display: none; }
  .evaluation-pipeline-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .evaluation-pipeline-stage::after { display: none; }
  .memory-context-layers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .memory-business-controls.long_memory { grid-template-columns: 1fr 1fr; }
  .memory-business-controls.long_memory .memory-control-card:last-child { grid-column: 1 / -1; }
  .scene-flow-issue-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .topbar { align-items: flex-start; padding: 10px 14px; }
  .top-links { gap: 4px; }
  .top-links a { padding: 6px 8px; font-size: 11px; }
  main { padding: 28px 14px 56px; }
  h1 { font-size: 39px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .notice-grid { grid-template-columns: 1fr; }
  .save-panel { align-items: stretch; flex-direction: column; }
  .save-actions { width: 100%; }
  .save-actions button { flex: 1; }
  .catalog-nav nav { grid-template-columns: repeat(2, 1fr); }
  .toolbar { position: static; grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; min-height: 38px; border: 1px solid var(--line); border-radius: 9px; }
  .parameter-grid { grid-template-columns: 1fr; }
  .parameter-description { min-height: 0; }
  .parameter-card.grouped-configuration { padding: 20px 16px; border-radius: 16px; }
  .grouped-configuration .parameter-name { font-size: 20px; }
  .provider-field-control { min-height: 46px; padding: 10px 12px; }
  .memory-pipeline-card { padding: 20px 16px; border-radius: 16px; }
  .evaluation-pipeline-card { padding: 20px 16px; border-radius: 16px; }
  .scene-flow-panel { padding: 20px 16px; border-radius: 16px; }
  .scene-flow-issue-grid { grid-template-columns: 1fr; }
  .memory-pipeline-header { flex-direction: column; gap: 12px; }
  .evaluation-pipeline-header { flex-direction: column; gap: 12px; }
  .memory-pipeline-stages { grid-template-columns: 1fr 1fr; }
  .evaluation-pipeline-stages { grid-template-columns: 1fr 1fr; }
  .memory-overview-facts,
  .memory-formula-grid,
  .memory-implementation-grid,
  .memory-stage-explanation dl { grid-template-columns: 1fr; }
  .evaluation-overview-facts,
  .evaluation-boundaries ul,
  .evaluation-stage-explanation dl,
  .evaluation-parameter-list,
  .evaluation-destination-grid { grid-template-columns: 1fr; }
  .evaluation-section-heading { align-items: flex-start; flex-direction: column; gap: 0; }
  .memory-business-controls,
  .memory-diagnostics { grid-template-columns: 1fr; }
  .memory-business-controls.long_memory,
  .memory-business-controls.reply_context,
  .memory-context-layers { grid-template-columns: 1fr; }
  .memory-business-controls.long_memory .memory-control-card:last-child { grid-column: auto; }
  .memory-control-group-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .memory-control-group-heading p { text-align: left; }
}

@media (max-width: 430px) {
  .brand small { display: none; }
  .top-links a:first-child { display: none; }
  .summary-card strong { font-size: 27px; }
  .catalog-nav nav { grid-template-columns: 1fr; }
  .parameter-head { flex-direction: column; }
  .badges { justify-content: flex-start; }
  .memory-pipeline-stages { grid-template-columns: 1fr; }
  .evaluation-pipeline-stages { grid-template-columns: 1fr; }
  .memory-section-heading { align-items: flex-start; flex-direction: column; }
  .memory-stage-explanation summary { grid-template-columns: 28px minmax(0, 1fr); }
  .memory-stage-explanation summary > span:last-child { grid-column: 2; }
  .evaluation-stage-explanation summary { grid-template-columns: 28px minmax(0, 1fr); }
  .evaluation-stage-explanation summary > span:last-child { grid-column: 2; }
  .evaluation-parameter dl > div { grid-template-columns: 1fr; gap: 2px; }
  .memory-formula-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .memory-formula-variables > div { grid-template-columns: 1fr; gap: 2px; }
  .memory-control-option { grid-template-columns: 1fr; }
  .memory-control-option-meta { justify-content: flex-start; text-align: left; }
  .memory-technical-panel > summary { align-items: flex-start; flex-direction: column; gap: 3px; }
}

/* Unified operations-console surface */
.parameter-card,
.parameter-card.grouped-configuration,
.memory-pipeline-card,
.scene-flow-panel,
.evaluation-pipeline-card {
  border-color: var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.parameter-card { padding: 17px; }
.parameter-card.grouped-configuration,
.memory-pipeline-card,
.scene-flow-panel,
.evaluation-pipeline-card { padding: 22px; }

.memory-pipeline-header h3,
.scene-flow-header h3,
.evaluation-pipeline-header h3,
.grouped-configuration .parameter-name { font-size: 20px; font-weight: 680; letter-spacing: -.02em; }

.memory-pipeline-route,
.evaluation-pipeline-route {
  border-color: #d5e2ff;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
}

.memory-algorithm-overview,
.evaluation-pipeline-overview,
.scene-flow-issue,
.scene-flow-policy-explanation,
.memory-pipeline-stage,
.evaluation-pipeline-stage,
.evaluation-pipeline-stage.relation,
.evaluation-pipeline-stage.impression,
.memory-formula-card,
.memory-implementation-panel,
.evaluation-parameter-group,
.evaluation-destination-grid article {
  border-color: var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.memory-pipeline-stage,
.evaluation-pipeline-stage { background: #fff; }
.memory-pipeline-stage:not(:last-child)::after,
.evaluation-pipeline-stage:not(:last-child)::after { background: var(--blue); }
.memory-overview-facts > div,
.evaluation-overview-facts > div { border-top-color: var(--line); }
.memory-overview-facts dt,
.evaluation-overview-facts dt,
.memory-stage-explanation dt,
.evaluation-stage-explanation dt,
.evaluation-parameter dt { color: var(--blue); }

.memory-overview-exclusions,
.evaluation-boundaries {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.memory-system-default-editor { border: 1px solid #d5e2ff; border-radius: 8px; background: #f7f9ff; }
.memory-control-card,
.memory-stage-explanation,
.evaluation-stage-explanation,
.evaluation-parameter,
.scene-flow-policy,
.provider-field-control { border-radius: 8px; box-shadow: none; }
.memory-control-option { border-radius: 7px; background: #f2f4f7; }
.memory-control-option.default { background: var(--blue-soft); }
.memory-control-option.active { box-shadow: inset 3px 0 0 var(--blue); }
.memory-control-label > span { border-radius: 5px; background: var(--blue); }
.memory-formula-card > code { border-radius: 6px; background: var(--blue-soft); color: var(--blue); }
.evaluation-parameter-value { border-radius: 6px; background: var(--blue-soft); color: #2449ad; }

.scene-flow-config-note { border-left-color: var(--blue); background: var(--blue-soft); color: #344e8c; }

.value-block { border-color: var(--line); border-radius: 8px; background: #f8fafc; }
.provider-route-line { border-radius: 6px; background: #f2f4f7; color: #475467; }
.provider-field-list { gap: 13px; }
.provider-field-control { min-height: 46px; border-color: var(--line); padding: 10px 12px; }
.provider-field-control:focus-within { border-color: #84adff; box-shadow: 0 0 0 3px rgb(47 91 210 / 10%); }
.provider-advanced { border-top-color: var(--line); }
.provider-field-list.advanced { border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.provider-config-tip { border-radius: 8px; }

.badge { border-radius: 5px; font-weight: 700; }
.badge.configured { background: var(--success-soft); color: var(--success); }
.provider-field-state.configured { color: var(--success); }
.effective-model { color: var(--blue); }
.parameter-formula { background: var(--blue-soft); color: var(--blue) !important; }
.usage-details summary { color: var(--blue); }

.scene-flow-section-heading p,
.scene-flow-issue p,
.scene-flow-policy p,
.memory-overview-summary,
.evaluation-overview-summary,
.memory-control-description,
.memory-control-recommendation,
.memory-formula-purpose,
.memory-implementation-row p,
.evaluation-parameter-group > p,
.evaluation-parameter dd,
.evaluation-destination-grid p { font-size: 11px; }

.memory-pipeline-section,
.evaluation-pipeline-section { margin-top: 24px; }
.memory-pipeline-section > h4,
.memory-section-heading h4,
.memory-formula-panel h4,
.evaluation-pipeline-section > h4,
.evaluation-section-heading h4,
.scene-flow-section-heading h4 { font-size: 14px; }

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible { outline: 3px solid rgb(47 91 210 / 18%); outline-offset: 2px; }

.context-card { grid-column: 1 / -1; }
.context-flow > p { color: var(--muted); }
.context-flow > summary { display: flex; gap: 12px; align-items: center; justify-content: space-between; cursor: pointer; }
.context-flow > summary::before { content: "＋"; color: var(--blue); }
.context-flow[open] > summary::before { content: "−"; }
.context-flow > summary h3 { flex: 1; margin: 0; }
.context-flow > summary small { color: var(--muted); white-space: nowrap; }
.context-actions, .context-order { display: flex; gap: 8px; flex-wrap: wrap; }
.context-actions { margin: 16px 0; }
.context-modules { padding-left: 24px; }
.context-modules > li { padding: 14px 0; border-top: 1px solid var(--line); }
.context-module-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.context-module-header label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.context-module-header input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--blue); }
.context-order { flex-shrink: 0; }
.context-module-description { margin: 6px 0; color: var(--muted); }
.context-module-details > summary { color: var(--blue); cursor: pointer; }
.context-prompt-editor { display: block; width: 100%; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.context-prompt-editor:disabled { background: #f8fafc; color: var(--muted); }
.context-disabled .context-module-header label { color: var(--muted); }
.context-card pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 400px; overflow-y: auto; padding: 14px; background: var(--paper); }
.context-card details { margin-top: 8px; }
.context-card button { padding: 5px 10px; }

@media (max-width: 1050px) {
  .workflow-steps { grid-template-columns: repeat(5, minmax(190px, 1fr)); overflow-x: auto; }
  .workflow-steps li { border-bottom: 0; }
}

@media (max-width: 760px) {
  .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .page-heading h1 { font-size: 28px; }
  .runtime-state { width: 100%; }
  .workflow-panel { padding: 18px 16px 0; }
  .overview-panel { padding: 18px 16px 16px; }
  .panel-heading,
  .workspace-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .panel-heading > p,
  .workspace-heading > p { text-align: left; }
  .workflow-steps { margin: 17px -16px 0; }
  .workflow-note { margin: 0 -16px; padding: 11px 16px; }
  .summary-card { border-bottom: 1px solid var(--line); }
  .summary-card:nth-child(2n) { border-right: 0; }
  .summary-card:nth-last-child(-n + 2) { border-bottom: 0; }
  .notice-grid { grid-template-columns: 1fr; }
  .parameter-card.grouped-configuration,
  .memory-pipeline-card,
  .evaluation-pipeline-card,
  .scene-flow-panel { padding: 18px 15px; border-radius: 10px; }
}

@media (max-width: 430px) {
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card,
  .summary-card:nth-child(2n),
  .summary-card:nth-last-child(-n + 2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .summary-card:last-child { border-bottom: 0; }
  .workflow-steps { grid-template-columns: repeat(5, 180px); }
  .save-actions { flex-direction: column-reverse; }
}

.context-module-name { border: 0; background: transparent; color: var(--text, #172033); font: inherit; font-weight: 700; text-align: left; padding: 0.3rem; cursor: pointer; }
.context-module-name:hover { color: #3159d7; text-decoration: underline; }
.context-module-header > label { flex: 0 0 auto; }
.context-module-header > .context-module-name { flex: 1; }
.prompt-dialog { width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid #dce2ef; border-radius: 16px; padding: 0; color: #172033; }
.prompt-dialog::backdrop { background: rgb(15 23 42 / 45%); }
.prompt-dialog-content { padding: 24px; }
.prompt-dialog-content h2 { margin: 16px 0; }
.prompt-dialog-content pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f6f8fc; padding: 14px; border-radius: 8px; }
.prompt-dialog-content details { margin: 14px 0; }
.prompt-slot { padding: 16px 0; border-top: 1px solid #dce2ef; }
.prompt-slot textarea { box-sizing: border-box; width: 100%; }
.prompt-placeholders > li { margin: 6px 0; }
.prompt-placeholders code { padding: 1px 6px; border-radius: 4px; background: var(--blue-soft); color: #22346b; }
.prompt-previews { padding: 16px 0; border-top: 1px solid #dce2ef; }
.prompt-preview summary { cursor: pointer; color: #41516f; }
.context-module-kind { border-radius: 999px; padding: 2px 8px; background: var(--blue-soft); color: var(--blue); font-weight: 500; }
.prompt-callers { columns: 2; margin: 0 0 8px; padding-left: 20px; }
.prompt-links p { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.prompt-links button { padding: 3px 9px; }
.prompt-save-status { color: #41516f; min-height: 1.4em; }
.prompt-conflict { background: #fff6e5; border: 1px solid #edca80; padding: 12px; border-radius: 8px; }
.prompt-conflict button { margin: 4px; }
.prompt-error { color: #b42318; }
@media (max-width: 640px) { .prompt-dialog-content { padding: 16px; } .prompt-callers { columns: 1; } .context-module-header { flex-wrap: wrap; } .context-order { width: 100%; justify-content: flex-end; } }
