/* Bulk Rename Utility — Lime Glass UI
   Pure-CSS glass (backdrop-filter, with -webkit- prefix) so it renders the same
   on Windows and macOS Eagle — no reliance on native window vibrancy. */

:root {
    --bg-base: #0c0e0a;

    --glass-1: rgba(255, 255, 255, 0.045);   /* structural panels */
    --glass-2: rgba(255, 255, 255, 0.065);   /* raised cards / inputs */
    --glass-3: rgba(255, 255, 255, 0.10);    /* hover / active */
    --border-color: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.17);

    --text-primary: #eef1ea;
    --text-secondary: #a8b19f;
    --text-muted: #767f6c;

    --accent: #a3e635;            /* lime */
    --accent-bright: #bef264;
    --accent-deep: #84cc16;
    --accent-glow: rgba(163, 230, 53, 0.30);
    --on-accent: #15230a;         /* dark text on lime */

    --success: #bef264;           /* "changed" names */
    --error: #fb7185;             /* rose */
    --error-soft: rgba(251, 113, 133, 0.14);

    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
}

body {
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    background-color: var(--bg-base);
    /* Soft lime "wallpaper" the frosted panels sit over */
    background-image:
        radial-gradient(820px 540px at 8% -12%, rgba(163, 230, 53, 0.16), transparent 60%),
        radial-gradient(680px 520px at 112% 6%, rgba(132, 204, 22, 0.13), transparent 55%),
        radial-gradient(760px 620px at 50% 124%, rgba(190, 242, 100, 0.08), transparent 60%);
    background-repeat: no-repeat;
}

.app-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* ---------- Header ---------- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px;
    background: var(--glass-1);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    backdrop-filter: blur(22px) saturate(150%);
    border-bottom: 1px solid var(--border-color);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 11px;
    filter: drop-shadow(0 4px 10px rgba(132, 204, 22, 0.30));
}

.brand-text h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

.brand-text .subtitle {
    font-size: 11px;
    color: var(--text-secondary);
}

.stats-panel {
    display: flex;
    align-items: center;
    gap: 16px;
}

.selection-count {
    font-size: 13px;
    color: var(--text-secondary);
}

.selection-count strong {
    color: var(--accent-bright);
    font-weight: 700;
}

/* ---------- Body / Splits ---------- */
.app-body {
    flex: 1;
    display: flex;
    min-height: 0;
}

.ops-section {
    width: 452px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.022);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
}

.presets-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 13px;
    background: var(--glass-1);
    border-bottom: 1px solid var(--border-color);
}

.tabs-nav {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
    padding: 4px 10px 0;
}

.tab-btn {
    padding: 11px 15px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-bright);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.tabs-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.control-group {
    background: var(--glass-2);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.control-group h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-bright);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 2px;
}

.input-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-row label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

input[type="text"],
input[type="number"],
#preset-select {
    background: var(--glass-2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 9px 12px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input[type="text"]::placeholder {
    color: var(--text-muted);
}

input[type="text"]:focus,
input[type="number"]:focus,
#preset-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--glass-3);
}

