/* ============================================================
   TEXT CLEANER
============================================================ */
/* Palette moved to /themeV0.01.css — it is loaded first on every page and
   carries the same dark values plus the light-skin overrides. */

/* The removed-char highlight is the one colour this app has to define for
   itself: it is ink on a tinted inline span, not on a panel, and neither
   --danger (4.3:1) nor --danger-soft (3.5:1) clears 4.5:1 over that tint in
   the light skin. Dark keeps the exact values it shipped with. */
:root[data-theme="dark"] {
    --tc-removed-bg:  rgba(248, 113, 113, .25);
    --tc-removed-ink: #fca5a5;
}

:root {
    --tc-removed-bg:  rgba(179, 38, 30, .12);
    --tc-removed-ink: #8f1d17;
}

body {
    font-family: "GSans", "Segoe UI", Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(180deg, var(--bg), var(--bg-2));
    color: var(--text);
}

.container {
    padding: 24px 0 40px;
    max-width: 900px;
    margin: auto;
}

h1, h3, h5 {
    margin-bottom: 6px;
    margin-top: 0;
    font-weight: 600;
    color: var(--text-strong);
}
/* ---- nav strip ---- */
.nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.nav a {
    padding: 8px 16px;
    background: var(--panel);
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid var(--border);
    transition: all .15s ease;
}

.nav a:hover {
    background: var(--panel-light);
    color: var(--text);
}

.nav a.active {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}

/* ---- sections ---- */
.section {
    margin-bottom: 20px;
    padding: 18px;
    background: var(--panel);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

h1, h3, h5 {
    color: var(--text-strong);
    margin-top: 0;
    font-weight: 600;
}

label {
    display: block;
    margin-top: 10px;
    color: var(--text-dim);
}

input, select {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    background: var(--panel-light);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
}

button {
    padding: 12px;
    background: var(--accent);
    border: none;
    color: var(--on-accent);
    font-size: 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: all .2s ease;
}

button:hover {
    background: var(--accent-soft);
}

.output {
    margin-top: 15px;
    font-size: 14px;
    color: var(--text-dim);
}

/* ---- progress ---- */
#progressContainer {
    width: 100%;
    height: 10px;
    background: var(--bg-deep);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 15px;
}

#progressBar {
    height: 100%;
    width: var(--progress-width, 0%);
    background: linear-gradient(90deg, var(--accent), var(--accent-soft));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.2s;
}

#progressText {
    color: var(--text-strong);
    font-weight: bold;
    font-size: 13px;
}

.status-done {
    color: var(--success);
    font-weight: bold;
}

/* ---- log panel ---- */
#log {
    line-height: 18px;
    height: calc(18px * 40);
    overflow-y: auto;
    overflow-x: hidden;
    font-family: monospace;
    padding: 10px;
    border: 1px solid var(--border);
    background: var(--bg-deep);
    color: #cfe3ff;
    white-space: pre-wrap;
    border-radius: 8px;
}

/* ---- misc output ---- */
.output { margin-top: 15px; font-size: 14px; color: var(--text-dim); }

.hint   { font-size: 13px; color: var(--text-dim); margin-top: 6px; }

.status-done { color: var(--success); font-weight: bold; }

.status-text { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* ---- log panel ---- */
#log {
    line-height: 18px;
    height: calc(18px * 30);
    overflow-y: auto;
    overflow-x: hidden;
    font-family: monospace;
    padding: 10px;
    border: 1px solid var(--border);
    background: var(--bg-deep);
    color: #cfe3ff;
    white-space: pre-wrap;
    border-radius: 8px;
    margin-top: 10px;
}

/* FOOTER */
.footer {
    margin-top: 40px;
    padding: 20px;
    background: var(--panel);
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13px;
    text-align: center;
}

.footer {
    margin-top: 40px;
    padding: 24px 20px;
    background: var(--panel);
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13px;
}
.msg-status {
    transition: color .15s ease;
}

.mt8 {
    margin-top: 8px;
}

.mt30 {
    margin-top: 30px;
}

/* ============================================================
   logger.css
   CSP-safe styles for logger.js
============================================================ */

/* ------------------------------------------------------------
   normal log lines
------------------------------------------------------------ */

