/* Docker page */

.dk-led-label {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
}

.readout-note.dk-note-warn {
    color: var(--warn-ink);
}

/* Allow-list explanation */
.dk-note {
    display: flex;
    align-items: flex-start;
    gap: var(--s2);
    margin-bottom: var(--s3);
    color: var(--ink-dim);
    font-size: var(--text-sm);
}

.dk-note svg {
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 3px;
}

.dk-note .mono {
    color: var(--ink);
    font-size: var(--text-xs);
}

/* Filter row */
.dk-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s2) var(--s3);
    margin-bottom: var(--s3);
}

.dk-search {
    flex: 1 1 240px;
    width: auto;
    max-width: 420px;
}

.dk-count {
    min-width: 2ch;
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ink-faint);
}

.softkeys .key.is-active .dk-count {
    color: inherit;
}

/* Container table */
.dk-table-box {
    max-height: none;
}

.dk-table-box.is-loading .table {
    opacity: 0.55;
    transition: opacity var(--dur) var(--ease);
}

.dk-table td {
    padding-block: var(--s2);
}

.dk-cell-name {
    min-width: 200px;
    max-width: 340px;
}

.dk-name {
    font-weight: 500;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.dk-image {
    color: var(--ink-faint);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dk-state {
    display: flex;
    align-items: center;
    gap: var(--s2);
    white-space: nowrap;
}

.dk-state-sub {
    padding-left: calc(8px + var(--s2));
    color: var(--ink-faint);
    font-size: var(--text-xs);
    white-space: nowrap;
}

.dk-mem-pct {
    color: var(--ink-faint);
}

.dk-table td.num {
    white-space: nowrap;
}

.dk-cell-ports {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

.dk-port {
    display: block;
    white-space: nowrap;
}

.dk-port-none,
.dk-port-more {
    color: var(--ink-faint);
    font-family: var(--font-body);
}

.dk-cell-actions {
    width: 1%;
}

.dk-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--s2);
}

.dk-viewonly {
    color: var(--ink-faint);
}

.dk-viewonly svg {
    width: 12px;
    height: 12px;
}

/* View-only rows recede a step so controllable ones stand out */
.dk-row:not(.is-manageable) .dk-name {
    color: var(--ink-dim);
}

/* Logs modal */
.dk-logs-modal {
    width: min(1040px, 100%);
    height: min(760px, calc(100vh - 2 * var(--s5)));
}

.dk-logs-modal .modal-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dk-logs-name {
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 500;
}

.dk-logs-modal .modal-body {
    flex: 1;
    min-height: 0;
    display: flex;
    padding: var(--s3);
}

.log-output {
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: var(--s3);
    overflow: auto;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.log-line {
    display: block;
    padding-left: 2ch;
    text-indent: -2ch;
}

.log-ts {
    margin-right: 1.5ch;
    color: var(--ink-faint);
    user-select: none;
}

.log-output .loading {
    justify-content: flex-start;
    font-family: var(--font-body);
    white-space: normal;
}

.log-note {
    display: block;
    color: var(--ink-dim);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    white-space: normal;
}

.dk-logs-meta {
    margin-right: auto;
    align-self: center;
    color: var(--ink-faint);
}

/* Narrow screens: each container becomes a compact card */
@media (max-width: 760px) {
    .dk-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .dk-table,
    .dk-table tbody {
        display: block;
    }

    .dk-table tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--s2) var(--s4);
        padding: var(--s3);
        border-top: 1px solid var(--graticule);
    }

    .dk-table tbody tr:first-child {
        border-top: 0;
    }

    .dk-table td,
    .dk-table tbody tr:first-child td {
        display: block;
        padding: 0;
        border: 0;
    }

    .dk-table .dk-cell-name {
        flex: 1 1 55%;
        min-width: 0;
        max-width: none;
    }

    .dk-table .dk-cell-state {
        flex: 0 1 auto;
        margin-left: auto;
        text-align: right;
    }

    .dk-state {
        justify-content: flex-end;
    }

    .dk-state-sub {
        padding-left: 0;
    }

    .dk-table td.num {
        text-align: left;
    }

    .dk-table .dk-labelled::before {
        content: attr(data-label);
        margin-right: var(--s2);
        font-family: var(--font-label);
        font-weight: 600;
        font-size: var(--text-2xs);
        letter-spacing: var(--tracking-label);
        text-transform: uppercase;
        color: var(--ink-faint);
    }

    .dk-cell-ports {
        display: flex !important;
        flex-wrap: wrap;
        align-items: baseline;
        column-gap: var(--s2);
    }

    .dk-port {
        display: inline;
    }

    .dk-table .dk-cell-ports {
        flex: 1 1 auto;
    }

    .dk-table .dk-cell-actions {
        flex: 1 1 100%;
        width: auto;
    }

    /* View-only rows: the tag sits at the end of the ports line */
    .dk-table .dk-row:not(.is-manageable) .dk-cell-actions {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .dk-actions {
        justify-content: flex-start;
    }

    .dk-search {
        max-width: none;
    }
}

@media (max-width: 600px) {
    .dk-logs-modal {
        height: calc(100vh - 2 * var(--s4));
    }

    .dk-logs-backdrop,
    .modal-backdrop {
        padding: var(--s2);
    }
}

/* Stop / restart confirmation */
.dk-confirm {
    width: min(460px, 100%);
}

.dk-confirm .modal-body p {
    margin: 0 0 var(--s4);
    color: var(--ink-dim);
}

.dk-confirm-label {
    display: block;
    margin-bottom: var(--s2);
}

.dk-confirm-label code {
    color: var(--ink);
    font-family: var(--font-mono);
}
