/* ==========================================
   Tải xuống (UI-REST), approved two-card Graphite mockup 03/10/2026. Loaded after graphite.css and users.css: reuses
   us-head, us-alert, us-toast, sd-state and adds only the cards. Colours come from --g-* tokens (Dark and Light).
   ========================================== */

.dl .muted { color: var(--g-muted); }
.dl-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* Card */
.dl-card { position: relative; display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 24px; border: 1px solid var(--g-line); border-radius: 16px;
    background: linear-gradient(180deg, var(--g-raised), var(--g-panel) 140px); box-shadow: var(--g-shadow); }
.dl-card-top { display: flex; align-items: center; gap: 16px; }
/* App icons (256 px PNG, native colours in both themes: no frame, filter, tint or opacity) */
.dl-mark { display: block; width: 64px; height: 64px; flex: none; }
.dl-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.dl-card-title { min-width: 0; }
.dl-kind { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--g-muted); }
.dl-card-title h2 { margin: 3px 0 0; font-size: 21px; font-weight: 600; line-height: 1.2; color: var(--g-text); overflow-wrap: anywhere; }
.dl-purpose { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--g-text-2); min-height: 42px; }

.dl-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border: 1px solid var(--g-line-soft); border-radius: 12px; }
.dl-stats.one { grid-template-columns: minmax(0, 1fr); }
.dl-stats > div { padding: 11px 14px; min-width: 0; }
.dl-stats > div + div { border-left: 1px solid var(--g-line-soft); }
.dl-stats dt { font-size: 11.5px; color: var(--g-muted); }
.dl-stats dd { margin: 3px 0 0; font-size: 19px; font-weight: 550; font-variant-numeric: tabular-nums; color: var(--g-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dl-action { display: grid; gap: 9px; }
.dl-main-btn { width: 100%; height: 46px; justify-content: center; gap: 9px; font-size: 14.5px; border-radius: 11px; text-decoration: none; }
.dl-main-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.dl-main-btn:disabled { opacity: 1; box-shadow: none; border-style: dashed; color: var(--g-muted); background: var(--g-hover); border-color: var(--g-line); }
.dl-main-btn:focus-visible, .dl-more summary:focus-visible { outline: 2px solid var(--g-coral); outline-offset: 2px; }
.dl-state-line { display: flex; gap: 7px; align-items: flex-start; margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--g-muted); }
.dl-state-line svg { width: 14px; height: 14px; flex: none; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; }
.dl-state-line.prep { color: var(--g-warn); }

/* Details (native <details>: mouse, Enter and Space work without script) */
.dl-more { border-top: 1px solid var(--g-line-soft); padding-top: 10px; }
.dl-more summary { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 2px; border-radius: 6px; font-size: 13px; color: var(--g-text-2); cursor: pointer; list-style: none; }
.dl-more summary::-webkit-details-marker { display: none; }
.dl-more summary:hover { color: var(--g-text); }
.dl-more summary svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .15s; }
.dl-more[open] summary svg { transform: rotate(90deg); }
.dl-facts { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px 12px; margin: 10px 0 2px; font-size: 12.5px; }
.dl-facts dt { color: var(--g-muted); }
.dl-facts dd { margin: 0; min-width: 0; color: var(--g-text-2); line-height: 1.5; overflow-wrap: anywhere; }
.dl-mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; word-break: break-all; color: var(--g-text); }
.dl-notes { white-space: pre-wrap; }

/* Install guide under the cards */
.dl-guide-box { margin-top: 22px; padding: 18px 22px; border: 1px solid var(--g-line-soft); border-radius: 14px; }
.dl-guide-box h2 { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--g-text); }
.dl-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 22px; margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--g-text-2); }
.dl-tip { display: flex; gap: 7px; align-items: flex-start; margin: 12px 0 0; font-size: 12.5px; color: var(--g-muted); }
.dl-tip svg { width: 14px; height: 14px; flex: none; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Loading */
.dl-skel { gap: 14px; box-shadow: none; }
.dl-skel i { display: block; height: 12px; border-radius: 6px; background: var(--g-hover); }

@media (max-width: 900px) {
    .dl-cards { grid-template-columns: minmax(0, 1fr); }
    .dl-guide { grid-template-columns: minmax(0, 1fr); }
    .dl-purpose { min-height: 0; }
}
@media (max-width: 720px) {
    .dl-card { padding: 18px; gap: 14px; }
    .dl-card-title h2 { font-size: 19px; }
    .dl-mark { width: 56px; height: 56px; }
    .dl-card-top { gap: 14px; }
    .dl-stats dd { font-size: 17px; }
    .dl-main-btn { height: 48px; }
    .dl-guide-box { padding: 16px; }
}
