.ml-page {
  background: var(--content-bg);
}

.ml-page code,
.ml-page .ml-mono {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.ml-page p code,
.ml-page dd code,
.ml-page li code,
.ml-page .ct code,
.ml-page .ml-warn code,
.ml-page .ml-info code,
.ml-page .ml-step-note code {
  background: rgba(0, 0, 0, 0.07);
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  font-size: 0.92em;
}

.ml-terminal {
  margin-top: 0.5rem;
  max-width: 640px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.ml-terminal .ml-tbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.ml-terminal .ml-tver {
  margin-left: auto;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10.5px;
  letter-spacing: normal;
  text-transform: none;
  color: #4dff88;
  background: rgba(77, 255, 136, 0.1);
  border: 1px solid rgba(77, 255, 136, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
}

.ml-terminal .ml-tbody {
  padding: 18px 16px 20px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(13px, 2vw, 16px);
  color: #eaeaea;
  line-height: 1.6;
}

.ml-terminal .pr {
  color: #4dff88;
  margin-right: 8px;
}

.ml-terminal .u {
  color: #b7ffd4;
}

.ml-terminal .c {
  color: #ffc04d;
}

.ml-terminal .f {
  color: #4dff88;
}

.ml-terminal .v {
  color: #eaeaea;
}

.ml-terminal .ml-out {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.85em;
}

.ml-terminal .ml-cmt-pr {
  color: inherit;
  margin-right: 4px;
}

.kbd-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.85em;
  font-weight: 600;
  color: #eaeaea;
  background: linear-gradient(180deg, #34343a, #202024);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  padding: 0.18rem 0.55rem;
  margin: 0 0.1rem;
  line-height: 1.4;
  cursor: default;
  user-select: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 0 rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(0, 0, 0, 0.5),
    0 2px 0 rgba(0, 0, 0, 0.55),
    0 3px 0 rgba(0, 0, 0, 0.6),
    0 5px 8px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.08s ease, transform 0.08s ease;
}

.kbd-key:hover {
  background: linear-gradient(180deg, #3a3a41, #24242a);
}

.kbd-key:active,
.kbd-key:focus-visible {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.45);
}

.kbd-key:focus-visible {
  outline: none;
}

.badge.badge-dark {
  background: #000;
  color: #fff;
}

.badge.badge-dark.is-disabled {
  background: #e0e0e0;
  color: #8a8a8a;
}

.ml-eyebrow-center {
  text-align: center;
}

.ml-eyebrow-right {
  text-align: right;
}

@media (max-width: 600px) {
  .ml-eyebrow-right {
    text-align: left;
  }
}

.ml-lifecycle-note {
  margin: 0 0 1.75rem;
  font-size: 0.9rem;
  color: var(--body-text);
  line-height: 1.6;
  text-align: right;
}

@media (max-width: 600px) {
  .ml-lifecycle-note {
    text-align: left;
  }
}

.ml-feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 760px) {
  .ml-feat-grid {
    grid-template-columns: 1fr;
  }
}

.ml-feat {
  border: 1px solid var(--divider-bg);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
}

.ml-feat .ml-fic {
  display: inline-flex;
  align-items: center;
  color: #000;
  font-size: 0.95rem;
  margin-right: 0.5rem;
}

.ml-feat h3 {
  display: flex;
  align-items: center;
  text-align: left;
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.ml-feat p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--body-text);
  line-height: 1.55;
}

.ml-gram-str {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(14px, 2.6vw, 20px);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 1.25rem;
  border: 1px solid var(--divider-bg);
  border-radius: 10px;
  background: #fafafa;
}

.ml-tok {
  position: relative;
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid var(--divider-bg);
  background: #fff;
  color: var(--body-text);
  cursor: default;
  white-space: nowrap;
}

.ml-tok.opt {
  opacity: 0.6;
  border-style: dashed;
}

.ml-tok-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
  padding: 0.6rem 0.75rem;
  border-radius: 7px;
  background: #1a1a1a;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: normal;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}

.ml-tok-tip b {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color: #7ec4ff;
  font-size: 0.78rem;
}

.ml-tok-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a1a1a;
}

