/* Download modal — scoped, self-contained. Safe to remove this whole file. */
.download-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vh 4vw;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0s linear 0.18s;
    z-index: 1000;
}
.download-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.18s ease, visibility 0s linear 0s;
}
.download-modal-box {
    position: relative;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    padding: 2.4em 2.4em 2em;
    max-width: 920px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    box-sizing: border-box;
}
.download-modal-box h2 {
    text-align: center;
    margin: 0 0 0.4em;
    padding: 0;
    font-weight: 600;
    color: #353535;
}
.download-modal-box h3 {
    margin: 1.6em 0 0.55em;
    padding: 0;
    font-weight: 600;
    font-size: 1em;
    color: #353535;
}
.download-modal-subtitle {
    text-align: center;
    margin: 0 0 1.4em;
    color: #6a6a6c;
    font-size: 0.92em;
}
.download-modal-subtitle code {
    font-family: "Fira Code", monospace;
    font-size: 0.92em;
    background-color: #f1f1f3;
    padding: 1px 5px;
    border-radius: 4px;
}

/* File-structure tree */
.download-modal-tree {
    margin: 0 0 0.6em;
    padding: 1em 1.1em;
    background-color: #f6f7f9;
    border: 1px solid #e6e7eb;
    border-radius: 8px;
    font-family: "Fira Code", monospace;
    font-size: 0.82em;
    line-height: 1.55;
    white-space: pre;
    overflow-x: auto;
    color: #353535;
}
.download-modal-tree-note {
    margin: 0.1em 0 0;
    color: #6a6a6c;
    font-size: 0.85em;
    line-height: 1.45;
}

/* Tool tabs */
.download-modal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 1em 0 0.6em;
    border-bottom: 1px solid #e6e7eb;
    padding-bottom: 0;
}
.download-modal-tab {
    appearance: none;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    color: #6a6a6c;
    font-family: inherit;
    font-size: 0.92em;
    font-weight: 500;
    padding: 0.45em 0.95em;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    margin-bottom: -1px;
    line-height: 1.2;
}
.download-modal-tab:hover {
    color: #353535;
    background-color: #f1f1f3;
}
.download-modal-tab.is-active {
    color: #353535;
    background-color: #ffffff;
    border-color: #e6e7eb;
    border-bottom-color: #ffffff;
}
.download-modal-tab code {
    font-family: "Fira Code", monospace;
    font-size: 0.95em;
}

/* Command blocks (one per scope, swapped by tool tab) */
.download-modal-cmd {
    display: none;
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.download-modal-cmd.is-active {
    display: block;
}
.download-modal-cmd pre {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
}
.download-modal-cmd pre code {
    font-family: "Fira Code", monospace;
    font-size: 0.78em;
    line-height: 1.55;
    white-space: pre;
    border: none !important;
    border-radius: 8px !important;
    margin: 0 !important;
    display: block;
    padding: 0.95em 1.05em !important;
    background-color: #f6f7f9 !important;
    color: #353535 !important;
}

.download-modal-section-note {
    margin: 0.5em 0 0;
    color: #6a6a6c;
    font-size: 0.85em;
    line-height: 1.45;
}
.download-modal-section-note code {
    font-family: "Fira Code", monospace;
    font-size: 0.92em;
    background-color: #f1f1f3;
    padding: 1px 5px;
    border-radius: 4px;
}

.download-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #9f9fa0;
    cursor: pointer;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    line-height: 1;
    padding: 0;
}
.download-modal-close:hover {
    background-color: #ececec;
    color: #353535;
}
body.download-modal-open {
    overflow: hidden;
}
