/* Menomentis — component stylesheet. Loads after tokens.css. */

.mm-root,
[class^="mm-"],
[class*=" mm-"] {
  box-sizing: border-box;
}

/* ---------- shared ---------- */

.mm-i {
  display: inline-block;
  flex: none;
  vertical-align: -0.15em;
}

:where(.mm-btn, .mm-iconbtn, .mm-seg__opt, .mm-switch, .mm-field__input, .mm-choice,
       .mm-tab, .mm-navitem, .mm-doctab, .mm-doccard, .mm-step, .mm-row,
       .mm-files__item, .mm-files__new, .mm-ctx__chat, .mm-module__head,
       .mm-inline--shut):focus-visible {
  outline: var(--stroke-rule) solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---------- Icon ---------- */

.mm-icon {
  display: inline-block;
  flex: none;
  color: inherit;
  vertical-align: -0.18em;
}

/* ---------- SectionRule ---------- */

.mm-rule {
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mm-rule__eyebrow {
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.mm-rule__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-3);
}

.mm-rule__title {
  margin: 0;
  color: var(--ink-strong);
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.mm-rule--masthead .mm-rule__title {
  font-size: 28px;
  line-height: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mm-rule__meta {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 19px;
  white-space: nowrap;
}

.mm-rule__line {
  height: var(--stroke-rule);
  background: var(--line-strong);
}

.mm-rule--hairline .mm-rule__line {
  height: var(--stroke-hairline);
  background: var(--line-hairline);
}

/* ---------- Button ---------- */

.mm-btn {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 21px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 9px var(--space-4);
  border-radius: var(--radius-md);
  border: var(--stroke-hairline) solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 140ms cubic-bezier(0.2, 0, 0, 1),
              border-color 140ms cubic-bezier(0.2, 0, 0, 1);
}

.mm-btn--sm {
  font-size: 13px;
  line-height: 19px;
  padding: 5px var(--space-3);
}

.mm-btn--block {
  display: flex;
  width: 100%;
}

.mm-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.mm-btn--primary:hover:not(:disabled) {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
}

.mm-btn--secondary {
  background: var(--bg-surface);
}

.mm-btn--secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--line-strong);
}

.mm-btn--ghost {
  border-color: transparent;
  color: var(--ink-muted);
}

.mm-btn--ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--ink);
}

.mm-btn--danger {
  background: transparent;
  border-color: var(--line);
  color: var(--danger);
}

.mm-btn--danger:hover:not(:disabled) {
  background: var(--danger-soft);
  border-color: var(--danger);
}

.mm-btn:disabled {
  cursor: not-allowed;
  color: var(--ink-faint);
  background: transparent;
  border-color: var(--line-hairline);
}

.mm-btn--primary:disabled {
  background: var(--bg-hover);
}

/* ---------- IconButton ---------- */

.mm-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-md);
  border: var(--stroke-hairline) solid transparent;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: background-color 140ms cubic-bezier(0.2, 0, 0, 1);
}

.mm-iconbtn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--ink-strong);
}

.mm-iconbtn--bordered {
  border-color: var(--line);
  background: var(--bg-surface);
}

.mm-iconbtn--sm {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
}

.mm-iconbtn:disabled {
  color: var(--ink-faint);
  cursor: not-allowed;
}

/* ---------- SegmentedControl ---------- */

.mm-seg {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: var(--stroke-hairline) solid var(--line-hairline);
  background: var(--bg-sunken);
}

.mm-seg__opt {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 21px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px var(--space-4);
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms cubic-bezier(0.2, 0, 0, 1),
              color 140ms cubic-bezier(0.2, 0, 0, 1);
}

.mm-seg__opt:hover:not([aria-checked="true"]):not(:disabled) {
  color: var(--ink);
}

.mm-seg__opt[aria-checked="true"] {
  background: var(--select-solid);
  color: var(--ink-inverse);
  font-weight: 600;
}

.mm-seg--sm .mm-seg__opt {
  font-size: 13px;
  line-height: 19px;
  padding: 3px var(--space-3);
}

