:root {
  color-scheme: light;
  --ink: #25315a;
  --text-color: #697393;
  --canvas: #f3f0fd;
  --surface: #ffffff;
  --line: #e2e5efb0;
  --line-strong: #d4d8e6;
  --purple: #5e4ada;
  --purple-soft: #eff0f9;
  --blue: #2f6fed;
  --blue-soft: #edf4ff;
  --green: #13795b;
  --green-soft: #e8f7f1;
  --amber: #ec9b00;
  --amber-soft: #fff5da;
  --red: #b33b46;
  --red-soft: #fff0f1;
  --shadow: 0 5px 10px rgba(39, 49, 90, 0.18);
  --shell-shadow: 0 2px 8px rgba(64, 26, 126, 0.19);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.55;
  font-weight: 500;
  color: #3d394c;
}

a { color: inherit; }
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(47, 111, 237, 0.34);
  outline-offset: 2px;
}

header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 53px;
  align-items: center;
  justify-content: space-between;
  padding: 2px 24px;
  background-color: #f3f0fd69;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}


.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  position: absolute;
  left: 0;
  display: block;
  width: 180px;
  height: auto;
  padding-left: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--purple);
  border-radius: 6px;
  background: var(--purple);
  color: white;
  font-size: 0.84rem;
  text-decoration: none;
}
.header-link.secondary { background: white; color: var(--purple); }
.header-link:hover { box-shadow: 0 4px 12px rgba(72, 56, 196, 0.16); }

.product-label,
.availability,
.scenario-state {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  color: var(--ink);
  font-size: 0.69rem;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  background-color: var(--line);
  -webkit-user-select: none; 
  -ms-user-select: none;   
  user-select: none;  
}

.app-shell {
  display: grid;
  min-height: calc(100vh - 64px);
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 64px;
  display: flex;
  height: calc(100vh - 64px);
  flex-direction: column;
  padding: 26px 16px 20px;
}

.sidebar-label {
  margin: 0 10px 10px;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 700;
}

.sidebar nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: grid;
  min-height: 42px;
  align-items: center;
  grid-template-columns: 28px minmax(0, 1fr);
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #566181;
  font-size: 0.95rem;
  text-decoration: none;
  font-weight: 600;
}

.nav-item span {
  color: #99a1ba;
  font-size: 0.92rem;
}

.nav-item:hover,
.nav-item.active {
  border-color: #e1ddff;
  background: var(--purple-soft);
  color: var(--purple);
}

.nav-item:hover span,
.nav-item.active span { color: var(--purple); }

.sidebar-context {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 14px 11px;
  border-top: 1px solid var(--line);
  color: var(--text-color);
  font-size: 0.72rem;
}

.sidebar-context strong,
.sidebar-context span { display: block; }
.sidebar-context strong { margin-bottom: 2px; color: var(--ink); font-size: 0.78rem; }
.context-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

.workspace {
  min-width: 0;
  padding: 10px;
  background: var(--canvas);
  padding-right: 20px;
}

.workspace-content,
.workspace footer {
  width: min(1700px, 100%);
  margin-inline: auto;
}

