.ms {
  --syn-tag: #2d7850;
  --syn-attr: #8a5a9e;
  --syn-val: #a5641f;
  --syn-num: #2f6fa8;
  --syn-pi: #8b928c;
  --ms-tint: color-mix(in srgb, var(--main) 10%, transparent);
  --ms-ring: color-mix(in srgb, var(--main) 30%, transparent);
  --ms-note: #f6efdc;
  --ms-note-ink: #5b4a1c;
}
:root[data-theme="dark"] .ms {
  --syn-tag: #8dcfa3;
  --syn-attr: #c9a3d9;
  --syn-val: #e2b878;
  --syn-num: #8fbde6;
  --syn-pi: #7d8792;
  --ms-note: #2a2619;
  --ms-note-ink: #e8d7a8;
}
.ms .t { color: var(--syn-tag); }
.ms .a { color: var(--syn-attr); }
.ms .v { color: var(--syn-val); }
.ms .n { color: var(--syn-num); }
.ms .p { color: var(--syn-pi); }

.ms-wide { width: min(100%, 1280px); margin-left: max(0px, calc((100% - var(--side-w) - 1120px) / 2)); }

.ms-hero { padding: 0 var(--home-gutter) clamp(72px, 8vw, 112px); }
.ms-hero__grid { display: grid; grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); gap: clamp(36px, 4.4vw, 72px); align-items: center; padding-top: clamp(36px, 5vh, 64px); }
.ms-hero__copy { min-width: 0; }
.home .ms-chip { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 24px; padding: 5px 13px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--home-surface); color: var(--secondary); font-size: 12.5px; }
.ms-chip code { padding: 2px 8px; border-radius: 999px; background: var(--ms-tint); color: var(--syn-tag); font-family: var(--font-mono); font-size: 11px; }
.home.landing-page .ms-hero h1 { max-width: 13ch; margin: 0 0 20px; font-size: clamp(38px, 4.4vw, 64px); line-height: 1.03; text-align: left; }
.home .ms-hero .lead { max-width: 44ch; margin: 0 0 30px; text-align: left; }
.home .ms-drop { max-width: 500px; min-height: 0; margin: 0; padding: 28px 24px 24px; }
.ms-hero .drop__error { max-width: 500px; margin: 14px 0 0; text-align: left; }
.ms-hero .home-privacy { justify-content: flex-start; max-width: 500px; margin: 20px 0 0; text-align: left; }
.ms-next { margin: 14px 0 0; padding: 0; list-style: none; }
.home .ms-next li { margin: 0; padding: 4px 0; color: var(--secondary); font-size: 13px; line-height: 1.6; }
.ms-next a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 4px; }