.mm-seg__opt:disabled {
  color: var(--ink-faint);
  cursor: not-allowed;
}

/* ---------- Switch ---------- */

.mm-switch {
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
}

.mm-switch__track {
  flex: none;
  position: relative;
  width: 40px;
  height: 24px;
  margin-top: 1px;
  border-radius: var(--radius-pill);
  border: var(--stroke-hairline) solid var(--line);
  background: var(--bg-sunken);
  transition: background-color 140ms cubic-bezier(0.2, 0, 0, 1),
              border-color 140ms cubic-bezier(0.2, 0, 0, 1);
}

.mm-switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-pill);
  background: var(--ink-muted);
  transition: transform 140ms cubic-bezier(0.2, 0, 0, 1),
              background-color 140ms cubic-bezier(0.2, 0, 0, 1);
}

.mm-switch[aria-checked="true"] .mm-switch__track {
  background: var(--select-solid);
  border-color: var(--select-solid);
}

.mm-switch[aria-checked="true"] .mm-switch__knob {
  background: var(--ink-inverse);
  transform: translateX(16px);
}

.mm-switch--context[aria-checked="true"] .mm-switch__track {
  background: var(--accent);
  border-color: var(--accent);
}

.mm-switch--context[aria-checked="true"] .mm-switch__knob {
  background: var(--on-accent);
}

.mm-switch__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mm-switch__label {
  font-size: 14px;
  line-height: 21px;
  font-weight: 500;
  color: var(--ink-strong);
}

.mm-switch__desc {
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-muted);
}

.mm-switch:disabled {
  cursor: not-allowed;
}

.mm-switch:disabled .mm-switch__label,
.mm-switch:disabled .mm-switch__desc {
  color: var(--ink-faint);
}

/* ---------- TextField ---------- */

.mm-field {
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mm-field__label {
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.mm-field__wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  border: var(--stroke-hairline) solid var(--line);
  background: var(--bg-sunken);
  color: var(--ink-muted);
}

.mm-field__wrap:focus-within {
  border-color: var(--line-strong);
  outline: var(--stroke-rule) solid var(--focus-ring);
  outline-offset: 2px;
}

.mm-field__input {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 21px;
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 9px 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  resize: vertical;
}

.mm-field--mono .mm-field__input {
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 26px;
}

.mm-field__input::placeholder {
  color: var(--ink-faint);
}

.mm-field__helper {
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-muted);
}

.mm-field--error .mm-field__wrap {
  border-color: var(--danger);
}

.mm-field--error .mm-field__helper {
  color: var(--danger);
}

.mm-field__input:disabled {
  color: var(--ink-faint);
}

/* ---------- ChoiceCards ---------- */

.mm-choices {
  font-family: var(--font-sans);
  display: grid;
  gap: var(--space-3);
}

.mm-choice {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: var(--stroke-hairline) solid var(--line);
  background: var(--bg-surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms cubic-bezier(0.2, 0, 0, 1),
              border-color 140ms cubic-bezier(0.2, 0, 0, 1);
}

.mm-choice:hover:not([aria-checked="true"]) {
  background: var(--bg-hover);
  border-color: var(--line-strong);
}

.mm-choice__top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink-strong);
}

.mm-choice__label {
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.mm-choice__desc {
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-muted);
}

.mm-choice[aria-checked="true"] {
  background: var(--select-solid);
  border-color: var(--select-solid);
}

.mm-choice[aria-checked="true"] .mm-choice__top,
.mm-choice[aria-checked="true"] .mm-choice__desc {
  color: var(--ink-inverse);
}

/* ---------- Tabs ---------- */

.mm-tabs {
  font-family: var(--font-sans);
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
  border-bottom: var(--stroke-hairline) solid var(--line-hairline);
}

.mm-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 21px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.mm-tab:hover:not([aria-selected="true"]) {
  background: var(--bg-hover);
  color: var(--ink);
}

