@import url("/scrollbars.css?v=20261005");
/* MCS download page — extends /mcs/site.css tokens and components. */

/* The page head now carries only the breadcrumb, so it stays compact. */
.page-head {
    padding: 20px 0 18px;
    border-bottom: 1px solid var(--line);
    background: var(--hero-bg);
}
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover, .crumbs a:focus-visible { color: var(--accent); }
.crumbs span[aria-hidden] { opacity: .55; }

.section-plain { background: var(--surface); }

/* The download page is a working page, so sections run tighter than the homepage. */
#main .section { padding: 56px 0; }
#main .section-head { margin-bottom: 26px; }

/* ---------- latest release ---------- */

.latest-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; align-items: start; }

.latest-card {
    padding: 24px 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.latest-version { margin: 16px 0 0; font-size: 28px; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.latest-version .version-build { font-size: .5em; }
.latest-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 12px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 12.5px; }
.latest-meta li { display: inline-flex; align-items: center; gap: 7px; }
.latest-meta li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-line); }
.latest-meta code { padding: 1px 6px; border-radius: 4px; background: var(--surface-2); font: 12px ui-monospace, Consolas, "Cascadia Mono", monospace; color: var(--text); }
.latest-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; margin-top: 22px; }
.latest-actions .button { white-space: nowrap; }
.latest-card .download-notes { margin: 18px 0 0; }
.latest-card .download-notes.is-collapsed { max-height: 300px; }
.latest-card .download-notes.is-collapsed::after { background: linear-gradient(to bottom, transparent, var(--surface)); }

