/*
 * Mateen Labs developer tools. Builds on tools.css, file-tool.css and text-tools.css (the .tx-* classes) and the site tokens
 * (light and dark follow the site). Mobile first: nothing here may be wider than a 320px screen.
 * Pass and fail are never shown by colour alone: they carry a symbol and a word.
 */

.dv-app { min-width: 0; }
.dv-app .tool-editor { min-height: 160px; }
.dv-app .tool-editor.is-mono, .dv-app textarea.is-mono { font-family: var(--mono); font-size: 14px; }

.dv-grid2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .dv-grid2 { grid-template-columns: 1fr 1fr; } }
.dv-grid2 > * { min-width: 0; }

/* A result line: label, value, copy button. */
.dv-rows { display: grid; gap: 8px; margin: 12px 0; }
.dv-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    min-width: 0;
}
.dv-label { grid-column: 1 / -1; color: var(--muted); font-size: 13px; font-weight: 700; }
.dv-val { min-width: 0; margin: 0; padding: 0; border: 0; background: none; color: var(--text); font: 600 14px/1.5 var(--mono); overflow-wrap: anywhere; word-break: break-all; white-space: pre-wrap; }
.dv-copy { min-width: 70px; min-height: 44px; padding: 8px 12px; }
@media (min-width: 700px) {
    .dv-row { grid-template-columns: 150px 1fr auto; }
    .dv-label { grid-column: auto; }
}

.dv-pre {
    margin: 8px 0;
    padding: 12px 14px;
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--code-bg);
    color: var(--text);
    font: 13.5px/1.55 var(--mono);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.dv-table-wrap { max-width: 100%; overflow-x: auto; }
.dv-table { width: 100%; margin: 10px 0; border-collapse: collapse; font-size: 14px; }
.dv-table th, .dv-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
.dv-table th { color: var(--muted); font-size: 13px; }
.dv-table code { font-family: var(--mono); font-weight: 600; }
.dv-table .tx-btn { min-height: 44px; }

.dv-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 800; }
.dv-badge::before { font-weight: 900; }
.dv-badge.is-pass { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-line); }
.dv-badge.is-pass::before { content: "\2713"; }
.dv-badge.is-fail { background: var(--err-bg); color: var(--err-text); border-color: var(--err-line); }
.dv-badge.is-fail::before { content: "\2715"; }
.dv-badge.is-info { background: var(--panel); color: var(--text); }
.dv-badge.is-info::before { content: "\2139"; }

.dv-result {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    margin: 12px 0; padding: 12px 14px;
    border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; background: var(--panel);
    font-size: 15px; font-weight: 700; overflow-wrap: anywhere;
}
.dv-result.is-pass { border-left-color: var(--ok-text); }
.dv-result.is-fail { border-left-color: var(--err-text); }

.dv-warn { margin: 12px 0; padding: 12px 14px 12px 16px; border: 1px solid var(--warn-line); border-left: 4px solid var(--warn-text); border-radius: 10px; background: var(--warn-bg); color: var(--warn-text); font-size: 14px; line-height: 1.55; }
.dv-warn strong { display: block; margin-bottom: 4px; }
.dv-warn ul { margin: 4px 0 0; padding-left: 20px; }

.dv-meta { margin: 6px 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.dv-clock { margin: 10px 0; font: 800 22px/1.3 var(--mono); overflow-wrap: anywhere; }

.dv-swatch { display: block; width: 100%; min-height: 72px; border: 1px solid var(--line-strong); border-radius: 12px; background-image: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%), linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; overflow: hidden; }
.dv-swatch > span { display: block; width: 100%; height: 100%; min-height: 72px; }

.dv-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); gap: 8px; margin: 10px 0; padding: 0; list-style: none; }
.dv-strip button { display: grid; gap: 4px; width: 100%; min-height: 44px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.dv-strip button:hover { border-color: var(--accent); }
.dv-strip button:focus-visible { outline: none; box-shadow: var(--ring); }
.dv-strip .chip { display: block; height: 36px; border-radius: 8px; border: 1px solid var(--line); }
.dv-strip .name { font-weight: 800; }
.dv-strip .val { font-family: var(--mono); overflow-wrap: anywhere; }

.dv-contrast { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); margin: 10px 0; }
.dv-contrast > div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.dv-contrast .sample { display: block; margin: 6px 0; padding: 10px; border-radius: 8px; border: 1px solid var(--line-strong); font-weight: 700; overflow-wrap: anywhere; }
.dv-levels { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }

.dv-claims { width: 100%; }
.dv-options { display: grid; gap: 4px; }
.dv-inline { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.dv-inline label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; }
.dv-inline input[type="checkbox"], .dv-inline input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent); }
.dv-textinput { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.dv-textinput:focus-visible { outline: none; box-shadow: var(--ring); }
.dv-textinput[aria-invalid="true"] { border-color: var(--err-text); }
.dv-num { width: 8em; max-width: 100%; }
.dv-date-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; }
.dv-date-row label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 700; }
.dv-date-row input { min-height: 44px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; max-width: 100%; }
.dv-date-row input:focus-visible { outline: none; box-shadow: var(--ring); }
.dv-file-info { margin: 8px 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.dv-uuid-list { min-height: 220px; font-family: var(--mono); }

/* Password fields (HMAC key, JWT secret) look like the other text fields. */
.dv-app .opt-row input[type="password"] {
    flex: 1;
    min-width: 200px;
    min-height: 44px;
    padding: 6px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
}
.dv-app .opt-row input[type="password"]:focus-visible { outline: none; box-shadow: var(--ring); }