.checkbox-row,
.radio-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-row input,
.radio-row input {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.radio-group,
.radio-group-horizontal {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-group-horizontal {
    flex-direction: row;
    gap: 20px;
}

.help-text {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

.help-text strong {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Sequence sub-options revealed by "Customise the number" */
.seq-options {
    display: none;
    flex-direction: column;
    gap: 13px;
    margin-top: 2px;
    padding-left: 15px;
    border-left: 2px solid var(--accent);
}

.seq-options.show {
    display: flex;
}

.tokens-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.token-btn {
    background: var(--glass-2);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    color: var(--text-secondary);
    padding: 9px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s ease;
}

.token-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--glass-3);
    transform: translateY(-1px);
}

/* ---------- Right Panel: Preview ---------- */
.preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.012);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.preview-section .section-title {
    padding: 13px 22px;
    border-bottom: 1px solid var(--border-color);
    background: var(--glass-1);
}

.preview-section .section-title h3 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.preview-table-container {
    flex: 1;
    overflow-y: auto;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.preview-table th {
    background: rgba(14, 17, 11, 0.82);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
    text-align: left;
    padding: 11px 18px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.preview-table td {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.preview-table tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.original-name {
    color: var(--text-secondary);
}

.new-name-preview {
    font-weight: 600;
    color: var(--text-secondary);
}

.new-name-preview.changed {
    color: var(--success);
}

.new-name-preview.conflict {
    color: var(--error);
}

/* One-shot fade only when a new selection loads (not per keystroke) */
#preview-list-body.fade-rows {
    animation: cellFade 0.28s ease;
}

@keyframes cellFade {
    from { opacity: 0.25; }
    to   { opacity: 1; }
}

.conflict-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 600;
    color: var(--error);
    background-color: var(--error-soft);
    border: 1px solid rgba(251, 113, 133, 0.40);
    vertical-align: middle;
}

.row-conflict {
    background-color: rgba(251, 113, 133, 0.06);
}

.row-conflict:hover {
    background-color: rgba(251, 113, 133, 0.10);
}

.empty-state {
    text-align: center;
    padding: 44px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    outline: none;
}

.btn .icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.btn-secondary {
    background: var(--glass-2);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    padding: 8px 14px;
    font-size: 12px;
}

.btn-secondary:hover {
    background: var(--glass-3);
    border-color: var(--accent);
}

.btn-primary {
    background: linear-gradient(180deg, var(--accent-bright), var(--accent));
    color: var(--on-accent);
    padding: 10px 18px;
    font-size: 13px;
    box-shadow: 0 6px 18px rgba(132, 204, 22, 0.28);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #d3f97f, var(--accent-bright));
    box-shadow: 0 8px 22px rgba(163, 230, 53, 0.42);
}

.btn-large {
    padding: 12px 26px;
    font-size: 14px;
    border-radius: 12px;
}

.btn-icon {
    padding: 8px 12px;
}

.btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    box-shadow: none;
}

/* Scope the dimmed-hover override to secondary buttons; keep the primary CTA its lime */
.btn-secondary:disabled:hover {
    background: var(--glass-2);
    border-color: var(--border-strong);
}

.btn-primary:disabled:hover {
    background: linear-gradient(180deg, var(--accent-bright), var(--accent));
    box-shadow: none;
}

.btn-pulse {
    animation: applyPulse 2s ease-in-out infinite;
}

@keyframes applyPulse {
    0%, 100% { box-shadow: 0 6px 18px rgba(132, 204, 22, 0.20); }
    50%      { box-shadow: 0 8px 26px rgba(163, 230, 53, 0.55); }
}

/* ---------- Footer ---------- */
.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: var(--glass-1);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    backdrop-filter: blur(22px) saturate(150%);
    border-top: 1px solid var(--border-color);
}

.footer-left {
    font-size: 12px;
    color: var(--text-muted);
}

/* ---------- Presets select ---------- */
#preset-select {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

/* ---------- RegEx feedback ---------- */
.regex-error {
    display: none;
    font-size: 11px;
    color: var(--error);
    font-weight: 500;
}

.regex-error.visible {
    display: block;
}

.regex-hint {
    display: none;
}

.regex-hint code {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 1px 5px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-bright);
}

input.input-error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.22) !important;
}

/* ---------- Conflict banner ---------- */
.conflict-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    background-color: rgba(251, 113, 133, 0.10);
    border-bottom: 1px solid rgba(251, 113, 133, 0.32);
    color: var(--error);
    font-size: 12px;
    font-weight: 500;
    animation: cellFade 0.28s ease;
}

.conflict-banner.hidden {
    display: none;
}

.conflict-banner .icon {
    width: 18px;
    height: 18px;
    fill: var(--error);
    flex-shrink: 0;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 84px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 26, 14, 0.85);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid var(--accent);
    color: var(--accent-bright);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: opacity 0.3s ease, bottom 0.3s ease;
}

.toast.hidden {
    opacity: 0;
    bottom: 64px;
    pointer-events: none;
}

/* ---------- Scrollbars ---------- */
.preview-table-container::-webkit-scrollbar,
.tabs-content::-webkit-scrollbar,
.tabs-nav::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.preview-table-container::-webkit-scrollbar-track,
.tabs-content::-webkit-scrollbar-track,
.tabs-nav::-webkit-scrollbar-track {
    background: transparent;
}