.mm-tab[aria-selected="true"] {
  color: var(--ink-strong);
  font-weight: 600;
}

.mm-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: var(--space-2);
  right: var(--space-2);
  bottom: calc(-1 * var(--stroke-hairline));
  height: var(--stroke-heavy);
  background: var(--accent);
}

.mm-tab__dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

/* ---------- SideNav ---------- */

.mm-nav {
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-3);
  background: var(--bg-sunken);
  border-right: var(--stroke-hairline) solid var(--line-hairline);
  min-width: 232px;
}

.mm-nav__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mm-nav__label {
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: var(--space-2) var(--space-3);
}

.mm-navitem {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.mm-navitem:hover:not([aria-current="page"]) {
  background: var(--bg-hover);
}

.mm-navitem[aria-current="page"] {
  background: var(--bg-selected);
}

.mm-navitem__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mm-navitem__title {
  font-size: 14px;
  line-height: 21px;
  font-weight: 500;
  color: var(--ink-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-navitem__meta {
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- DocumentTabs ---------- */

.mm-doctabs {
  font-family: var(--font-mono);
  display: flex;
  align-items: stretch;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2) 0;
  background: var(--bg-sunken);
  border-bottom: var(--stroke-hairline) solid var(--line-hairline);
  overflow-x: auto;
}

/* Wide and thin: tabs share the strip equally up to 240px each and shrink
   together as more open; the title sits left and the close mark right. */
.mm-doctab {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 0;
  min-width: 96px;
  max-width: 240px;
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-3);
  border: var(--stroke-hairline) solid transparent;
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
}

.mm-doctab:hover:not([aria-selected="true"]) {
  background: var(--bg-hover);
  color: var(--ink);
}

.mm-doctab[aria-selected="true"] {
  background: var(--bg-canvas);
  border-color: var(--line-hairline);
  color: var(--ink-strong);
}

.mm-doctab--context {
  background: var(--accent-soft);
}

.mm-doctab__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-doctab__dirty {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--ink-muted);
}

.mm-doctab__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: none;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
}

.mm-doctab__close:hover {
  background: var(--bg-hover);
  opacity: 1;
}

/* ---------- EditorSurface ---------- */

.mm-editor {
  font-family: var(--font-mono);
  background: var(--bg-canvas);
  color: var(--ink);
  border-radius: var(--radius-0);
  padding: var(--space-12) var(--space-8);
}