.workspace-content {
  overflow: hidden;
  padding-inline: clamp(24px, 4vw, 52px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 20px;
  margin-top: 15px;
  font-size: clamp(1.50rem, 5vw, 2.20rem);
  line-height: 1.04;
  letter-spacing: -0.05em;
}
h2 {
  margin-bottom: 9px;
  font-size: clamp(1.45rem, 2.7vw, 2rem);
  letter-spacing: -0.032em;
}
h3 { letter-spacing: -0.018em; }

.hero {
  scroll-margin-top: 82px;
  padding: 18px;
  background-color: var(--canvas);  
  border-radius: 7px;
  margin-top: 18px;
  -webkit-box-shadow: inset -1px 1px 5px 0px rgba(14,13,43,0.25); 
  box-shadow: inset -1px 1px 5px 0px rgba(14,13,43,0.25);
}

.icon-container {
  display: inline-flex;
  align-items: center;
  gap: 8px; 
  margin-bottom: 11px; 
}

.svg-icon {
  width: 1.50em; 
  height: 1.50em;
  fill: var(--purple); 
  flex-shrink: 0; 
}

.agent-icon {
  width: 1.90em; 
  height: 1.90em;
  fill: black;
  flex-shrink: 0; 
}

.eyebrow {
  margin: 0;
  color: var(--purple);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1; 
}

.workflow {
  display: grid;
  padding: 0;
  grid-template-columns: repeat(6, 1fr);
  list-style: none;
}

.workflow li {
  padding: 16px;
  border: 1px solid var(--line-strong);
  color: var(--purple);
  font-size: 0.90rem;
  background: var(--surface);
  box-shadow: var(--shell-shadow);
  margin: 4px;
  border-radius: 10px;
}
.workflow span {
  display: block;
  margin-bottom: 7px;
  color: var(--purple);
  font-size: 0.7rem;
}

.content-section {
  scroll-margin-top: 82px;
  padding-block: 54px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}
.section-heading > p {
  max-width: 390px;
  margin: 0;
  color: var(--text-color);
  font-size: 0.86rem;
  text-align: right;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.scenario-card {
  display: flex;
  min-height: 344px;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(39, 49, 90, 0.05);
}
.scenario-card:hover {
  border-color: #d2cdfb;
  box-shadow: 0 8px 22px rgba(72, 56, 196, 0.09);
}
.scenario-card > p { color: var(--text-color); }
.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 26px;
  -webkit-user-select: none; 
  -ms-user-select: none;   
  user-select: none;  
}
.card-topline > code {
  min-width: 0;
  color: var(--text-color);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
.event-verdict { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.new-badge { border-color: #b5dfd0; background: var(--green-soft); color: var(--green); }
.verdict-block, .run-failed { border-color: #efbdc1; background: var(--red-soft); color: var(--red); }
.verdict-warn { border-color: #edd49b; background: var(--amber-soft); color: var(--amber); }
.verdict-pass { border-color: #b5dfd0; background: var(--green-soft); color: var(--green); }

.scenario-facts {
  display: grid;
  margin: auto 0 22px;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.scenario-facts div, .detail-grid div { min-width: 0; }
.scenario-facts dd { overflow-wrap: anywhere; }
dt {
  color: var(--purple);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
dd { margin: 4px 0 0; }

button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--purple);
  border-radius: 6px;
  background: var(--purple);
  color: white;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
 padding: 8px 14px;
}
.scenario-card button,
.scenario-card .scenario-action { width: 100%; }
.event-occurrence-card .card-topline > code { color: var(--purple); }
.event-feed-more {
  display: flex;
  min-width: 180px;
  margin: 22px auto 0;
  background: var(--surface);
  color: var(--purple);
}
.event-feed-more:hover { color: white; }
.event-feed-more[hidden] { display: none; }
.event-feed-empty {
  grid-column: 1 / -1;
  padding: 42px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  text-align: center;
}
.event-feed-empty h3 { margin-bottom: 8px; }
.event-feed-empty p { margin: 0 auto 22px; color: var(--text-color); }
.event-feed-empty .button-link { display: inline-flex; }
.agent-event-status {
  min-height: 18px;
  margin: 7px 0 -7px;
  color: var(--text-color);
  font-size: 0.72rem;
  text-align: center;
}

.simulator-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.simulator-facts article {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.simulator-facts span,
.simulator-payload > span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-color);
  font-size: 0.74rem;
}
.simulator-facts strong { display: block; overflow-wrap: anywhere; }
.simulator-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.simulator-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}
.simulator-form select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  color: var(--ink);
}
.profile-selector { grid-column: 1 / -1; }
.profile-derived-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-column: 1 / -1;
  gap: 12px;
}
.profile-derived-field {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafaff;
}
.profile-derived-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--text-color);
  font-size: 0.72rem;
  font-weight: 500;
}
.profile-derived-field strong,
.profile-derived-field code { overflow-wrap: anywhere; }
.simulator-payload {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--purple-soft);
}
.simulator-payload code { overflow-wrap: anywhere; }
.simulator-form > button,
.simulator-form > .agent-event-status { grid-column: 1 / -1; }
button:hover, .button-link:hover { border-color: var(--purple); background: var(--purple); }
button:disabled, fieldset:disabled button { cursor: not-allowed; opacity: 0.45; }

