.md-page { width: var(--page); margin: 0 auto; }
.md-page [hidden] { display: none !important; }
.md-page.page-columns, .md-page .page-columns, #md-explorer.page-columns { display: block !important; }
.md-page .page-columns > * { grid-column: auto !important; }
.md-heading { max-width: 820px; margin: 3rem 0 1.5rem; }
.md-heading .eyebrow { color: var(--gold); margin-bottom: .7rem; }
.md-heading h1 { color: var(--paper); font-size: clamp(2.2rem, 7vw, 4.6rem); line-height: 1.06; margin: 0 0 1rem; }
.md-heading h1 em { color: var(--gold); }
.md-heading > p:last-child { color: var(--soft); font-size: 1.05rem; max-width: 64ch; }
.md-loading { color: var(--soft); }
.md-page button { font-family: var(--sans); }
.md-page button:focus-visible, .md-page input:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }

.md-panel { position: relative; margin-bottom: 1.5rem; padding: clamp(1.25rem, 3vw, 1.9rem); border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.md-panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; border-radius: var(--radius) var(--radius) 0 0; background: var(--rainbow); }
.md-panel .eyebrow { margin-bottom: .3rem; }
.md-panel h2 { margin: 0 0 .5rem; padding: 0; border: 0; color: var(--ink); font-size: clamp(1.7rem, 3vw, 2.3rem); }
.md-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .8rem 1.5rem; }
.md-transport { display: flex; flex-wrap: wrap; gap: .5rem; }
.md-play { padding: .6rem 1.4rem; border: 0; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 1rem; font-weight: 600; cursor: pointer; }
.md-btn { padding: .55rem 1rem; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font-size: .88rem; cursor: pointer; }
.md-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.md-story > p:not(.eyebrow) { max-width: 80ch; }
.md-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0 1.2rem; }
.md-step { padding: 1rem 1.1rem; border: 1px solid var(--paper-line); border-radius: 10px; background: #fffaf0; font-size: .9rem; }
.md-step h3 { margin: .4rem 0 .3rem; color: var(--ink); font-size: 1.15rem; }
.md-step p { margin: 0; }
.md-n { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--ink); color: var(--gold); font-family: var(--mono); font-size: .72rem; }
.md-story a { color: var(--pink-ink); }
.md-method { max-width: 90ch; margin: 1.75rem 0; color: var(--soft); font-size: .82rem; }
.md-method a { color: var(--gold); }
.md-signoff { margin: 2rem 0; text-align: center; font-family: var(--serif); font-size: 1.2rem; }
.md-status { margin: 1rem 0 0; padding: .55rem .8rem; border-radius: 8px; background: #fdf0cf; font-size: .88rem; }
.md-fine { margin: .8rem 0 0; color: var(--muted); font-size: .78rem; }
.md-label { margin: 1rem 0 .4rem; color: var(--muted); font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; }

/* The shelf of reels */
.md-shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: 0; padding: 0; list-style: none; }
.md-reel { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; border: 1.5px solid var(--paper-line); border-left: 6px solid var(--c); border-radius: 10px; background: #fffaf0; overflow: hidden; transition: opacity .2s; }
.md-reel.is-used { opacity: .4; }
.md-add { display: grid; gap: .1rem; padding: .55rem .6rem; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.md-add:disabled { cursor: default; }
.md-add strong { font-size: .86rem; line-height: 1.2; }
.md-add span { color: var(--muted); font-size: .72rem; line-height: 1.3; }
.md-add:not(:disabled):hover { background: color-mix(in srgb, var(--c) 12%, transparent); }
.md-hear { width: 2.4rem; border: 0; border-left: 1px solid var(--paper-line); background: transparent; color: var(--ink); font-size: .8rem; cursor: pointer; }
.md-hear:hover { background: color-mix(in srgb, var(--c) 18%, transparent); }

/* The master tape */
.md-tape { display: flex; align-items: stretch; gap: 3px; min-height: 64px; margin-top: .4rem; padding: 8px; border-radius: 10px; background: linear-gradient(180deg, #4a3220, #2f1f14); overflow-x: auto; }
.md-empty { margin: auto; color: #d9c4a3; font-size: .85rem; }
.md-seg { display: grid; align-content: center; gap: .1rem; min-width: 64px; flex-basis: 0; padding: .35rem .45rem; border: 0; border-radius: 4px; background: var(--c); color: #1f1830; text-align: left; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.md-seg b { font-family: var(--mono); font-size: .64rem; }
.md-seg span { overflow: hidden; font-size: .72rem; font-weight: 600; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.md-seg:hover { transform: translateY(-2px); }
.md-seg.is-on { box-shadow: 0 0 0 3px #fff5e1, 0 0 16px var(--c); }
.md-join { display: grid; place-items: center; flex: 0 0 auto; width: 1.3rem; border-radius: 4px; font-size: .75rem; font-weight: 700; }
.md-join.is-ok { background: #2fbf71; color: #fff; }
.md-join.is-bump { background: #e23d3d; color: #fff; }
.md-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-top: .7rem; }
.md-score { margin: 0; font-size: .9rem; font-weight: 600; }
.md-now { min-height: 1.3em; margin: .4rem 0 0; color: var(--purple); font-family: var(--mono); font-size: .74rem; }

/* Her Majesty */
.md-hm-ways { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 .9rem; }
.md-hm-strip { display: flex; gap: 3px; min-height: 52px; padding: 6px; border-radius: 10px; background: linear-gradient(180deg, #4a3220, #2f1f14); }
.md-hm-part { display: grid; place-items: center; min-width: 40px; flex-basis: 0; padding: .3rem; border-radius: 4px; color: #1f1830; font-size: .7rem; font-weight: 600; text-align: center; line-height: 1.15; }
.md-hm-part.is-mustard { background: #e23d80; } .md-hm-part.is-pam { background: #6b2fa0; color: #fff; } .md-hm-part.is-majesty { background: #ffc72c; }
.md-hm-part.is-crash { background: #ff9fc6; } .md-hm-part.is-note { background: #fff1b8; } .md-hm-part.is-end { background: #0a8f84; color: #fff; }
.md-hm-part.is-silence { background: repeating-linear-gradient(90deg, #6b4a2f 0 6px, #5a3d24 6px 12px); color: #e9d7b8; }
.md-hm-part.is-on { box-shadow: 0 0 0 3px #fff5e1; }
.md-hm-strip:empty::before { content: "Pick one of the three above."; margin: auto; color: #d9c4a3; font-size: .85rem; }
@media (max-width: 1000px) { .md-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); } .md-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .md-shelf { grid-template-columns: minmax(0, 1fr); } .md-steps { grid-template-columns: minmax(0, 1fr); } .md-tape { flex-wrap: wrap; } .md-seg { flex: 1 1 40%; } .md-join { width: 100%; height: .9rem; flex-basis: 100%; font-size: .6rem; } }

/* Drag and drop splicing */
.md-add:not(:disabled), .md-seg { cursor: grab; }
.md-seg { touch-action: none; }
.md-tape { position: relative; }
.md-tape.is-target { box-shadow: inset 0 0 0 2px #ffd76a; }
.md-mark { position: absolute; top: 4px; bottom: 4px; width: 4px; margin-left: -2px; border-radius: 2px; background: #ffd76a; box-shadow: 0 0 10px #ffd76a; pointer-events: none; }
.md-seg.is-lifted { opacity: .35; }
.md-ghost { position: fixed; left: 0; top: 0; z-index: 10050; max-width: 180px; padding: .35rem .6rem; border-radius: 5px; background: var(--c); color: #1f1830; font-family: var(--sans); font-size: .78rem; font-weight: 650; box-shadow: 0 8px 22px rgba(0,0,0,.4); pointer-events: none; }
.md-ghost.is-off { opacity: .6; text-decoration: line-through; }