.ms-code { --lh: 22px; position: relative; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--home-surface); box-shadow: inset 0 1px 0 var(--glass-shine), 0 50px 100px -60px #1a3a2673; }
:root[data-theme="dark"] .ms-code { box-shadow: inset 0 1px 0 var(--glass-shine), 0 50px 100px -60px #000000b3; }
.ms-code__bar { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--bg-secondary); }
.ms-dots { display: inline-flex; flex: none; gap: 6px; }
.ms-dots i { width: 9px; height: 9px; border-radius: 50%; background: color-mix(in srgb, var(--text) 16%, transparent); }
.ms-code__name { color: var(--text); font-family: var(--font-mono); font-size: 11.5px; }
.ms-code__tag { margin-left: auto; padding: 3px 10px; border-radius: 999px; background: var(--ms-note); color: var(--ms-note-ink); font-size: 11.5px; font-weight: 500; }
.ms-code__body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(176px, .58fr); padding: 14px 0 16px; }
.ms-lines { margin: 0; padding: 0; list-style: none; counter-reset: ln; color: var(--text); font-family: var(--font-mono); font-size: clamp(10.5px, .82vw, 12.5px); line-height: var(--lh); }
.ms-lines li { position: relative; height: var(--lh); padding-left: calc(4.6ch + var(--d, 0) * 2ch); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; counter-increment: ln; }
.ms-lines li::before { content: counter(ln); position: absolute; left: 0; width: 3.2ch; color: color-mix(in srgb, var(--secondary) 60%, transparent); text-align: right; }
.ms-lines .d1 { --d: 1; } .ms-lines .d2 { --d: 2; } .ms-lines .d3 { --d: 3; } .ms-lines .d4 { --d: 4; }
.ms-lines li.is-noted { background: linear-gradient(90deg, transparent 3.8ch, color-mix(in srgb, var(--ms-note) 85%, transparent) 3.8ch); }
.ms-fold { display: inline-block; margin: 0 2px; padding: 0 6px; border-radius: 4px; background: var(--bg-secondary); color: var(--secondary); line-height: 1.5; }
.ms-notes { position: relative; }
.ms-note { position: absolute; top: calc(var(--row) * var(--lh) + var(--lh) / 2); translate: 0 -50%; right: 14px; left: 10px; margin: 0; padding: 6px 9px; border: 1px solid color-mix(in srgb, var(--ms-note-ink) 22%, transparent); border-radius: 10px; background: var(--ms-note); color: var(--ms-note-ink); font-size: 11px; line-height: 1.35; box-shadow: 0 8px 18px -12px #00000040; }
.ms-note::before { content: ""; position: absolute; top: 50%; left: -11px; width: 10px; height: 1px; background: color-mix(in srgb, var(--ms-note-ink) 40%, transparent); }
.ms-note b { display: block; margin-bottom: 2px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; }

.home.ms .prose { width: auto; max-width: none; margin: 0; padding: 0; }
.home.ms .prose > .prose__answer { width: calc(100% - var(--side-w) - 2 * var(--home-gutter)); max-width: 1120px; margin: 0 auto 0 max(var(--home-gutter), calc((100% - var(--side-w) - 1120px) / 2)); }
.ms-block { padding: clamp(80px, 9vw, 120px) var(--home-gutter); border-top: 1px solid var(--line); text-align: left; }
.ms-problem, .ms-shows, .ms-vs { background: var(--bg-secondary); }
.home.ms .ms-block h2 { max-width: 18ch; margin: 0 0 26px; color: var(--text); font-size: clamp(30px, 3.4vw, 48px); font-weight: 500; line-height: 1.08; letter-spacing: -.05em; text-wrap: balance; }
.home.ms .ms-block p { margin: 0 0 18px; color: var(--secondary); font-size: 16.5px; line-height: 1.8; text-wrap: pretty; }
.home.ms .ms-block p:last-child { margin-bottom: 0; }
.home.ms .ms-block .ms-kicker { margin: 0 0 14px; color: var(--syn-pi); font-family: var(--font-mono); font-size: 12px; }
.ms-block a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.ms-block code { color: var(--text); font-size: .88em; }

.ms-problem__grid, .ms-why__grid, .ms-vs__grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: clamp(32px, 4vw, 64px); align-items: start; }
.ms-lab { position: sticky; top: 32px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--home-surface); box-shadow: inset 0 1px 0 var(--glass-shine), 0 40px 80px -56px #1a3a2666; }
.ms-tabs { display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--bg-secondary); }
.ms-tabs button { flex: 1; min-height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--secondary); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: background-color .25s var(--ease-out), color .25s var(--ease-out); }
.ms-tabs button:hover { color: var(--text); }
.ms-tabs button[aria-selected="true"] { background: var(--home-surface); box-shadow: 0 1px 3px var(--glass-shadow), inset 0 0 0 1px var(--line); color: var(--text); }
.ms-tabs button:focus-visible, .ms-chips button:focus-visible, .ms-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ms-ring); }
.ms-pane { padding: 22px; }
.home.ms .ms-block .ms-pane__lead { margin: 0 0 14px; color: var(--text); font-size: 14px; font-weight: 500; }
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.ms-chips button { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-secondary); color: var(--text); font-family: var(--font-mono); font-size: 12.5px; cursor: pointer; transition: background-color .25s var(--ease-out), border-color .25s var(--ease-out), color .25s var(--ease-out); }
.ms-chips button[aria-pressed="true"] { border-color: color-mix(in srgb, var(--main) 45%, var(--line)); background: var(--ms-tint); color: var(--main); }
.home.ms .ms-block .ms-line { margin: 0 0 14px; padding: 10px 12px; overflow-x: auto; border-radius: 10px; background: var(--bg-secondary); color: var(--text); font-family: var(--font-mono); font-size: 13px; line-height: 1.5; white-space: nowrap; }
.ms-answer { padding: 16px; border-radius: 14px; background: var(--ms-tint); }
.home.ms .ms-block .ms-answer__big { margin: 0 0 4px; color: var(--text); font-size: 26px; font-weight: 500; line-height: 1.2; letter-spacing: -.03em; }
.home.ms .ms-block .ms-answer__sub { margin: 0; font-size: 14px; line-height: 1.6; }
.ms-chase { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 16px; }
.ms-map { position: relative; border-radius: 6px; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--text) 10%, transparent) 0 2px, transparent 2px 5px); }
.ms-map i { position: absolute; top: 4%; right: -3px; left: -3px; height: 8px; border-radius: 3px; background: var(--main); box-shadow: 0 0 0 3px var(--ms-tint); transition: top .6s var(--ease-out); }
.ms-chase__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ms-btn { min-height: 40px; padding: 0 15px; border: 0; border-radius: 11px; background: var(--action-bg); color: var(--action-ink); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: background-color .2s var(--ease-out), opacity .2s var(--ease-out); }
.ms-btn:hover { background: var(--action-hover); }
.ms-btn:disabled { opacity: .45; cursor: default; }
.ms-btn--ghost { border: 1px solid var(--line); background: var(--bg-secondary); color: var(--link); }
.ms-btn--ghost:hover { background: var(--bg-secondary); border-color: var(--border-hover); }
.home.ms .ms-block .ms-answer__count { margin: 14px 0 0; font-size: 13px; }
.ms-answer__count b { color: var(--text); font-size: 20px; font-weight: 500; font-variant-numeric: lining-nums proportional-nums; }
.ms-tree { margin: 0 0 16px; padding: 10px 12px; border-radius: 12px; background: var(--bg-secondary); list-style: none; }
.home.ms .ms-tree li { position: relative; display: flex; align-items: center; gap: 10px; margin: 0; padding: 4px 0 4px 0; color: var(--text); font-size: 13.5px; line-height: 1.45; transition: padding-left .6s var(--ease-out); }
.ms-tree li.is-sum { font-weight: 600; }
.ms-tree__lvl { display: inline-grid; flex: none; place-items: center; width: 22px; height: 20px; border-radius: 5px; background: var(--home-surface); color: var(--syn-num); font-family: var(--font-mono); font-size: 11px; font-weight: 400; box-shadow: 0 0 0 1px var(--line); transition: opacity .4s var(--ease-out), width .4s var(--ease-out); }
.home.ms .ms-tree.is-tree li { padding-left: calc((var(--lvl) - 1) * 22px); }
.ms-tree.is-tree li::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc((var(--lvl) - 2) * 22px + 10px); width: 1px; background: var(--border-hover); opacity: 0; transition: opacity .5s var(--ease-out) .2s; }
.ms-tree.is-tree li:not([style*="--lvl:1"])::before { opacity: .6; }
.ms-tree.is-tree .ms-tree__lvl { opacity: 0; width: 0; margin-right: -10px; }