.ml-tok:hover .ml-tok-tip,
.ml-tok:focus-visible .ml-tok-tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.ml-tok:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ml-code {
  background: #12141a;
  color: #e3e9f2;
  border-radius: 10px;
  padding: 1rem 1.15rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
}

.ml-code .k { color: #ff9d4d; }
.ml-code .s { color: #9fe08f; }
.ml-code .n { color: #7ec4ff; }
.ml-code .cm { color: #7a8393; }
.ml-code .fn { color: #d7b8ff; }

.ml-code-cap {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.ml-schema-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .ml-schema-grid {
    grid-template-columns: 1fr;
  }
}

.ml-anat {
  border: 1px solid var(--divider-bg);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
}

.ml-anat dl {
  margin: 0;
}

.ml-anat dt {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 0.9rem;
}

.ml-anat dt:first-child {
  margin-top: 0;
}

.ml-anat dd {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--body-text);
  line-height: 1.55;
}

.ml-anat-divider {
  border: none;
  border-top: 1px solid var(--divider-bg);
  margin: 1.25rem 0 0;
}

.ml-typetab {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 1rem;
}

.ml-typetab th {
  text-align: left;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--divider-bg);
}

.ml-typetab td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--divider-bg);
  vertical-align: top;
  color: var(--body-text);
}

.ml-typetab tr:last-child td {
  border-bottom: none;
}

.ml-typetab .tn {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color: var(--heading);
  white-space: nowrap;
}

.ml-cmd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.ml-ccard {
  border: 1px solid var(--divider-bg);
  border-radius: 10px;
  padding: 1.25rem 1.35rem;
}

.ml-ccard .cn {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1.05rem;
  color: var(--heading);
  font-weight: 700;
}

.ml-ccard .ct {
  font-size: 0.82rem;
  color: var(--body-text);
  margin: 0.4rem 0 0.9rem;
  line-height: 1.5;
}

.ml-flagtab {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.ml-flagtab th {
  text-align: left;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 8px 6px;
  border-bottom: 1px solid var(--divider-bg);
}

.ml-flagtab td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--divider-bg);
  vertical-align: top;
  color: var(--body-text);
}

.ml-flagtab tr:last-child td {
  border-bottom: none;
}

.ml-flagtab .fc {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color: var(--accent);
  white-space: nowrap;
}

.ml-none {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.ml-tree {
  list-style: none;
  margin: 0;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--divider-bg);
  border-radius: 10px;
}

.ml-tree > li {
  margin-bottom: 1.1rem;
}

.ml-tree > li:last-child {
  margin-bottom: 0;
}

.ml-tree-branch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--heading);
  margin-bottom: 0.6rem;
}

.ml-tree-branch i {
  flex: none;
  color: #000;
  font-size: 0.85rem;
  width: 1.2rem;
  text-align: center;
}

.ml-tree-branch::after {
  content: "";
  position: absolute;
  left: 0.6rem;
  top: 100%;
  width: 1px;
  height: 0.6rem;
  background: var(--divider-bg);
}

.ml-tree ul {
  position: relative;
  list-style: none;
  margin: 0 0 0 0.6rem;
  padding: 0 0 0 0.9rem;
  border-left: 1px solid var(--divider-bg);
}

.ml-tree ul li {
  position: relative;
  padding: 0.35rem 0;
  font-size: 0.84rem;
  color: var(--body-text);
  line-height: 1.55;
}

.ml-tree ul li:last-child {
  padding-bottom: 0;
}

.ml-tree ul li::before {
  content: "";
  position: absolute;
  left: -0.9rem;
  top: 50%;
  width: 0.65rem;
  height: 1px;
  background: var(--divider-bg);
  transform: translateY(-50%);
}

.ml-tree ul li .tn {
  font-family: var(--font-sans);
  color: var(--heading);
  font-weight: 700;
}

.ml-flow {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .ml-flow {
    flex-direction: column;
    align-items: stretch;
  }
}

