/* /common/css/dl-tanks.css — shared chrome for DL.Tanks.editor() tables.
 * Loaded by /addlog/ and /browse/dive.html (both pages render their
 * add-tank flow through the shared component now). Themes still own
 * colour via :root tokens; this file only does layout + compact field
 * tweaks for the row inputs.
 */

.dl-tanks-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
    margin-top: 6px;
}
.dl-tanks-table th,
.dl-tanks-table td {
    padding: 6px 8px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.dl-tanks-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
    font-weight: 500;
}

/* DL.Form.* wrappers ship with margin + a label/error block we don't
 * want inside a tight table cell — strip them and let the cell padding
 * handle spacing. */
.dl-tanks-table td .dlf-field { margin: 0; min-width: 0; }
.dl-tanks-table td .dlf-field .dlf-label { display: none; }
.dl-tanks-table td .dlf-field .dlf-error { display: none; }
.dl-tanks-table td .dlf-input-number { width: 100%; min-width: 0; }
.dl-tanks-table td input.dlf-input,
.dl-tanks-table td button.dlf-combo {
    padding: 4px 6px;
    font-size: 13px;
    min-width: 64px;
}

.dl-tanks-table td.actions {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

/* Type cell hosts a DL.Form.dropdown. Min-width gives the catalog label
 * room (e.g. "Aluminum 80 cuft" in en, longer in de). */
.dl-tanks-table .tank-type-cell { min-width: 160px; }
.dl-tanks-table .tank-type-cell .dlf-field { margin: 0; min-width: 0; }
.dl-tanks-table .tank-type-cell .dlf-combo { width: 100%; }

/* Row-remove "×" button. Same outlined ghost the browse module had on
 * .tank-remove-btn — moved here so /addlog/ doesn't have to drag the
 * style across from browse.css. */
.tank-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: var(--control-sm);
    height: var(--control-sm);
    padding: 0;
    color: var(--text-muted);
    cursor: pointer;
}
@media (pointer: coarse) {
    .tank-remove-btn { width: var(--touch-target); height: var(--touch-target); }
}
.tank-remove-btn:hover {
    color: var(--err);
    border-color: var(--err);
}

/* Empty-state placeholder. Only renders when the editor was configured
 * with showEmpty:true (addlog). Browse renders its own hint paragraph
 * above the editor instead. */
.dl-tanks-empty {
    padding: 12px 0;
    opacity: 0.6;
    font-size: 13px;
}

/* Phones: one small card per tank. Every cell carries data-label (set by
   DL.Tanks.editor), printed beside its control. */
@media (max-width: 720px) {
    .dl-tanks-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .dl-tanks-table, .dl-tanks-table tbody, .dl-tanks-table tr { display: block; width: 100%; }
    .dl-tanks-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-2) var(--space-3);
        padding: var(--space-3) 0;
        border-bottom: 1px solid var(--border);
    }
    .dl-tanks-table td { display: block; padding: 0; border: 0; min-width: 0; }
    .dl-tanks-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        color: var(--text-muted);
        font-size: var(--font-size-xs);
        font-weight: 600;
    }
    .dl-tanks-table td.tank-idx { grid-column: 1; align-self: center; font-weight: 650; }
    .dl-tanks-table td.tank-idx::before { display: inline; margin-right: .3em; }
    .dl-tanks-table td.actions { grid-column: 2; grid-row: 1; justify-self: end; width: auto; }
    .dl-tanks-table .tank-type-cell { grid-column: 1 / -1; min-width: 0; }
    .dl-tanks-table td input.dlf-input,
    .dl-tanks-table td button.dlf-combo { min-height: var(--touch-target); font-size: var(--font-size-md); }
}
