/* M99 workspace layer: an evidence-management surface, not a marketing shell. */
:root {
  --m99-w-paper: #fbfaf6;
  --m99-w-canvas: #f1f4f0;
  --m99-w-panel: #ffffff;
  --m99-w-forest: #173f32;
  --m99-w-green: #286c53;
  --m99-w-sage: #536f59;
  --m99-w-ink: #26352e;
  --m99-w-muted: #5b675f;
  --m99-w-rule: #d7e1d9;
  --m99-w-warn: #8b6328;
  --m99-w-nav: 236px;
  --m99-w-header-height: 76px;
  --m99-w-content-gutter: clamp(22px, 2.5vw, 48px);
}

body.m11-active {
  background: var(--m99-w-canvas);
  color: var(--m99-w-ink);
  font-family: Aptos, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  padding-top: 0;
}
body.m11-active .m11-root { background: var(--m99-w-canvas); }
body.m11-active .m11-top {
  min-height: var(--m99-w-header-height);
  padding: 14px clamp(18px, 3vw, 44px);
  background: var(--m99-w-paper);
  border-bottom: 1px solid var(--m99-w-rule);
  box-sizing: border-box;
}
body.m11-active .m11-brand {
  font-family: Aptos, "Segoe UI", sans-serif;
  color: var(--m99-w-forest);
  letter-spacing: 0;
}
body.m11-active .m11-brand small { color: var(--m99-w-sage); letter-spacing: 0; }
body.m11-active .m11-top nav { gap: 4px; }
body.m11-active .m11-top nav a {
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--m99-w-muted);
}
body.m11-active .m11-top nav a:hover,
body.m11-active .m11-top nav a.active {
  background: transparent;
  border-bottom-color: var(--m99-w-green);
  color: var(--m99-w-forest);
}
body.m11-active .m11-shell {
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - var(--m99-w-header-height));
  grid-template-columns: var(--m99-w-nav) minmax(0, 1fr);
}
body.m11-active .m11-side {
  width: auto;
  min-width: 0;
  top: var(--m99-w-header-height);
  height: calc(100vh - var(--m99-w-header-height));
  padding: 22px 14px 28px;
  background: #eaf1eb;
  border-right: 1px solid var(--m99-w-rule);
  box-sizing: border-box;
  overscroll-behavior: contain;
}
body.m11-active .m11-side h3 {
  margin: 18px 10px 7px;
  color: var(--m99-w-sage);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
body.m11-active .m11-side a {
  min-height: 38px;
  padding: 9px 10px;
  border-left: 2px solid transparent;
  border-radius: 0;
  color: var(--m99-w-muted);
  font-size: 14px;
}
body.m11-active .m11-side a:hover,
body.m11-active .m11-side a.active {
  background: #dce9df;
  border-left-color: var(--m99-w-green);
  color: var(--m99-w-forest);
}
body.m11-active .m11-main {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin-inline: 0;
  padding: 32px var(--m99-w-content-gutter) 56px;
  box-sizing: border-box;
}
body.m11-active .m11-main > * { min-width: 0; }
body.m11-active .m11-main > h1 {
  margin: 0 0 8px;
  color: var(--m99-w-forest);
  font-family: Iowan Old Style, Baskerville, "Palatino Linotype", Georgia, serif;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}
body.m11-active .m11-main > .m11-lead {
  max-width: 70ch;
  margin: 0 0 28px;
  color: var(--m99-w-muted);
  font-size: 16px;
  line-height: 1.7;
}
body.m11-active .m11-project-context {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(120px, .8fr));
  gap: 16px;
  padding: 18px 0;
  margin: 0 0 28px;
  border: 0;
  border-top: 2px solid var(--m99-w-forest);
  border-bottom: 1px solid var(--m99-w-rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.m11-active .m11-project-context strong { color: var(--m99-w-forest); }
body.m11-active .m11-project-context span,
body.m11-active .m11-project-context dd { color: var(--m99-w-muted); }
body.m11-active .m11-card,
body.m11-active .m11-workflow-panel,
body.m11-active .m11-table {
  border: 0;
  border-top: 1px solid var(--m99-w-rule);
  border-radius: 0;
  background: var(--m99-w-panel);
  box-shadow: none;
}
body.m11-active .m11-card { padding: 22px 0; }
body.m11-active .m11-card h2,
body.m11-active .m11-card h3 { color: var(--m99-w-forest); }
body.m11-active .m11-state {
  margin: 18px 0;
  padding: 14px 16px;
  border: 0;
  border-left: 3px solid var(--m99-w-warn);
  border-radius: 0;
  background: #f7f2e7;
  color: var(--m99-w-ink);
}
body.m11-active .m11-state[data-state="REQUEST_ERROR"] { border-left-color: #a14e42; background: #fbf2ef; }
body.m11-active .m11-state[data-state="LOADING"] { border-left-color: var(--m99-w-green); background: #edf4ee; }
body.m11-active .m11-main { overflow-x: clip; }
body.m11-active .m11-main :where(.m11-table-scroll, .m35-table-scroll, .m862-table-scroll, .m11-app-table-scroll) {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
body.m11-active .m11-main > :where(.m11-table, table.m11-table),
body.m11-active .m11-report .m11-table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}
body.m11-active .m11-main :where(table, canvas, .js-plotly-plot, .m11-scientific-figure, .m11-structure-viewer) { max-width: 100%; }
body.m11-active .m11-table th {
  padding: 12px 14px;
  background: #edf3ee;
  color: var(--m99-w-sage);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
body.m11-active .m11-table td { padding: 14px; border-top: 1px solid var(--m99-w-rule); color: var(--m99-w-ink); }
body.m11-active .m11-table tr:hover td { background: #f7faf7; }
body.m11-active .m35-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--m99-w-rule);
}
body.m11-active .m35-section-heading h2 { color: var(--m99-w-forest); font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: clamp(24px, 3vw, 36px); }
body.m11-active .m35-section-kicker { color: var(--m99-w-sage); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
body.m11-active .m35-list-toolbar { border: 0; border-bottom: 1px solid var(--m99-w-rule); border-radius: 0; background: transparent; }
body.m11-active .m35-fixture-banner { border-radius: 0; border-left: 3px solid var(--m99-w-warn); background: #f7f2e7; }
body.m11-active .m30-stage-button { border-radius: 0; }
body.m11-active .m30-stage-button.is-active { background: var(--m99-w-green); border-color: var(--m99-w-green); }

@media (max-width: 760px) {
  body.m11-active .m11-top { min-height: 68px; padding: 12px 16px; }
  body.m11-active .m11-side { position: static; top: auto; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--m99-w-rule); }
  body.m11-active .m11-main { padding: 28px 16px 48px; }
  body.m11-active .m11-main > h1 { font-size: 32px; }
  body.m11-active .m11-project-context { grid-template-columns: 1fr 1fr; }
  body.m11-active .m35-section-heading { display: block; }
  body.m11-active .m35-section-heading .m11-btn { margin-top: 16px; }
}

@media (min-width: 761px) and (max-width: 900px) {
  body.m11-active .m11-shell {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
  }
  body.m11-active .m11-side {
    display: flex;
    align-items: center;
    gap: 4px;
    position: sticky;
    top: var(--m99-w-header-height);
    z-index: 20;
    width: 100%;
    min-width: 0;
    height: 54px;
    max-height: 54px;
    padding: 6px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    border-right: 0;
    border-bottom: 1px solid var(--m99-w-rule);
    scrollbar-width: thin;
  }
  body.m11-active .m11-side > h3 { display: none; }
  body.m11-active .m11-side > a {
    flex: 0 0 auto;
    min-height: 36px;
    margin: 0;
    white-space: nowrap;
  }
  body.m11-active .m11-side #m30-project-stage-rail {
    position: static;
    display: flex !important;
    flex: 0 0 max-content;
    align-items: center;
    gap: 5px;
    width: max-content;
    min-width: 0;
    height: 42px;
    margin: 0;
    padding: 0 0 2px;
    overflow: visible;
    white-space: nowrap;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  body.m11-active .m11-side #m30-project-stage-rail .m30-stage-kicker {
    flex: 0 0 auto;
    margin: 0 5px 0 2px;
    color: var(--m99-w-sage);
  }
  body.m11-active .m11-side #m30-project-stage-rail .m30-stage-group {
    display: block;
    flex: 0 0 auto;
    width: auto;
    margin: 0;
  }
  body.m11-active .m11-side #m30-project-stage-rail .m30-stage-button {
    display: inline-flex;
    width: auto;
    min-height: 36px;
    padding: 7px 10px;
  }
  body.m11-active .m11-side #m30-project-stage-rail .m30-stage-detail,
  body.m11-active .m11-side #m30-project-stage-rail .m30-stage-subroute { display: none !important; }
  body.m11-active .m11-main { min-width: 0; }
}

body.m11-active .m11-main .m11-table:focus-visible {
  outline: 3px solid rgba(40, 108, 83, .45);
  outline-offset: 2px;
}
