/* ---------- Floating section index ---------- */
.mt-sn { position: fixed; right: clamp(10px, 1.6vw, 24px); top: 50%; transform: translate(12px, -50%); z-index: 90; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; opacity: 0; pointer-events: none; transition: opacity .4s ease, transform .4s cubic-bezier(.22,.61,.36,1); --sn-ink: #0E1116; --sn-muted: #5A606B; --sn-bg: #FFFFFF; --sn-rule: #E4E6EB; }
.mt-sn.is-shown { opacity: 1; transform: translate(0, -50%); pointer-events: auto; }
.mt-sn.is-on-dark { --sn-ink: #FFFFFF; --sn-muted: #B8BECA; --sn-bg: #0E1116; --sn-rule: #2E333D; }
.mt-sn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.mt-sn-item { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; justify-content: flex-end; gap: 12px; height: 22px; padding-left: 8px; }
.mt-sn-tick { display: block; width: 14px; height: 1px; background: var(--sn-muted); transition: width .35s cubic-bezier(.22,.61,.36,1), background-color .25s ease, height .2s ease; }
.mt-sn-item:hover .mt-sn-tick, .mt-sn-item:focus-visible .mt-sn-tick { width: 26px; background: var(--sn-ink); }
.mt-sn-item.is-active .mt-sn-tick { width: 34px; height: 2px; background: #2340D9; }
.mt-sn-label { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--sn-ink); background: var(--sn-bg); padding: 3px 7px; display: inline-flex; align-items: center; gap: 8px; opacity: 1; transform: none; transition: color .25s ease, background-color .25s ease; white-space: nowrap; pointer-events: none; color: var(--sn-muted); }
.mt-sn-label kbd { font: inherit; font-size: 10.5px; color: var(--sn-muted); border: 1px solid var(--sn-rule); padding: 0 4px; line-height: 1.5; }
.mt-sn-item:hover .mt-sn-label, .mt-sn-item:focus-visible .mt-sn-label { color: var(--sn-ink); }
.mt-sn-item.is-active .mt-sn-label { color: var(--sn-ink); background: var(--sn-bg); box-shadow: inset 0 0 0 1px var(--sn-rule); }

.mt-sn-item:focus-visible { outline: 2px solid #2340D9; outline-offset: 2px; }
.mt-sn-help { all: unset; box-sizing: border-box; cursor: pointer; width: 26px; height: 26px; display: grid; place-items: center; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; color: var(--sn-ink); border: 1px solid var(--sn-rule); background: var(--sn-bg); transition: border-color .25s ease; }
.mt-sn-help:hover, .mt-sn-help:focus-visible { border-color: var(--sn-ink); }
.mt-sn-help:focus-visible { outline: 2px solid #2340D9; outline-offset: 2px; }

/* Shortcut panel */
.mt-sn-panel { position: fixed; right: clamp(52px, 5vw, 76px); top: 50%; transform: translateY(-50%); z-index: 95; width: 300px; max-height: 86vh; overflow: auto; background: #FFFFFF; color: #0E1116; border: 1px solid #0E1116; padding: 18px 20px 20px; box-shadow: 0 1px 0 #E4E6EB; }
.mt-sn-panel[hidden] { display: none; }
.mt-sn-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mt-sn-panel-head p { margin: 0; font-family: "Fraunces", Georgia, serif; font-size: 20px; line-height: 1.2; letter-spacing: -0.01em; }
.mt-sn-close { all: unset; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; font-size: 20px; line-height: 1; }
.mt-sn-close:focus-visible { outline: 2px solid #2340D9; }
.mt-sn-keys { list-style: none; margin: 0; padding: 0; border-top: 1px solid #E4E6EB; }
.mt-sn-keys li { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid #E4E6EB; font-family: "IBM Plex Sans", system-ui, sans-serif; font-size: 14.5px; }
.mt-sn-keys kbd { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; min-width: 22px; text-align: center; border: 1px solid #0E1116; padding: 1px 5px; }
.mt-sn-keys--misc { margin-top: 14px; }

/* Mobile: floating button + drawer */
.mt-sn-fab { all: unset; box-sizing: border-box; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 90; display: none; align-items: center; gap: 10px; height: 44px; padding: 0 16px; background: #0E1116; color: #FFFFFF; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .35s ease, transform .35s ease; }
.mt-sn-fab .mt-sn-fab-cur { color: #2340D9; }
.mt-sn-fab.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.mt-sn-fab:focus-visible { outline: 2px solid #2340D9; outline-offset: 3px; }
.mt-sn-drawer { position: fixed; right: 16px; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 95; width: min(280px, calc(100vw - 32px)); background: #FFFFFF; border: 1px solid #0E1116; }
.mt-sn-drawer[hidden] { display: none; }
.mt-sn-sheet { list-style: none; margin: 0; padding: 6px 0; }
.mt-sn-sheet button { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: flex; gap: 14px; align-items: center; padding: 11px 18px; font-family: "IBM Plex Sans", system-ui, sans-serif; font-size: 16px; color: #0E1116; }
.mt-sn-sheet button span { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 11.5px; color: #5A606B; }
.mt-sn-sheet button.is-active { background: #EEF1FC; }
.mt-sn-sheet button.is-active span { color: #2340D9; }

@media (max-width: 1023px) {
  .mt-sn, .mt-sn-panel { display: none !important; }
  .mt-sn-fab { display: inline-flex; }
}
@media (hover: none) and (min-width: 1024px) { .mt-sn-label { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mt-sn, .mt-sn-fab, .mt-sn-tick, .mt-sn-label { transition: none !important; } }
@media print { .mt-sn, .mt-sn-fab, .mt-sn-panel, .mt-sn-drawer { display: none !important; } }

/* labels always visible: keep the rail compact on narrower desktops */
.mt-sn-label { background: color-mix(in srgb, var(--sn-bg) 88%, transparent); }
@media (max-width: 1279px) { .mt-sn-label kbd { display: none; } .mt-sn-label { font-size: 10.5px; padding: 2px 6px; } }