.custom-section { padding-bottom: 76px; }
.availability.available { border-color: #b5dfd0; background: var(--green-soft); color: var(--green); }
.availability.unavailable { background: #f0f1f6; }
.configuration-note {
  padding: 15px 17px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: #704b09;
}
.custom-form fieldset {
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: 2fr 1fr;
  gap: 17px;
  border: 0;
}
.custom-form label {
  font-size: 0.95rem;
  font-weight: bold;
}
.custom-form input,
.custom-form textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}
.custom-form input:focus,
.custom-form textarea:focus { border-color: var(--purple); }
.full-field { grid-column: 1 / -1; }

.run-hero {
  scroll-margin-top: 82px;
  padding-block: 32px 24px;
}
.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--purple);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}
.decision-banner {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: 30px;
  border: 1px solid var(--line);
  border-left-width: 6px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shell-shadow);
}

.status-block, .status-failed { border-left-color: var(--red); background: linear-gradient(110deg, var(--red-soft), white 78%); }
.status-warn, .status-incomplete { border-left-color: var(--amber); background: linear-gradient(110deg, var(--amber-soft), white 78%); }
.status-pass, .status-not_applicable { border-left-color: var(--green); background: linear-gradient(110deg, var(--green-soft), white 78%); }
.run-meta { flex: 0 1 330px; margin: 0; }
.run-meta div { margin-top: 9px; }

.run-content {
  margin-bottom: 74px;
  border-top: 1px solid var(--line);
}
.result-section {
  display: grid;
  scroll-margin-top: 82px;
  padding-block: 44px;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.section-number {
  color: #9aa2ba;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
}

.detail-grid div {
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shell-shadow);
  margin-bottom: 6px;
}
.detail-grid .wide { grid-column: 1 / -1; }

