/* Related tools as a card row at the bottom of a tool page, with buttons back to the tool's door
   and to the home doors screen. The row replaces the small related links in the top bar. */
.mms-related-cards{display:flex;flex-direction:column;gap:8px;min-width:0;box-sizing:border-box}
.mms-related-head{display:flex;align-items:center;justify-content:space-between;gap:8px 12px;flex-wrap:wrap}
.mms-related-cards h2{margin:0;font:700 14px/1.3 system-ui,"Segoe UI",Arial,sans-serif;color:#99f6e4}
.mms-related-cards-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:10px}
.mms-related-card{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;min-height:64px;box-sizing:border-box;padding:12px 16px;border:1px solid color-mix(in srgb,#2dd4bf 55%,#334155);border-radius:14px;background:color-mix(in srgb,#2dd4bf 9%,#172235);color:#eef2f8;text-decoration:none;font:600 15px/1.35 system-ui,"Segoe UI",Arial,sans-serif;transition:background-color .18s,border-color .18s}
.mms-related-card:hover{background:color-mix(in srgb,#2dd4bf 18%,#172235);border-color:#2dd4bf}
.mms-related-card-arrow{color:#2dd4bf;font-size:22px}
.mms-related-nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.mms-related-nav a{display:inline-flex;align-items:center;gap:6px;min-height:32px;box-sizing:border-box;padding:4px 13px;border:1px solid #475569;border-radius:999px;background:#1e293b;color:#dbe4f0;text-decoration:none;font:600 13px/1.2 system-ui,"Segoe UI",Arial,sans-serif;white-space:nowrap;transition:background-color .18s,border-color .18s}
.mms-related-nav a:hover{background:#273449;border-color:#94a3b8;color:#fff}
:is(.mms-related-card,.mms-related-nav a):focus-visible{outline:3px solid #99f6e4;outline-offset:2px}
/* Screen-fitted tools: a compact row above the footer, so the page still fits with no scrolling. */
.mms-related-cards.mms-related-compact{flex:none;width:100%;gap:6px;margin:6px 0 0;padding:0 12px}
.mms-related-compact .mms-related-card{min-height:44px;padding:6px 14px;font-size:14px;border-radius:10px}
.mms-related-compact .mms-related-card-arrow{font-size:18px}
.mms-related-compact .mms-related-nav a{min-height:28px;padding:3px 11px;font-size:12px}
@media(max-width:600px){.mms-related-card{min-height:44px;padding:6px 12px;font-size:13px}.mms-related-cards-list{gap:6px}}
/* The cards replace the small related links in the top bar on this page. */
.studio-related-link{display:none!important}
/* One card size on every page: same width and height whatever the number of cards or the page layout. */
html :is(.mms-related-cards-list,.cof-related-list){display:flex!important;flex-wrap:wrap;justify-content:flex-start;gap:8px!important}
html :is(.mms-related-card,.cof-related-card){flex:0 0 260px!important;width:260px!important;max-width:260px!important;min-width:0!important;margin:0!important;height:48px!important;min-height:48px!important;box-sizing:border-box!important;padding:4px 14px!important;gap:8px!important;border-radius:10px!important;font:600 14px/1.25 system-ui,"Segoe UI",Arial,sans-serif!important}
html :is(.mms-related-card,.cof-related-card)>span:first-child{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
html :is(.mms-related-card-arrow,.cof-related-arrow){font-size:18px!important}
@media(max-width:600px){html :is(.mms-related-card,.cof-related-card){flex:0 0 calc((100% - 16px) / 3)!important;width:auto!important;max-width:none!important;padding:4px 8px!important;font-size:12px!important}html .cof-related:has(.mms-related-nav){flex-direction:column!important;align-items:stretch!important;gap:6px!important}html .cof-related:has(.mms-related-nav) .mms-related-nav{margin:0!important}}
/* Row below the tool (related-cards.js sets its top): the tool keeps its full size; the row is reached by scrolling. */
.mms-related-below{position:absolute;inset-inline:0;top:100vh;z-index:5;box-sizing:border-box;padding:14px max(14px,calc((100% - 1500px) / 2)) 22px;background:#0f172a;border-top:1px solid rgba(148,163,184,.22);direction:inherit}
.mms-related-below[dir=rtl]{direction:rtl}.mms-related-below[dir=ltr]{direction:ltr}
/* The page being shown: marked, not a link. */
html .mms-related-card.is-current{cursor:default;border-color:#99f6e4;background:color-mix(in srgb,#2dd4bf 26%,#172235);box-shadow:inset 0 0 0 1px #99f6e4}
html .mms-related-card.is-current .mms-related-card-arrow{font-size:12px!important;color:#99f6e4}
/* One page serves both languages (?lang=en): show the row that matches the top bar's home link. */
html:has(.studio-identity[href$="index-en.html"]) .mms-related-cards[lang=he],html:not(:has(.studio-identity[href$="index-en.html"])) .mms-related-cards[lang=en][data-pair]{display:none!important}
/* Guitar chords on small screens scroll inside the tool; let that scroll continue to the row. */
html[data-chord-edition=guitar]:has(.mms-related-below) #root main{overscroll-behavior-y:auto!important}
/* Links that leave the site (YouTube): red tint and an outward arrow. */
html .mms-related-card.mms-related-external{border-color:color-mix(in srgb,#ef4444 55%,#334155);background:color-mix(in srgb,#ef4444 10%,#172235)}
html .mms-related-card.mms-related-external:hover{border-color:#f87171;background:color-mix(in srgb,#ef4444 18%,#172235)}
html .mms-related-card.mms-related-external .mms-related-card-arrow{color:#f87171}
/* YouTube song links are half a card wide, so two of them share one card's place. */
@media(min-width:601px){html .mms-related-card.mms-related-external{flex:0 0 126px!important;width:126px!important;max-width:126px!important;grid-template-columns:minmax(0,1fr)!important;padding:4px 10px!important;font-size:13px!important}html .mms-related-card.mms-related-external .mms-related-card-arrow{display:none}}