.preview-table-container::-webkit-scrollbar-thumb,
.tabs-content::-webkit-scrollbar-thumb,
.tabs-nav::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.preview-table-container::-webkit-scrollbar-thumb:hover,
.tabs-content::-webkit-scrollbar-thumb:hover,
.tabs-nav::-webkit-scrollbar-thumb:hover {
    background-color: rgba(163, 230, 53, 0.45);
    background-clip: padding-box;
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(6, 8, 4, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: cellFade 0.18s ease;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    width: 370px;
    max-width: calc(100% - 48px);
    background: rgba(22, 28, 16, 0.86);
    -webkit-backdrop-filter: blur(26px) saturate(160%);
    backdrop-filter: blur(26px) saturate(160%);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: modalPop 0.18s ease;
}

@keyframes modalPop {
    from { transform: translateY(10px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-message {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
}

.modal-message.hidden {
    display: none;
}

.modal-input {
    background: var(--glass-2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 11px 13px;
    font-size: 13px;
    outline: none;
    transition: all 0.18s ease;
}

.modal-input.hidden {
    display: none;
}

.modal-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.modal-actions .btn {
    padding: 9px 18px;
    font-size: 13px;
}

/* ---------- Bulk metadata: tags / link / notes / rating ---------- */
.hint-inline { color: var(--text-muted); font-weight: 400; }

.btn.hidden { display: none; }

textarea {
    background: var(--glass-2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 9px 12px;
    font-size: 13px;
    font-family: var(--font-sans);
    line-height: 1.5;
    outline: none;
    resize: vertical;
    min-height: 70px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
textarea::placeholder { color: var(--text-muted); }
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--glass-3);
}

/* Tag chip input (set for all) */
.chip-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    background: var(--glass-2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 7px 9px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.chip-input:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.chip-list { display: contents; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(163, 230, 53, 0.16);
    border: 1px solid rgba(163, 230, 53, 0.40);
    color: var(--accent-bright);
    border-radius: 7px;
    padding: 2px 4px 2px 9px;
    font-size: 12px;
    font-weight: 500;
}
.chip-x {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0.65;
    padding: 0 3px;
}
.chip-x:hover { opacity: 1; }
.chip-input input {
    flex: 1;
    min-width: 90px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 4px 2px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}
.chip-input input:focus { box-shadow: none; border: none; background: transparent; }

/* Star picker (set for all) + row stars */
.star-picker { display: flex; align-items: center; gap: 4px; }
.star {
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    transition: color 0.12s ease, transform 0.12s ease;
    user-select: none;
}
.star:hover { transform: scale(1.18); }
.star.on { color: var(--accent-bright); }
.star-clear {
    margin-left: 12px;
    background: var(--glass-2);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.star-clear:hover { border-color: var(--accent); color: var(--text-primary); }
.row-stars { display: inline-flex; gap: 3px; vertical-align: middle; }
.row-stars .star { font-size: 17px; }

/* Editable grid cells + override markers */
.meta-cell { display: flex; align-items: center; gap: 8px; }
.meta-cell .meta-input {
    width: 100%;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
}
.row-override { background-color: rgba(163, 230, 53, 0.06); }
.row-override:hover { background-color: rgba(163, 230, 53, 0.10); }
.row-override .original-name::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 8px;
    vertical-align: middle;
}
.meta-reset {
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 7px;
    width: 27px;
    height: 27px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.meta-reset:hover { border-color: var(--accent); color: var(--accent-bright); }

/* ===================== macOS app adaptations ===================== */
/* Clear the traffic-light window controls (transparent full-size titlebar). */
.app-header { padding-left: 84px; -webkit-app-region: drag; }
.app-header .btn, .app-header input, .app-header .recurse-toggle { -webkit-app-region: no-drag; }

#folder-label { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.recurse-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-secondary); cursor: pointer; white-space: nowrap;
}
.recurse-toggle input { accent-color: var(--accent); width: 15px; height: 15px; }

select#sort-order, select#preset-select { /* inherit themed select look already defined */ }

/* File cell: thumbnail + name */
.file-cell { display: flex; align-items: center; gap: 10px; }
.thumb {
    width: 30px; height: 30px; flex-shrink: 0; border-radius: 6px;
    object-fit: cover; background: var(--glass-2); border: 1px solid var(--border-color);
}
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Finder color swatches (set-for-all picker) */
.label-picker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.swatch, .rsw {
    width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; transition: transform 0.12s ease, border-color 0.12s ease;
    display: inline-flex; align-items: center; justify-content: center;
}
.swatch:hover, .rsw:hover { transform: scale(1.15); }
.swatch.on, .rsw.on { border-color: var(--text-primary); }
.swatch.swatch-none, .rsw.none {
    background: var(--glass-2); border: 1.5px dashed var(--border-color);
    color: var(--text-muted); font-size: 12px;
}
.swatch.swatch-none.on, .rsw.none.on { border-color: var(--text-primary); border-style: solid; }
.swatch[data-c="gray"],   .rsw[data-c="gray"]   { background: #8e8e93; }
.swatch[data-c="green"],  .rsw[data-c="green"]  { background: #34c759; }
.swatch[data-c="purple"], .rsw[data-c="purple"] { background: #af52de; }
.swatch[data-c="blue"],   .rsw[data-c="blue"]   { background: #007aff; }
.swatch[data-c="yellow"], .rsw[data-c="yellow"] { background: #ffcc00; }
.swatch[data-c="red"],    .rsw[data-c="red"]    { background: #ff3b30; }
.swatch[data-c="orange"], .rsw[data-c="orange"] { background: #ff9500; }

/* Per-row compact swatches in the preview grid */
.row-swatches { display: inline-flex; gap: 5px; align-items: center; }
.row-swatches .rsw { width: 16px; height: 16px; border-width: 2px; }
.row-swatches .rsw.none { font-size: 10px; }

/* small color dot (used elsewhere if needed) */
.label-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: middle; }
.label-dot[data-c="gray"]{background:#8e8e93}.label-dot[data-c="green"]{background:#34c759}.label-dot[data-c="purple"]{background:#af52de}
.label-dot[data-c="blue"]{background:#007aff}.label-dot[data-c="yellow"]{background:#ffcc00}.label-dot[data-c="red"]{background:#ff3b30}.label-dot[data-c="orange"]{background:#ff9500}

/* --- Grid layout fix: real table cells + inner flex row (overrides earlier flex-on-td) --- */
.preview-table { table-layout: fixed; }
.preview-table th, .preview-table td { width: 50%; }
.file-cell, .meta-cell { display: table-cell; vertical-align: middle; }
.cellrow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cellrow .meta-input { width: 100%; min-width: 0; }
.file-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.new-name-preview { white-space: normal; word-break: break-word; }
.thumb { flex: 0 0 auto; }

/* --- Selection column + sort control (3-column grid now) --- */
.preview-table th, .preview-table td { width: auto; }
.preview-table th.sel-cell, .preview-table td.sel-cell { width: 44px; text-align: center; padding-left: 16px; }
.sel-cell input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
.row-unselected .file-cell,
.row-unselected .meta-cell,
.row-unselected .new-name-preview { opacity: 0.38; }
.row-unselected .file-name { text-decoration: line-through; text-decoration-color: var(--text-muted); }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-tools { display: flex; align-items: center; gap: 10px; }
.sel-summary { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.sort-label { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.sort-label select {
    background: var(--glass-2); border: 1px solid var(--border-color); border-radius: 8px;
    color: var(--text-primary); padding: 5px 8px; font-size: 12px; font-family: var(--font-sans); outline: none; cursor: pointer;
}
.sort-label select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.sort-dir { padding: 4px 10px; font-size: 14px; line-height: 1; }

/* Keep the preview header tidy with the extra Select control */
#preview-title { white-space: nowrap; }
.preview-tools { flex-wrap: wrap; justify-content: flex-end; }

/* Title bar is now a separate strip (traffic lights live there), so the web header
   no longer needs the traffic-light clearance / drag region. */
.app-header { padding-left: 24px; }