.mm-editor__col {
  max-width: 68ch;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.mm-editor__title {
  margin: 0;
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  color: var(--ink-strong);
}

.mm-editor__meta {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 16px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mm-editor h1.mm-doc-h1 {
  margin: var(--space-4) 0 0;
  font-size: 20px;
  line-height: 30px;
  font-weight: 600;
  color: var(--ink-strong);
}

.mm-editor h2.mm-doc-h2 {
  margin: var(--space-4) 0 0;
  font-size: 17px;
  line-height: 26px;
  font-weight: 600;
  color: var(--ink-strong);
}

.mm-editor h3.mm-doc-h3 {
  margin: var(--space-3) 0 0;
  font-size: 15px;
  line-height: 24px;
  font-weight: 600;
  color: var(--ink-strong);
}

.mm-editor p.mm-doc-p {
  margin: 0;
  font-size: 15px;
  line-height: 26px;
}

.mm-editor ul.mm-doc-ul {
  margin: 0;
  padding-left: 1.4em;
  font-size: 15px;
  line-height: 26px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mm-editor blockquote.mm-doc-quote {
  margin: 0;
  padding-left: var(--space-4);
  border-left: var(--stroke-rule) solid var(--line-strong);
  font-size: 15px;
  line-height: 26px;
  font-style: italic;
  color: var(--ink-muted);
}

.mm-editor pre.mm-doc-code {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-sunken);
  border-radius: var(--radius-0);
  border: var(--stroke-hairline) solid var(--line-hairline);
  font-size: 13px;
  line-height: 22px;
  overflow-x: auto;
}

.mm-editor ::selection {
  background: var(--text-selection);
  color: var(--ink-strong);
}

.mm-agentblock {
  padding: var(--space-3) var(--space-4);
  background: var(--accent-soft);
  border: var(--stroke-hairline) solid var(--accent-line);
  border-radius: var(--radius-0);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mm-agentblock__byline {
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.mm-agentblock__text {
  margin: 0;
  font-size: 15px;
  line-height: 26px;
  color: var(--ink);
}

.mm-agentblock__actions {
  display: flex;
  gap: var(--space-2);
  padding-top: var(--space-1);
}

/* ---------- DocumentCard ---------- */

.mm-doccard {
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: var(--stroke-hairline) solid var(--line-hairline);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
}

.mm-doccard--context {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.mm-doccard__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.mm-doccard__title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 24px;
  font-weight: 600;
  color: var(--ink-strong);
}

.mm-doccard__excerpt {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 22px;
  color: var(--ink-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mm-doccard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: var(--stroke-hairline) solid var(--line-hairline);
}

.mm-doccard--context .mm-doccard__foot {
  border-top-color: var(--accent-line);
}

.mm-doccard__meta {
  font-size: 12px;
  line-height: 16px;
  color: var(--ink-muted);
}

/* ---------- AgentPanel ---------- */

.mm-agent {
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 380px;
  border-radius: var(--radius-xl);
  border: var(--stroke-hairline) solid var(--line);
  background: var(--bg-raised);
  box-shadow: var(--shadow-raised);
  overflow: hidden;
}

.mm-agent__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--stroke-hairline) solid var(--line-hairline);
}

.mm-agent__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.mm-agent__modes {
  padding: var(--space-3) var(--space-4) 0;
}

.mm-agent__log {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  overflow-y: auto;
}

.mm-msg {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-width: 92%;
}

.mm-msg--you {
  align-self: flex-end;
  align-items: flex-end;
}

.mm-msg__byline {
  font-size: 11px;
  line-height: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.mm-msg__body {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 21px;
  color: var(--ink);
  background: var(--bg-surface);
  border: var(--stroke-hairline) solid var(--line-hairline);
}

.mm-msg--you .mm-msg__body {
  background: var(--bg-sunken);
}

.mm-msg--wrote .mm-msg__body {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.mm-agent__foot {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4) var(--space-4);
  border-top: var(--stroke-hairline) solid var(--line-hairline);
}

.mm-agent__input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 21px;
  padding: 9px var(--space-3);
  border-radius: var(--radius-md);
  border: var(--stroke-hairline) solid var(--line);
  background: var(--bg-sunken);
  color: var(--ink);
  resize: none;
}

.mm-agent__input::placeholder {
  color: var(--ink-faint);
}

.mm-agent__input:focus-visible {
  outline: var(--stroke-rule) solid var(--focus-ring);
  outline-offset: 2px;
  border-color: var(--line-strong);
}

.mm-agent__cta {
  padding: 0 var(--space-4) var(--space-4);
}

/* ---------- CurriculumStep ---------- */

.mm-step {
  font-family: var(--font-sans);
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-4) var(--space-5);
  border: var(--stroke-hairline) solid var(--line-hairline);
  border-radius: var(--radius-0);
  background: var(--bg-surface);
  text-align: left;
  cursor: pointer;
}

.mm-step + .mm-step {
  border-top: none;
}

.mm-step:hover {
  background: var(--bg-hover);
}

.mm-step--active {
  background: var(--bg-surface);
  border-color: var(--line-strong);
  border-width: var(--stroke-hairline);
}

.mm-step--active::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  bottom: -1px;
  width: var(--stroke-heavy);
  background: var(--accent);
}

.mm-step__index {
  flex: none;
  width: 32px;
  font-size: 11px;
  line-height: 21px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.mm-step__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.mm-step__title {
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
  color: var(--ink-strong);
}

.mm-step__summary {
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-muted);
}

.mm-step__side {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: none;
}

/* ---------- MaterialRow ---------- */

.mm-row {
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: none;
  border-bottom: var(--stroke-hairline) solid var(--line-hairline);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.mm-row:hover {
  background: var(--bg-hover);
}

.mm-row__title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 21px;
  color: var(--ink-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-row__meta {
  flex: none;
  font-size: 12px;
  line-height: 16px;
  color: var(--ink-muted);
}

/* ---------- Notice ---------- */

.mm-notice {
  font-family: var(--font-sans);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: var(--stroke-hairline) solid var(--line-hairline);
  background: var(--info-soft);
  color: var(--ink);
}

.mm-notice__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}

.mm-notice__title {
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
  color: var(--ink-strong);
}

.mm-notice__text {
  font-size: 14px;
  line-height: 21px;
  color: var(--ink);
}

.mm-notice__actions {
  display: flex;
  gap: var(--space-2);
  padding-top: var(--space-2);
}

.mm-notice--success {
  background: var(--success-soft);
}

.mm-notice--warning {
  background: var(--warning-soft);
}

.mm-notice--danger {
  background: var(--danger-soft);
}

.mm-notice--context {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

/* ---------- Badge ---------- */

.mm-badge {
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  border: var(--stroke-hairline) solid var(--line-hairline);
  background: var(--bg-sunken);
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
}

.mm-badge--success {
  background: var(--success-soft);
  color: var(--success);
  border-color: transparent;
}

.mm-badge--warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: transparent;
}

.mm-badge--danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

.mm-badge--info {
  background: var(--info-soft);
  color: var(--info);
  border-color: transparent;
}

.mm-badge--context {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: var(--accent-line);
}

/* ---------- WorkspaceBar ---------- */

.mm-bar {
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-surface);
  border-bottom: var(--stroke-rule) solid var(--line-strong);
}

.mm-bar__id {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.mm-bar__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mm-bar__title {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: var(--ink-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-bar__meta {
  font-size: 12px;
  line-height: 16px;
  color: var(--ink-muted);
}

.mm-bar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---------- FileNavigator ---------- */

.mm-files {
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-3);
  min-width: 228px;
  background: var(--bg-sunken);
  border-right: var(--stroke-hairline) solid var(--line-hairline);
}

.mm-files__group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mm-files__folder {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.mm-files__folderName {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-files__count {
  letter-spacing: 0;
}

.mm-files__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  text-align: left;
  cursor: pointer;
}

.mm-files__item:hover:not([aria-current]) {
  background: var(--bg-hover);
}

.mm-files__item[aria-current] {
  background: var(--bg-selected);
  color: var(--ink-strong);
}

.mm-files__item--ctx {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.mm-files__item--ctx[aria-current] {
  background: var(--accent-soft);
  color: var(--ink-strong);
  box-shadow: inset var(--stroke-heavy) 0 0 0 var(--accent);
}

.mm-files__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-files__new {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-3);
  border: var(--stroke-hairline) dashed var(--line);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 19px;
  cursor: pointer;
}

.mm-files__new:hover {
  background: var(--bg-hover);
  color: var(--ink-strong);
  border-style: solid;
}

/* ---------- EmptyPrompt ---------- */

.mm-seed {
  font-family: var(--font-mono);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 68ch;
}

.mm-seed__label {
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.mm-seed__prompt {
  margin: 0;
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  color: var(--ink-faint);
}

.mm-seed__hint {
  margin: 0;
  font-size: 15px;
  line-height: 26px;
  color: var(--ink-muted);
}

.mm-seed__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-2);
}

.mm-seed__note {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 16px;
  color: var(--ink-faint);
}

/* ---------- InlineAgentCard ---------- */

.mm-inline {
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  max-width: 68ch;
  padding: var(--space-3) var(--space-4) var(--space-4);
  border: var(--stroke-hairline) solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  box-shadow: var(--shadow-raised);
}

.mm-inline--shut {
  flex-direction: row;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-style: dashed;
  border-color: var(--line);
  background: transparent;
  box-shadow: none;
  color: var(--ink-faint);
  cursor: pointer;
  text-align: left;
}

.mm-inline--shut:hover {
  background: var(--bg-hover);
  border-style: solid;
  color: var(--ink-muted);
}

.mm-inline__hint {
  flex: 1;
  font-size: 13px;
  line-height: 19px;
}

.mm-inline__key {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  padding: 1px var(--space-2);
  border: var(--stroke-hairline) solid var(--line-hairline);
  border-radius: var(--radius-sm);
  color: var(--ink-faint);
}

.mm-inline__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.mm-inline__log {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mm-inline__foot {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}

/* ---------- ContextPanel ---------- */

.mm-ctx {
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.mm-ctx__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mm-ctx__label {
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-2);
  border-bottom: var(--stroke-rule) solid var(--line-strong);
}

.mm-ctx__chat,
.mm-ctx__file {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-3);
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-muted);
  text-align: left;
}

.mm-ctx__chat {
  cursor: pointer;
}

.mm-ctx__chat:hover:not(.mm-ctx__chat--on) {
  background: var(--bg-hover);
}

.mm-ctx__chat--on {
  background: var(--bg-selected);
}

.mm-ctx__file--on {
  background: var(--accent-soft);
  border: var(--stroke-hairline) solid var(--accent-line);
}

.mm-ctx__text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.mm-ctx__title {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 22px;
  color: var(--ink-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-ctx__meta {
  font-size: 12px;
  line-height: 16px;
  color: var(--ink-muted);
}

/* ---------- ModuleCard ---------- */

.mm-module {
  font-family: var(--font-sans);
  background: var(--bg-surface);
  border: var(--stroke-hairline) solid var(--line-hairline);
  border-radius: var(--radius-0);
}

.mm-module + .mm-module {
  border-top: none;
}

.mm-module--open {
  border-color: var(--line-strong);
  border-width: var(--stroke-hairline);
}

.mm-module__head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-4) var(--space-5);
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.mm-module__head:hover {
  background: var(--bg-hover);
}

.mm-module__index {
  flex: none;
  width: 32px;
  font-size: 11px;
  line-height: 21px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.mm-module__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.mm-module__title {
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
  color: var(--ink-strong);
}

.mm-module__summary {
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-muted);
}

.mm-module__meta {
  flex: none;
  font-size: 12px;
  line-height: 16px;
  color: var(--ink-muted);
}

.mm-module__chev {
  flex: none;
  color: var(--ink-muted);
}

.mm-module__body {
  padding: 0 var(--space-5) var(--space-5);
  border-top: var(--stroke-hairline) solid var(--line-hairline);
}

.mm-module__panel {
  padding-top: var(--space-4);
  font-size: 14px;
  line-height: 21px;
  color: var(--ink);
}

/* ---------- ExamCard ---------- */

.mm-exam {
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  background: var(--bg-surface);
  border: var(--stroke-hairline) solid var(--line);
  border-radius: var(--radius-0);
}

.mm-exam--final {
  border-width: var(--stroke-rule);
  border-color: var(--line-strong);
}

.mm-exam__label {
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.mm-exam__title {
  margin: 0;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  color: var(--ink-strong);
}

.mm-exam__rule {
  height: var(--stroke-rule);
  background: var(--line-strong);
  margin: var(--space-2) 0;
}

.mm-exam__facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  font-size: 13px;
  line-height: 19px;
}

.mm-exam__facts dt {
  color: var(--ink-faint);
  text-transform: uppercase;
  font-size: 11px;
  line-height: 19px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.mm-exam__facts dd {
  margin: 0;
  color: var(--ink);
  text-align: right;
}

.mm-exam__source {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-2);
  font-size: 12px;
  line-height: 16px;
  color: var(--ink-muted);
}

.mm-exam__actions {
  display: flex;
  gap: var(--space-2);
  padding-top: var(--space-3);
  margin-top: var(--space-1);
  border-top: var(--stroke-hairline) solid var(--line-hairline);
}