.ms-save { padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--home-surface); box-shadow: inset 0 1px 0 var(--glass-shine), 0 40px 80px -56px #1a3a2666; }
.home.ms .ms-block .ms-save__label { margin: 0 0 8px; color: var(--secondary); font-size: 12.5px; }
.ms-save__list { margin: 0 0 22px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-secondary); list-style: none; }
.home.ms .ms-save__list li { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 8px 10px; border-radius: 7px; color: var(--secondary); font-size: 13.5px; }
.home.ms .ms-save__list li.is-picked { background: var(--action-bg); color: var(--action-ink); }
.ms-save__list li span { padding: 1px 7px; border-radius: 999px; background: #ffffff2e; color: var(--action-ink); font-family: var(--font-mono); font-size: 10.5px; }
.ms-route { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ms-route + .ms-route { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ms-route__node { padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-secondary); color: var(--text); font-size: 13px; }
.ms-route__node.is-file { border-color: color-mix(in srgb, var(--main) 40%, var(--line)); background: var(--ms-tint); color: var(--main); font-family: var(--font-mono); }
.ms-route__arrow { width: 22px; height: 1px; background: var(--border-hover); position: relative; }
.ms-route__arrow::after { content: ""; position: absolute; top: -3px; right: -1px; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent; border-left: 5px solid var(--border-hover); }
.ms-route--alt .ms-route__node.is-file { border-color: var(--line); background: var(--bg-secondary); color: var(--secondary); }
.ms-route__note { color: var(--secondary); font-size: 12.5px; }

.ms-shows__head { margin-bottom: 32px; }
.ms-tags { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.home.ms .ms-tags li { margin: 0; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--home-surface); box-shadow: inset 0 1px 0 var(--glass-shine); }
.ms-tags__tag { display: inline-block; max-width: 100%; margin-bottom: 14px; padding: 6px 10px; overflow: hidden; border-radius: 8px; background: var(--bg-secondary); font-family: var(--font-mono); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.home.ms .ms-block .ms-tags p { margin: 0; font-size: 15.5px; line-height: 1.7; }
.ms-tags strong { color: var(--text); font-weight: 500; }

.ms-trip__head { margin-bottom: 28px; }
.ms-trip__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ms-trip__card { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--home-surface); box-shadow: inset 0 1px 0 var(--glass-shine); }
.ms-trip__card--in { border-color: color-mix(in srgb, var(--main) 35%, var(--line)); }
.home.ms .ms-block .ms-trip__title { margin: 0 0 12px; color: var(--text); font-size: 15px; font-weight: 600; }
.home.ms .ms-block .ms-trip__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.ms-trip__chips code { padding: 3px 8px; border-radius: 7px; background: var(--ms-tint); color: var(--syn-tag); font-size: 12px; }
.home.ms .ms-block .ms-trip__card p:not(.ms-trip__title):not(.ms-trip__chips) { font-size: 15px; line-height: 1.75; }
.ms-trip__list { margin: 0; padding: 0; list-style: none; }
.home.ms .ms-trip__list li { position: relative; margin: 0; padding: 9px 0 9px 20px; border-top: 1px solid var(--line); color: var(--secondary); font-size: 14.5px; line-height: 1.6; }
.ms-trip__list li::before { content: ""; position: absolute; top: 17px; left: 2px; width: 9px; height: 1.6px; border-radius: 1px; background: var(--secondary); }
.ms-trip__list strong { color: var(--text); font-weight: 500; }
.home.ms .ms-block .ms-oneway { max-width: 72ch; margin: 26px 0 0; }

.ms-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--home-surface); box-shadow: inset 0 1px 0 var(--glass-shine); }
.ms-pair__win { min-width: 0; overflow: hidden; border-radius: 12px; }
.ms-pair__win--bin { background: #0f1113; }
.ms-pair__win--txt { border: 1px solid var(--line); background: var(--bg-secondary); }
.home.ms .ms-block .ms-pair__head { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 8px 12px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); font-size: 12px; }
.ms-pair__head b { font-family: var(--font-mono); font-weight: 600; }
.ms-pair__win--bin .ms-pair__head { border-color: #23262b; color: #9aa0a8; }
.ms-pair__win--bin .ms-pair__head b { color: #e8b86b; }
.ms-pair__win--txt .ms-pair__head b { color: var(--syn-tag); }
.ms-pair pre { margin: 0; padding: 10px 12px 12px; overflow: hidden; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.7; white-space: pre; }
.ms-pair__win--bin pre { color: #dfe3e780; }
.ms-pair__win--txt pre { color: var(--text); }
.ms-pair__facts { grid-column: 1 / -1; margin: 6px 0 0; }
.ms-pair__facts div { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--line); font-size: 13.5px; }
.ms-pair__facts dt { color: var(--secondary); }
.ms-pair__facts dd { margin: 0; color: var(--text); }
.ms-pair__facts dd.is-yes { color: var(--main); font-weight: 500; }

.ms-qfold { max-width: 900px; padding: 10px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--home-surface); counter-reset: q; interpolate-size: allow-keywords; }
.ms-q { position: relative; counter-increment: q; }
.ms-q summary { position: relative; display: flex; align-items: baseline; gap: 6px; padding: 12px 20px 12px 64px; color: var(--text); font-size: 16px; font-weight: 500; line-height: 1.5; list-style: none; cursor: pointer; transition: background-color .2s var(--ease-out); }
.ms-q summary::-webkit-details-marker { display: none; }
.ms-q summary::before { content: counter(q); position: absolute; top: 14px; left: 14px; width: 2.5ch; color: color-mix(in srgb, var(--secondary) 60%, transparent); font-family: var(--font-mono); font-size: 12px; text-align: right; }
.ms-q summary i { position: absolute; top: 19px; left: 44px; width: 0; height: 0; border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; border-left: 6px solid var(--secondary); transition: transform .3s var(--ease-out); }
.ms-q[open] summary i { transform: rotate(90deg); border-left-color: var(--main); }
.ms-q summary .t { font-family: var(--font-mono); font-size: 12px; font-weight: 400; opacity: .7; }
.ms-q summary:hover { background: color-mix(in srgb, var(--main) 5%, transparent); }
.ms-q summary:focus-visible { outline: none; background: var(--ms-tint); }
.home.ms .ms-block .ms-q p { margin: 0 20px 14px 64px; padding: 2px 0 2px 16px; border-left: 1px solid var(--line); font-size: 15px; line-height: 1.75; }

@media (prefers-reduced-motion: no-preference) {
  .ms-lines li { animation: ms-type .4s steps(8, end) backwards; animation-delay: calc(500ms + var(--i, 0) * 70ms); }
  .ms-note { animation: ms-note .6s var(--ease-spring) backwards; animation-delay: calc(1900ms + var(--n, 0) * 350ms); }
  .ms-q::details-content { block-size: 0; overflow: hidden; transition: block-size .4s var(--ease-out), content-visibility .4s allow-discrete; }
  .ms-q[open]::details-content { block-size: auto; }
  @keyframes ms-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
  @keyframes ms-note { from { opacity: 0; transform: translateX(10px) scale(.97); } }
}

@media (max-width: 1100px) {
  .ms-hero__grid, .ms-problem__grid, .ms-why__grid, .ms-vs__grid, .ms-trip__grid { grid-template-columns: minmax(0, 1fr); }
  .ms-lab { position: static; }
  .ms-tags { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .ms-code__body { grid-template-columns: minmax(0, 1fr); }
  .ms-notes { display: grid; gap: 8px; padding: 12px 14px 0; }
  .ms-note { position: relative; top: auto; right: auto; left: auto; translate: none; }
  .ms-note::before { display: none; }
  .ms-lines { font-size: 10px; }
  .ms-tabs button { font-size: 12px; padding: 0 6px; }
  .ms-pair { grid-template-columns: minmax(0, 1fr); }
  .ms-q summary { padding-left: 52px; font-size: 15px; }
  .ms-q summary::before { left: 6px; }
  .ms-q summary i { left: 34px; }
  .home.ms .ms-block .ms-q p { margin-left: 52px; }
}