.latest-aside { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.aside-title { margin-bottom: 16px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .04em; }

.channel-card { position: relative; }
.channel-card[data-current="true"] { border-color: var(--accent-line); background: var(--accent-soft); }
.channel-card .channel-version { min-width: 0; }
.channel-pick {
    grid-column: 2; grid-row: 2 / span 2; align-self: center;
    padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 9px;
    background: transparent; color: var(--text);
    font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer;
    transition: background-color .16s, color .16s, border-color .16s;
}
.channel-pick:hover, .channel-pick:focus-visible { border-color: var(--accent); color: var(--accent); }
.channel-card[data-current="true"] .channel-pick { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

/* Narrow screens: stack the pick button under the version instead of beside it. */
@media (max-width: 640px) {
    .channel-card { grid-template-columns: minmax(0, 1fr); }
    .channel-pick { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 10px; }
}

/* ---------- download channel modal ---------- */

.dl-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.dl-modal[hidden] { display: none; }
.dl-modal-scrim { position: absolute; inset: 0; background: rgba(8, 18, 13, .5); backdrop-filter: blur(3px); animation: dlFade .16s ease both; }
.dl-modal-dialog {
    position: relative;
    width: min(720px, 100%);
    max-height: min(86vh, 760px);
    overflow-y: auto;
    padding: 24px 26px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: 0 30px 70px -24px rgba(8, 18, 13, .5);
    animation: dlPop .2s cubic-bezier(.2, .8, .2, 1) both;
}
/* Programmatic focus target for auto-opened dialogs: never show a focus ring here. */
.dl-modal-dialog:focus { outline: none; }
@keyframes dlFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dlPop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.dl-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dl-modal-title .eyebrow { margin-bottom: 6px; }
.dl-modal-title h2 { margin: 0; font-size: 21px; letter-spacing: -.015em; }
.dl-modal-close {
    display: inline-grid; place-items: center; flex: 0 0 auto;
    width: 34px; height: 34px; padding: 0;
    border: 1px solid var(--line); border-radius: 9px;
    background: transparent; color: var(--muted); cursor: pointer;
    transition: border-color .16s, color .16s, background-color .16s;
}
.dl-modal-close:hover, .dl-modal-close:focus-visible { border-color: var(--accent-line); color: var(--accent); background: var(--surface-2); }
.dl-modal-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* The version this dialog belongs to. */
.dl-modal-version {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
    margin: 18px 0 16px; padding: 12px 14px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface-2);
    overflow-wrap: anywhere;
}
.dl-modal-version .modal-version-name { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dl-modal-version .modal-version-meta { color: var(--muted); font-size: 12px; }
.dl-modal-version code { padding: 1px 6px; border-radius: 4px; background: var(--surface); font: 11.5px ui-monospace, Consolas, "Cascadia Mono", monospace; color: var(--text); word-break: break-all; }

.dl-modal-sources { display: grid; gap: 14px; }
.modal-platform-group { display: grid; gap: 8px; min-width: 0; }
.modal-platform-title {
    margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em;
    overflow-wrap: anywhere; word-break: break-word; white-space: normal;
}
.modal-platform-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: stretch; }
.modal-platform-pair .modal-source-block { height: 100%; }
.modal-platform-pair .modal-source { height: 100%; }
.modal-source {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface);
    color: var(--text); text-decoration: none;
    overflow-wrap: anywhere; word-break: break-word; white-space: normal;
    transition: border-color .16s ease, background-color .16s ease;
}
.modal-source:hover, .modal-source:focus-visible { border-color: var(--accent); background: var(--surface-2); }
.modal-source-copy { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.modal-source-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.modal-source-desc { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; line-height: 1.55; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.modal-source-go { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; color: var(--accent); font-size: 13px; font-weight: 700; }
.modal-source-go svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.modal-source.is-disabled { pointer-events: none; opacity: .5; }

/* Clickable access-code chip after the channel name; no separate copy button. */
.modal-source-block { display: grid; gap: 6px; min-width: 0; }
.modal-source-empty { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.modal-code-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 1px 8px; border: 1px solid transparent; border-radius: 5px;
    background: var(--accent-soft); color: var(--muted);
    font: inherit; font-size: 12px; font-weight: 400; cursor: pointer;
    transition: border-color .16s, color .16s;
}
.modal-code-chip code {
    color: var(--accent);
    font: 600 12.5px ui-monospace, Consolas, "Cascadia Mono", monospace;
    letter-spacing: .04em;
}
.modal-code-chip:hover, .modal-code-chip:focus-visible { border-color: var(--accent); color: var(--text); }
.modal-code-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Truncated SHA-256 chip in the version line; click copies the full hash. */
.modal-sha-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
}
.modal-sha-chip:hover code, .modal-sha-chip:focus-visible code { color: var(--accent); }
.modal-sha-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.modal-source-note { padding: 0 16px 0 18px; color: var(--muted); font-size: 12px; }

.dl-modal-note { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.dl-modal-note strong { color: var(--text); }

body.modal-open { overflow: hidden; }

@media (max-width: 640px) {
    .dl-modal { padding: 14px; align-items: end; }
    .dl-modal-dialog { width: 100%; max-height: 88vh; padding: 20px 18px 18px; }
    .modal-source { align-items: flex-start; }
    .modal-platform-pair { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- history ---------- */

.history-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.chip {
    padding: 8px 15px; border: 0; border-radius: 8px; background: transparent;
    color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
    transition: background-color .16s, color .16s;
}
.chip:hover { color: var(--text); background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); }
.history-count { margin: 0; color: var(--muted); font-size: 13px; }

/* Page changes replace every row at once, so keep the browser's scroll anchoring
   out of it and let the page change pick the scroll position itself. */
.history-list { display: grid; gap: 10px; overflow-anchor: none; }
.history-state { padding: 34px 0; color: var(--muted); text-align: center; font-size: 14px; }
/* Shown above stale rows when a page fetch fails; the rows stay put. */
.history-retry {
    padding: 10px 14px; border: 1px solid var(--accent-line); border-radius: var(--radius);
    background: var(--accent-soft); color: var(--accent);
    font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.history-retry:hover, .history-retry:focus-visible { filter: brightness(1.12); }
.history-retry:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.history-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 18px; align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface);
    transition: border-color .16s ease, background-color .16s ease;
}
.history-row:hover { border-color: var(--accent-line); }
.history-main { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; min-width: 0; }
.history-version { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.history-version .version-build { font-size: .72em; }
.history-sub { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 4px; color: var(--muted); font-size: 12px; }
.history-notes-toggle { border: 0; background: transparent; padding: 0; color: var(--accent); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.history-notes-toggle:hover, .history-notes-toggle:focus-visible { text-decoration: underline; }
.history-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.history-download {
    padding: 6px 14px; border: 1px solid var(--accent-line); border-radius: 9px;
    background: transparent;
    color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer;
    transition: background-color .16s, color .16s, border-color .16s;
}
.history-download:hover, .history-download:focus-visible { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.history-download:disabled { pointer-events: none; opacity: .5; }

.latest-badge {
    padding: 2px 8px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent);
    font-size: 11px; font-weight: 700;
}

/* ---------- history pagination ---------- */

/* The list renders one page of rows at a time so a long history stays scannable. */
.history-pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.history-pager[hidden] { display: none; }
.pager-btn {
    min-width: 38px; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: 9px;
    background: var(--surface); color: var(--muted);
    font: inherit; font-size: 13.5px; font-weight: 700;
    font-variant-numeric: tabular-nums; cursor: pointer;
    transition: border-color .16s, color .16s, background-color .16s;
}
.pager-btn:hover:not(:disabled), .pager-btn:focus-visible:not(:disabled) { border-color: var(--accent-line); color: var(--accent); }
.pager-btn[aria-current="page"] { border-color: var(--accent); background: var(--accent); color: var(--accent-contrast); }
.pager-btn:disabled { opacity: .45; cursor: default; }
.pager-btn.pager-step { padding: 8px 15px; }
.pager-gap { padding: 0 2px; color: var(--muted); font-size: 13.5px; }
.pager-info { width: 100%; margin: 2px 0 0; color: var(--muted); font-size: 12.5px; text-align: center; }

/* ---------- release-notes dialog ---------- */

/* Same shell as the channel dialog, a touch wider to suit running prose. */
.notes-modal .dl-modal-dialog { width: min(680px, 100%); }
.notes-modal-body { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.75; }
.notes-modal-body > :first-child { margin-top: 0; }

/* ---------- help ---------- */

.help-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.help-card { display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--canvas); }
.help-card h3 { margin-bottom: 8px; font-size: 16px; }
.help-card p { flex: 1 1 auto; margin-bottom: 14px; color: var(--muted); font-size: 14px; line-height: 1.75; }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
    .latest-layout { grid-template-columns: 1fr; }
    .help-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .page-head { padding: 18px 0 16px; }
    .section-plain, .section { padding: 60px 0; }
}
@media (max-width: 640px) {
    .page-head { padding: 16px 0 14px; }
    .latest-card { padding: 22px 20px; }
    .latest-version { font-size: 24px; }
    .latest-aside { padding: 20px; }
    .source-grid { grid-template-columns: 1fr; }
    .history-toolbar { flex-direction: column; align-items: stretch; }
    .filter-chips { justify-content: center; }
    .history-row { grid-template-columns: 1fr; padding: 14px 16px; }
    .history-actions { justify-content: flex-start; }
    .history-download { flex: 1 1 auto; text-align: center; }
}