.ml-flow-step {
  flex: 1 1 0;
  border: 1px solid var(--divider-bg);
  border-radius: 10px;
  padding: 1.25rem 1.1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ml-flow-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f4f4f4;
  color: var(--heading);
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
  flex: none;
}

.ml-flow-step.is-accent .ml-flow-icon {
  background: #000;
  color: #fff;
}

.ml-flow-label {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--heading);
  margin-bottom: 0.35rem;
}

.ml-flow-desc {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.ml-flow-arrow {
  flex: none;
  align-self: center;
  color: var(--divider-bg);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  padding: 0 0.15rem;
}

.ml-flow-arrow i {
  color: #ccc;
}

@media (max-width: 900px) {
  .ml-flow-arrow {
    align-self: center;
    transform: rotate(90deg);
    padding: 0.15rem 0;
  }
}

.ml-play {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 860px) {
  .ml-play {
    grid-template-columns: 1fr;
  }
}

.ml-play-panel {
  border: 1px solid var(--divider-bg);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
}

.ml-play-label {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.ml-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ml-chip {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--divider-bg);
  border-radius: 6px;
  background: #fafafa;
  color: var(--body-text);
  cursor: pointer;
}

.ml-chip.on {
  background: #000;
  color: #fff;
  border-color: #000;
}

.ml-input {
  width: 100%;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--divider-bg);
  border-radius: 8px;
  color: var(--body-text);
  background: #fff;
}

.ml-input:focus {
  outline: none;
  border-color: var(--accent);
}

.ml-play-hint {
  margin-top: 0.75rem;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.5;
}

.ml-play-out {
  background: #12141a;
  color: #e3e9f2;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 160px;
}

.ml-play-out .k { color: #7ec4ff; }
.ml-play-out .s { color: #9fe08f; }
.ml-play-out .n { color: #ff9d4d; }
.ml-play-out .b { color: #d7b8ff; }
.ml-play-out .err { color: #ff7676; }

.ml-life-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
}

@media (max-width: 900px) {
  .ml-life-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .ml-life-grid {
    grid-template-columns: 1fr;
  }
}

.ml-life {
  border: 1px solid var(--divider-bg);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
}

.ml-life .ln {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
}

.ml-life p {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.ml-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

@media (max-width: 760px) {
  .ml-steps {
    grid-template-columns: 1fr;
  }
}

.ml-step-h {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.ml-step-h .idx {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.75rem;
  color: #fff;
  background: #000;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: none;
}

.ml-step-h h3 {
  margin: 0;
  text-align: left;
  font-size: 0.95rem;
}

.ml-step-note {
  font-size: 0.9rem;
  color: var(--body-text);
  line-height: 1.6;
  margin: 0.6rem 0;
}

.ml-step-card .ml-code {
  max-width: 100%;
  height: 210px;
  overflow-y: auto;
  box-sizing: border-box;
}

.ml-step-figure {
  margin: 0.9rem 0 0;
}

.ml-step-figure img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--divider-bg);
  border-radius: 8px;
}

.ml-warn {
  margin-top: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 6px;
  background: #fdecea;
  border: 1px solid #f0b8b0;
  font-size: 0.78rem;
  color: #7a2b21;
  line-height: 1.5;
}

.ml-info {
  margin-top: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 6px;
  background: #eaf4fd;
  border: 1px solid #b9dcf5;
  font-size: 0.78rem;
  color: #1f4e70;
  line-height: 1.5;
}

.ml-info code {
  background: rgba(31, 78, 112, 0.1);
}

.ml-caution {
  margin-top: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 6px;
  background: #fff8e6;
  border: 1px solid #f2d38a;
  font-size: 0.78rem;
  color: #6b4c05;
  line-height: 1.5;
}

.ml-caution code {
  background: rgba(107, 76, 5, 0.1);
}

.ml-caution-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.78rem;
  color: #8a5f00;
  margin: 0 0 0.3rem;
}

.ml-caution-title i {
  font-size: 0.8rem;
}
