/* Shared chrome for the small client-side developer tools
   (JSON Workbench, Cron Explainer, JWT Decoder). Namespaced under .dt-
   and built on site.css design tokens. The JS for these tools builds UI
   with these exact class names — rename in both places or not at all. */

.dt-wrap {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 0 4rem;
}

.dt-privacy {
    color: var(--text-faint);
    font-size: 0.82rem;
    margin: 1.25rem 0 0;
}

/* Cards / panels */
.dt-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.dt-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dt-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

@media (max-width: 800px) {
    .dt-cols {
        grid-template-columns: minmax(0, 1fr);
    }
}

.dt-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-faint);
    margin-bottom: 0.5rem;
}

/* Inputs */
.dt-input,
.dt-textarea {
    width: 100%;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-variant-ligatures: none;
}

.dt-textarea {
    resize: vertical;
    min-height: 16rem;
    white-space: pre;
    overflow-x: auto;
}

.dt-textarea--short {
    min-height: 7rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.dt-input:hover, .dt-textarea:hover {
    border-color: var(--border-lit);
}

.dt-input:focus, .dt-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.dt-input--error, .dt-textarea--error {
    border-color: rgba(248, 113, 113, 0.6);
}

/* Buttons */
.dt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.dt-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border-lit);
    border-radius: 9px;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

    .dt-btn:hover {
        background: var(--bg-hover);
        border-color: var(--accent-dim);
    }

    .dt-btn.primary {
        background: var(--accent);
        border-color: var(--accent);
        color: #06122e;
    }

        .dt-btn.primary:hover {
            background: #7d99ff;
        }

    .dt-btn.is-copied {
        color: var(--green);
        border-color: rgba(74, 222, 128, 0.45);
    }

.dt-linkbtn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

    .dt-linkbtn:hover {
        text-decoration: underline;
    }

/* Status line under an input: ok / error */
.dt-status {
    font-family: var(--mono);
    font-size: 0.78rem;
    margin: 0.5rem 0 0;
    min-height: 1.1rem;
    color: var(--text-sub);
}

    .dt-status.ok {
        color: var(--green);
    }

    .dt-status.err {
        color: #f87171;
        white-space: pre-wrap;
    }

/* Small stat pills (size, keys, depth…) */
.dt-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.dt-stat {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-sub);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
}

    .dt-stat b {
        color: var(--text);
        font-weight: 600;
    }

/* Output code area */
.dt-output {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: auto;
    max-height: 34rem;
}

    .dt-output pre {
        margin: 0;
        padding: 0.8rem 1rem;
        font-family: var(--mono);
        font-size: 0.82rem;
        line-height: 1.6;
        white-space: pre;
        font-variant-ligatures: none;
        color: var(--text);
    }

/* Reference / breakdown tables */
.dt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

    .dt-table th {
        text-align: left;
        font-family: var(--mono);
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--text-faint);
        padding: 0.45rem 0.75rem;
        border-bottom: 1px solid var(--border);
    }

    .dt-table td {
        padding: 0.5rem 0.75rem;
        border-bottom: 1px solid var(--border);
        vertical-align: top;
    }

    .dt-table tr:last-child td {
        border-bottom: none;
    }

    .dt-table .mono {
        font-family: var(--mono);
        font-size: 0.8rem;
        color: var(--accent);
        white-space: nowrap;
    }

    .dt-table .sub {
        color: var(--text-sub);
    }

/* Badges */
.dt-badge {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    border: 1px solid var(--border-lit);
    color: var(--text-sub);
}

    .dt-badge.ok {
        color: var(--green);
        border-color: rgba(74, 222, 128, 0.4);
        background: rgba(74, 222, 128, 0.08);
    }

    .dt-badge.warn {
        color: #fbbf24;
        border-color: rgba(245, 158, 11, 0.4);
        background: rgba(245, 158, 11, 0.08);
    }

    .dt-badge.err {
        color: #f87171;
        border-color: rgba(248, 113, 113, 0.4);
        background: rgba(248, 113, 113, 0.08);
    }

/* Big human-readable answer line (cron description) */
.dt-answer {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.5;
    margin: 0;
}

/* Token highlighting shared by JSON/C# output (matches guides.css palette) */
.dt-t-key  { color: #9CDCFE; }
.dt-t-str  { color: #CE9178; }
.dt-t-num  { color: #B5CEA8; }
.dt-t-bool { color: #569CD6; }
.dt-t-null { color: #569CD6; }
.dt-t-kw   { color: #569CD6; }
.dt-t-type { color: #4EC9B0; }
.dt-t-cmt  { color: #6A9955; font-style: italic; }

.dt-hidden {
    display: none;
}