.log-line {
    padding: 4px 8px;
    border-bottom: 1px solid #222;
    color: #ccc;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ------------------------------------------------------------
   JSON containers
------------------------------------------------------------ */

.json-container {
    margin-left: calc(var(--json-depth, 0) * 12px);
    font-family: monospace;
}

/* ------------------------------------------------------------
   collapsible titles
------------------------------------------------------------ */

.json-toggle {
    cursor: pointer;
    user-select: none;
    padding: 2px 0;
}

.json-toggle-object {
    color: #6cf;
}

.json-toggle-array {
    color: #fc6;
}

/* ------------------------------------------------------------
   rows / values
------------------------------------------------------------ */

.json-row {
    padding: 2px 0;
    color: #ddd;
}

.json-key {
    color: #9f9;
}

/* ------------------------------------------------------------
   array items
------------------------------------------------------------ */

.json-array-item {
    padding: 2px 0;
    color: #ccc;
}

.vidRes1{
    display:flex; 
    align-items:center; 
    gap:10px; 
    margin-bottom:8px;
}

.vidContr{
    width:100%; 
    max-width:480px; 
    border-radius:6px; 
}

/* ------------------------------------------------------------
   Download items
------------------------------------------------------------ */

.download-item {
    margin-top: 14px;
}

/* ------------------------------------------------------------
   Download all button
------------------------------------------------------------ */

.download-all-btn {
    margin-top: 18px;
    padding: 12px 20px;
    width: 100%;

    background: #28a745;
    border: none;

    color: var(--on-accent);
    font-size: 15px;
    font-weight: bold;

    cursor: pointer;
    border-radius: 6px;

    transition: background .15s ease;
}

.download-all-btn:hover {
    background: #218838;
}

.download-all-btn.is-disabled {
    opacity: 0.7;
    cursor: wait;
}

/* ------------------------------------------------------------
   Hidden anchor for downloads
------------------------------------------------------------ */

.hidden-download-anchor {
    display: none;
}

/* ------------------------------------------------------------
   custom resolution panel
------------------------------------------------------------ */

#customRes {
    transition: opacity .15s ease;
}

/* ------------------------------------------------------------
   audio/video settings panels
------------------------------------------------------------ */

#videoSettingsPanel,
#audioSettingsPanel {
    transition: opacity .15s ease;
}

/* ------------------------------------------------------------
   FLAC hint
------------------------------------------------------------ */

#flacHint {
    transition: opacity .15s ease;
}

/* ------------------------------------------------------------
   safer button disabled visuals
------------------------------------------------------------ */

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ------------------------------------------------------------
   optional fade utility
------------------------------------------------------------ */

.fade-panel {
    transition:
        opacity .15s ease,
        transform .15s ease;
}

.editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.editor-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

textarea {
    width: 100%;
    min-height: 320px;
    resize: vertical;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel-light);
    color: var(--text);
    padding: 14px;
    font-size: 14px;
    line-height: 1.5;
    font-family: Consolas, monospace;
}

textarea:focus,
input:focus {
    outline: 1px solid var(--accent);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
    gap: 10px;
}

.option-card {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--panel-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;

    /* 14px matches the .nav chips. At the inherited 16px the longest label
       ("Double spaces", 105.9px) came within a pixel of the 160px track at a
       768px viewport and wrapped to a second line; 14px leaves ~18px of slack
       at every width, including the wider Arial fallback. */
    font-size: 14px;

    /* the generic `label` rule further up sets margin-top:10px, which landed on
       every card on top of the grid gap and made the two rows sit 10px further
       apart than the columns */
    margin-top: 0;
}

.option-card input {
    transform: scale(1.15);
}

.custom-chars-wrap {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-chars-wrap input {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel-light);
    color: var(--text);
}

.action-btn {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--on-accent);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.action-btn:hover {
    background: var(--accent-strong);
}

/* --bg-deep, not a hard-coded navy: the old #0a1020 stayed dark under the
   light skin while the ink inherited --text (#1d1d1f), so the preview read at
   1.13:1 — black on navy. --bg-deep is the shared "inset / code well" token
   and is a near-identical #0a0f1c in dark, so that skin is unchanged. */
.highlight-preview {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-deep);
    color: var(--text);
    padding: 14px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
    font-family: Consolas, monospace;
    min-height: 140px;
}

.removed-char {
    background: var(--tc-removed-bg);
    color: var(--tc-removed-ink);
    border-bottom: 1px dashed var(--danger);
    border-radius: 2px;
    cursor: help;
}

/* shown in place of invisible / zero-width characters so the
   highlight is visible even when the glyph has no width */
.removed-placeholder {
    opacity: 0.6;
    font-size: 0.8em;
}

/* The generic `input, select` rule above is written for text fields, and a
   checkbox is not one: width:100% stretched these to 115px, which left the
   label 49px to render in and wrapped every option onto two lines — that, not
   the padding, was most of the height of an .option-card. */
input[type="checkbox"] {
    accent-color: var(--accent);
    width: auto;
    padding: 0;
    margin-top: 0;
}

@media (max-width: 900px) {

    .editor-grid {
        grid-template-columns: 1fr;
    }

}
