/* =====================================
   Disk defragmentation (/disk)
   ===================================== */

/* A nod to the defragmenter of the 90s: a window with a blue title bar */
.disk-window {
    margin: 18px 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.disk-titlebar {
    padding: 6px 12px;
    background: linear-gradient(90deg, #000080, #1084d0);
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
}

.disk-body {
    padding: 12px;
}

/* Columns: storage.disk.COLUMNS */
.disk-grid {
    display: grid;
    grid-template-columns: repeat(32, 1fr);
    gap: 2px;
}

.disk-cell {
    display: inline-block;
    aspect-ratio: 1 / 1.4;
    min-width: 6px;
    border-radius: 2px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.disk-legend .disk-cell {
    width: 12px;
    vertical-align: middle;
}

.disk-cell.placed {
    background: #2471a3;
    border-color: #1b5a82;
}

.disk-cell.fragmented {
    background: #c0392b;
    border-color: #96281b;
}

.disk-cell.data {
    background: #48a9a6;
    border-color: #368784;
}

.disk-cell.reading {
    background: #4caf50;
    border-color: #2e7d32;
}

.disk-cell.writing {
    background: #ffc107;
    border-color: #d39e00;
}

.disk-cell.lit {
    outline: 2px solid var(--text);
    outline-offset: -1px;
}

.disk-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.disk-progress progress {
    flex: 1;
    height: 14px;
    accent-color: #000080;
}

:root.dark .disk-progress progress {
    accent-color: #1084d0;
}

.disk-status {
    min-height: 1.4em;
    margin: 8px 0 0;
    font-family: Consolas, Menlo, monospace;
    font-size: 0.88rem;
}

.disk-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 0;
    margin: 0 0 14px;
    list-style: none;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.disk-files {
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.disk-files th,
.disk-files td {
    padding: 3px 18px 3px 0;
    text-align: right;
}

.disk-files th:first-child,
.disk-files td:first-child {
    text-align: left;
    font-family: Consolas, Menlo, monospace;
}

.disk-files tr.lit td {
    color: var(--accent);
}

.disk-files td.disk-many {
    color: var(--error);
    font-weight: bold;
}