.lineage-list, .model-list { margin: 20px 0 27px; padding: 0; list-style: none; }
.lineage-list li {
  display: grid;
  align-items: center;
  margin-bottom: 8px;
  padding: 12px;
  grid-template-columns: 66px minmax(0, 1fr) 28px minmax(0, 1fr);
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.lineage-list li > span { color: var(--purple); font-size: 0.72rem; font-weight: 750; }
.lineage-list li > strong { color: var(--purple); text-align: center; }
.model-list li {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
  padding: 14px;
  border-left: 3px solid var(--amber);
  background: #fff6ea;
  border-radius: 4px;
}

ul.model-list li strong, .simulator-disclaimer {
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 40px;
  padding: 2px 10px;
  display: inline-block;
  align-self: flex-start;
  width: fit-content;
}


.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 13px; border-bottom: 1px solid var(--line); text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--text-color); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.experiment-heading { display: flex; align-items: baseline; justify-content: space-between; margin-top: 22px; }
.experiment-heading span { color: var(--text-color); font-size: 0.77rem; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.metric-grid article {
  padding: 17px;
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shell-shadow);
  background-color: var(--purple);
  color: white;
  border: none;

}
.metric-grid span { display: block; }
.metric-grid strong { font-family: "SFMono-Regular", Consolas, monospace; font-size: 1.28rem; }
.metric-card { min-width: 0; }
.roc-plot {
  display: block;
  width: 100%;
  height: 54px;
  margin-bottom: 13px;
  overflow: visible;
  shape-rendering: geometricPrecision;
}
.roc-area { fill: rgba(255, 255, 255, 0.14); }
.roc-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}
.roc-reference {
  stroke: rgba(255, 255, 255, 0.32);
  stroke-dasharray: 3 3;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.metric-gauge {
  display: block;
  width: 100%;
  height: 54px;
  margin-bottom: 13px;
  overflow: visible;
  shape-rendering: geometricPrecision;
}
.gauge-track { fill: rgba(255, 255, 255, 0.14); }
.gauge-value { fill: rgba(255, 255, 255, 0.34); }
.gauge-threshold {
  stroke: rgba(255, 255, 255, 0.96);
  stroke-dasharray: 2 2;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}
.mutation-note { margin-top: 11px; color: var(--text-color); font-size: 0.82rem; }

.evidence-list { display: grid; gap: 9px; }
.evidence-item {
  display: grid;
  padding: 16px;
  grid-template-columns: 72px 1fr;
  gap: 8px 17px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.evidence-item > span { color: var(--text-color); font-size: 0.72rem; font-weight: 800; }
.evidence-block { border-left-color: var(--red); }
.evidence-block > span { color: var(--red); }
.evidence-warn, .evidence-incomplete { border-left-color: var(--amber); }
.evidence-warn > span, .evidence-incomplete > span { color: var(--amber); }
.evidence-pass, .evidence-not_applicable { border-left-color: var(--green); }
.evidence-pass > span, .evidence-not_applicable > span { color: var(--green); }
.evidence-item > code { grid-column: 2; color: var(--text-color); font-size: 0.76rem; }

.publication-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.publication-state { display: flex; align-items: flex-start; gap: 13px; }
.publication-state p { margin: 4px 0 0; color: var(--text-color); }
.state-dot { flex: 0 0 10px; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; }
.state-dot.success { background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }
.state-dot.failure { background: var(--red); box-shadow: 0 0 0 5px var(--red-soft); }
.report-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.button-link.secondary {
  min-height: 38px;
  padding: 0 13px;
  border-color: var(--line-strong);
  background: white;
  color: var(--ink);
  font-size: 0.82rem;
}
.button-link.secondary:hover { border-color: var(--purple); background: var(--purple-soft); color: var(--purple); }

.report-library-hero,
.report-detail-heading {
  padding-block: 44px 32px;
  border-bottom: 1px solid var(--line);
}
.report-library-hero > p:last-child { max-width: 760px; color: var(--text-color); }
.report-library {
  display: grid;
  padding-block: 32px 54px;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
}
.report-card {
  display: flex;
  min-width: 0;
  min-height: 285px;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(39, 49, 90, 0.05);
}
.report-card:hover { border-color: #d2cdfb; box-shadow: 0 8px 22px rgba(72, 56, 196, 0.09); }
.report-card h2 { margin: 24px 0; font-size: 1.35rem; }
.report-card-topline,
.report-detail-title,
.report-detail-meta,
.report-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.report-card-topline time,
.report-detail-meta { color: var(--text-color); font-size: 0.76rem; }
.verdict-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.045em;
}
.verdict-block { border-color: #efbdc1; background: var(--red-soft); color: var(--red); }
.verdict-warning,
.verdict-incomplete { border-color: #edd49b; background: var(--amber-soft); color: var(--amber); }
.verdict-pass,
.verdict-not-applicable { border-color: #b5dfd0; background: var(--green-soft); color: var(--green); }
.report-card-meta {
  display: grid;
  margin: auto 0 22px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
}
.report-card-meta code { overflow-wrap: anywhere; }
.report-card-actions { justify-content: flex-start; flex-wrap: wrap; }
.report-empty-state {
  margin-block: 32px 54px;
  padding: 56px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--purple-soft);
  text-align: center;
}
.report-empty-state > span { display: block; color: var(--purple); font-size: 2rem; }
.report-empty-state p { color: var(--text-color); }
.back-link { display: inline-flex; margin-bottom: 28px; color: var(--purple); text-decoration: none; }
.report-detail-title { align-items: flex-start; }
.report-detail-meta { justify-content: flex-start; flex-wrap: wrap; }
.report-detail-meta .button-link { margin-left: auto; }
.rendered-report {
  overflow-x: auto;
  padding-block: 36px 60px;
  color: #3d394c;
}
.rendered-report h1 { font-size: 1.9rem; }
.rendered-report h2 { margin-top: 38px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 1.45rem; }
.rendered-report h3 { margin-top: 28px; }
.rendered-report p,
.rendered-report li { max-width: 1000px; }
.rendered-report table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.rendered-report th,
.rendered-report td { padding: 11px 12px; border: 1px solid var(--line-strong); text-align: left; vertical-align: top; }
.rendered-report th { background: var(--purple-soft); color: var(--ink); }
.rendered-report pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: 7px;
  background: #29263a;
  color: #f8f7ff;
}
.rendered-report :not(pre) > code { padding: 2px 5px; border-radius: 4px; background: var(--purple-soft); }

.workspace footer {
  display: flex;
  justify-content: space-between;
  padding: 22px 10px 8px;
  color: var(--text-color);
  font-size: 0.75rem;
}

@media (max-width: 1040px) {
  .scenario-grid { grid-template-columns: 1fr; }
  .scenario-card { min-height: 0; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    z-index: 1;
    height: auto;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-label, .sidebar-context { display: none; }
  .sidebar nav { display: flex; overflow-x: auto; gap: 6px; }
  .nav-item { flex: 0 0 auto; min-height: 36px; grid-template-columns: 24px auto; }
  .workflow { grid-template-columns: 1fr; }
  .workflow li { border-right: 0; border-bottom: 1px solid var(--line); }
  .workflow li:last-child { border-bottom: 0; }
  .section-heading, .decision-banner { align-items: flex-start; flex-direction: column; }
  .section-heading > p { text-align: left; }
  .run-meta { flex-basis: auto; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .simulator-facts { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .header { min-height: 58px; padding: 0 12px; }
  .brand-logo-frame { width: 146px; height: 38px; }
  .brand-logo-frame img { top: -31px; width: 150px; }
  .product-label { display: none; }
  .app-shell { min-height: calc(100vh - 58px); }
  .workspace { padding: 8px; }
  .workspace-content { padding-inline: 16px; border-radius: 8px; }
  .hero { padding-block: 50px 42px; }
  h1 { font-size: clamp(2.15rem, 12vw, 3.1rem); }
  .custom-form fieldset, .detail-grid, .metric-grid,
  .scenario-facts, .simulator-facts, .simulator-form,
  .profile-derived-fields { grid-template-columns: 1fr; }
  .full-field, .detail-grid .wide { grid-column: auto; }
  .result-section { grid-template-columns: 1fr; gap: 0; padding-block: 36px; }
  .section-number { margin-bottom: 7px; }
  .lineage-list li { grid-template-columns: 1fr; overflow: hidden; }
  .lineage-list li > strong { text-align: left; }
  .evidence-item { grid-template-columns: 1fr; }
  .evidence-item > code { grid-column: auto; }
  .report-library { grid-template-columns: 1fr; }
  .report-card-topline, .report-detail-title, .report-detail-meta { align-items: flex-start; flex-direction: column; }
  .report-card-meta { grid-template-columns: 1fr; }
  .report-detail-meta .button-link { margin-left: 0; }
  .workspace footer { flex-direction: column; gap: 6px; }
}

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


/* Read-only GitHub Pages preview */
.preview-notice {
margin: 0;
  padding: 0.7rem 1.25rem;
  color: #be1212;
  background: #ffabab;
  font-size: 0.82rem;
  text-align: center;
  font-weight: 600;
}
.preview-notice strong { color: #4f46e5; }
.preview-actions { display: flex; gap: 0.65rem; flex-wrap: wrap; }
.preview-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.65rem 1rem;
  color: #fff;
  background: #5b48df;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 650;
}
.preview-button.secondary { color: #352d67; background: #eef0fb; }
.recorded-evidence {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  color: #47406d;
  background: #f7f7fc;
  border-left: 3px solid #6856e8;
}
.metric-sparkline {
  display: block;
  width: 100%;
  height: 3.25rem;
  margin-bottom: 0.55rem;
  overflow: visible;
}
.metric-sparkline .plot-area { fill: rgba(255, 255, 255, 0.2); }
.metric-sparkline .plot-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
}
.metric-sparkline .plot-track { fill: rgba(255, 255, 255, 0.14); }
.metric-sparkline .plot-value { fill: rgba(255, 255, 255, 0.34); }
.metric-sparkline .plot-threshold {
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 1;
  stroke-dasharray: 3 2;
}
.static-lineage { display: grid; gap: 0.8rem; }
.lineage-hop {
  padding: 0.9rem 1rem;
  border: 1px solid #e0e3ef;
  border-radius: 8px;
  background: #fff;
}
.lineage-hop span { display: block; margin-bottom: 0.35rem; color: #746f94; }
.lineage-hop code { overflow-wrap: anywhere; }
.preview-disabled {
  padding: 1rem;
  color: #77738e;
  background: #f5f5f9;
  border: 1px dashed #cbcbd8;
  border-radius: 8px;
}
.report-markdown { overflow-wrap: anywhere; }
.report-markdown h1, .report-markdown h2, .report-markdown h3 { margin-top: 1.5rem; }
.report-markdown table { display: block; overflow-x: auto; }
.report-filename { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .preview-notice { text-align: left; }
  .header-actions .product-label { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
}
