:root {
    --bg: #0f172a;
    --panel: #ffffff;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --danger: #dc2626;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 45%, #334155 100%);
    color: var(--text);
    min-height: 100vh;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 40px 18px;
    color: #f8fafc;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #f8fafc;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
}

.site-nav a {
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 600;
}

.site-nav a:hover {
    color: #fff;
}

.nav-user {
    color: #a5b4fc;
    font-weight: 600;
}

.nav-logout {
    background: rgba(255, 255, 255, 0.12);
    padding: 6px 14px;
    border-radius: 999px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}

.brand-name {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.tagline {
    margin: 0;
    color: #cbd5f5;
    font-size: 13px;
}

.site-main {
    width: 75%;
    margin: 0 auto;
    padding: 8px 24px 48px;
    display: grid;
    gap: 24px;
    flex: 1 1 auto;
    box-sizing: border-box;
}

.card {
    background: var(--panel);
    border-radius: 16px;
    padding: 24px 28px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
}

.card h2 {
    margin: 0 0 18px;
    font-size: 19px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.file-input {
    flex: 1 1 260px;
    padding: 10px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: #f8fafc;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    background: var(--accent);
    transition: background 0.15s ease;
}

.btn:hover {
    background: var(--accent-dark);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #b91c1c;
}

.status {
    display: block;
    margin-top: 14px;
    font-size: 14px;
    min-height: 18px;
}

.status-ok {
    color: #15803d;
}

.status-error {
    color: var(--danger);
}

.count-badge {
    background: #e0e7ff;
    color: var(--accent-dark);
    border-radius: 999px;
    padding: 2px 12px;
    font-size: 13px;
    font-weight: 600;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
}

.files-table th,
.files-table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.files-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.name-cell {
    font-weight: 600;
    word-break: break-all;
}

.actions-col {
    text-align: right;
    white-space: nowrap;
}

.actions-col .btn {
    margin-left: 6px;
}

.empty {
    color: var(--muted);
    font-style: italic;
    margin: 8px 0 0;
}

.site-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-footer {
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    padding: 12px 0 24px;
    margin-top: auto;
}

.footer-credit {
    display: block;
    margin-top: 6px;
    color: #c0c0c0;
}

.footer-credit-link {
    color: #c0c0c0;
    text-decoration: none;
}

.footer-credit-link:hover {
    color: #e2e8f0;
    text-decoration: underline;
}

.browse-footer {
    flex: 0 0 auto;
    padding: 8px 16px 12px;
}

/* ===== Splash hero ===== */
.hero {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 24px;
    align-items: center;
    background: linear-gradient(120deg, #4f46e5, #7c3aed 40%, #db2777 80%, #f59e0b);
    background-size: 300% 300%;
    animation: heroShift 14s ease infinite;
    border-radius: 20px;
    padding: 36px 40px;
    color: #fff;
    box-shadow: 0 24px 60px rgba(79, 70, 229, 0.45);
    overflow: hidden;
}

@keyframes heroShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-title {
    margin: 0 0 12px;
    font-size: 38px;
    line-height: 1.1;
    letter-spacing: 0.4px;
}

.hero-sub {
    margin: 0 0 20px;
    font-size: 16px;
    max-width: 460px;
    color: #f1f5f9;
}

.hero-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
    font-weight: 600;
}

.hero-features li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
}

.dot-blue { background: #38bdf8; }
.dot-green { background: #34d399; }
.dot-pink { background: #fb7185; }

.hero-art {
    position: relative;
    height: 220px;
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 18s linear infinite;
}

.orbit-1 { width: 120px; height: 120px; }
.orbit-2 { width: 180px; height: 180px; animation-duration: 26s; animation-direction: reverse; }
.orbit-3 { width: 240px; height: 240px; animation-duration: 34s; }

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.hero-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #4f46e5;
    font-weight: 800;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* ===== Auth cards ===== */
.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.auth-card h2 {
    margin: 0 0 4px;
}

.card-hint {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 14px;
}

.auth-card-accent {
    border-top: 4px solid #db2777;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.field label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.remember-email {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -4px 0 14px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
}

.remember-email input {
    margin: 0;
}

.btn-block {
    width: 100%;
    margin-top: 4px;
}

.btn-accent {
    background: #db2777;
}

.btn-accent:hover {
    background: #be185d;
}

.btn-ghost {
    background: #e2e8f0;
    color: #334155;
}

.btn-ghost:hover {
    background: #cbd5e1;
}

/* ===== Site form ===== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field-wide {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.field-note {
    font-size: 12px;
    color: var(--muted);
}

.proto-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: #e0e7ff;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 720px) {
    .hero,
    .auth-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }
    .hero-art { display: none; }
}

/* ===== Tabs (FTP configuration) ===== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 18px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 10px 10px 0 0;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
    background: #eef2ff;
}

.tab-panel h2 {
    margin-top: 4px;
}

/* ===== FTP browser (Browse.aspx) ===== */
.browse-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #f1f5f9;
    margin-bottom: 16px;
}

.browse-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.browse-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}

.upload-pane h3,
.browser-pane h3 {
    margin: 0 0 10px;
}

.dropzone {
    border: 2px dashed #c7d2fe;
    border-radius: 14px;
    padding: 28px 16px;
    text-align: center;
    background: #f8fafc;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.dropzone.dz-hover {
    background: #eef2ff;
    border-color: var(--accent);
}

.dz-title {
    font-weight: 600;
    margin: 0 0 6px;
}

.dz-or {
    color: var(--muted);
    margin: 6px 0;
}

.upload-status {
    margin-top: 12px;
    font-size: 14px;
    color: var(--accent-dark);
    min-height: 18px;
    word-break: break-word;
}

.save-queue-heading {
    margin-top: 28px;
}

.save-overwrite-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    margin: 8px 0 4px;
}

.save-overwrite-label input {
    margin-top: 2px;
}

.save-queue-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.save-resume-banner {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.08);
}

.browser-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.breadcrumb {
    font-size: 14px;
    color: #334155;
    word-break: break-all;
}

.breadcrumb a {
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: 600;
}

.crumb-sep {
    color: var(--muted);
    margin: 0 2px;
}

.create-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.input-inline {
    width: auto;
    flex: 0 1 180px;
}

.btn-open {
    background: #0ea5e9;
}

.btn-open:hover {
    background: #0284c7;
}

@media (max-width: 720px) {
    .browse-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Full-viewport FTP browser (Browse.aspx) ===== */
.browse-body {
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.browse-topbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 22px;
    color: #f8fafc;
}

.browse-topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.browse-site {
    font-weight: 700;
    font-size: 16px;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.browse-unsupported {
    margin: 40px auto;
    background: #fff;
    color: #0f172a;
    padding: 24px 28px;
    border-radius: 14px;
    max-width: 520px;
    text-align: center;
}

.browse-app {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
    padding: 0 16px 8px;
    gap: 16px;
}

.browse-left {
    flex: 0 0 320px;
    background: var(--panel);
    color: var(--text);
    border-radius: 16px;
    padding: 20px 22px;
    overflow: auto;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
}

.browse-left h3 {
    margin: 0 0 10px;
}

.dz-help {
    margin-top: 14px;
}

.browse-right {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--panel);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
}

.tree-status {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sel-info {
    margin-left: auto;
    color: var(--muted);
    font-size: 13px;
    word-break: break-all;
}

.tree-wrap {
    flex: 1 1 auto;
    overflow: auto;
    padding: 12px 16px;
}

.tree-root-row {
    margin-bottom: 6px;
}

.tree, .tree-children {
    list-style: none;
    margin: 0;
    padding-left: 18px;
}

.tree {
    padding-left: 6px;
}

.tree-node {
    margin: 1px 0;
}

.tree-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tree-toggle {
    width: 16px;
    text-align: center;
    cursor: pointer;
    color: var(--muted);
    font-size: 11px;
    user-select: none;
}

.tree-toggle.leaf {
    cursor: default;
    color: #cbd5e1;
}

.tree-label {
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
}

.tree-label:hover {
    background: #f1f5f9;
}

.tree-label.selected {
    background: var(--accent);
    color: #fff;
}

.root-label {
    font-weight: 700;
}

.tree-error {
    color: var(--danger);
    font-size: 13px;
}

.tree-empty {
    color: var(--muted);
    font-style: italic;
    font-size: 13px;
}

.tree-error-banner {
    margin: 10px 16px 0;
    padding: 10px 14px;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 10px;
    font-size: 13px;
}

.clip-info {
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 600;
    word-break: break-all;
}

/* Brand jet logo */
.brand-jet {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    filter: drop-shadow(0 3px 6px rgba(56, 189, 248, 0.45));
    transform: translateY(-1px);
}

.brand-jet svg {
    display: block;
}

/* Browser top bar: white action links */
.browse-topbar-actions a,
.browse-topbar-actions a:visited {
    color: #ffffff;
}

.browse-topbar-actions .nav-logout {
    background: rgba(255, 255, 255, 0.14);
}

.browse-topbar-actions .nav-gear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.1);
}

.browse-topbar-actions .nav-gear:hover {
    color: #fff;
    background: rgba(56, 189, 248, 0.28);
}

/* Breadcrumb in the top-middle */
.browse-breadcrumb {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding: 0 16px;
}

.browse-breadcrumb .crumb {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 6px;
    white-space: nowrap;
}

.browse-breadcrumb .crumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

.browse-breadcrumb .crumb-sep {
    color: rgba(255, 255, 255, 0.55);
    padding: 0 1px;
}

/* Disabled toolbar buttons (e.g. New folder when a file is selected) */
.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Save-to-folder progress overlay */
.save-progress {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.save-progress-card {
    background: #fff;
    color: var(--text);
    border-radius: 16px;
    padding: 24px 28px;
    width: min(92vw, 480px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}

.save-progress-title {
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 14px;
}

.progress-track {
    height: 12px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    transition: width 0.15s ease;
}

.save-progress-stats {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.save-progress-current {
    margin: 6px 0 16px;
    font-size: 12px;
    color: var(--muted);
    word-break: break-all;
    min-height: 2.6em;
    max-height: 2.6em;
    overflow: hidden;
}

/* Save-to-folder: bottom progress panel (overrides the earlier centered dialog) */
.save-progress {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    inset: auto 0 0 0;
    background: #0b1220;
    color: #e2e8f0;
    display: block;
    align-items: initial;
    justify-content: initial;
    padding: 12px 20px 14px;
    border-top: 1px solid #1e293b;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
    z-index: 1000;
}

.save-progress .sp-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.save-progress .save-progress-title {
    font-weight: 700;
    white-space: nowrap;
}

.save-progress .progress-track {
    flex: 1 1 auto;
    margin: 0;
}

.save-progress .save-progress-stats {
    white-space: nowrap;
    font-weight: 600;
    font-size: 13px;
    color: #cbd5f5;
    margin: 0;
}

.save-progress .save-progress-current {
    margin: 6px 0 0;
    min-height: 1.2em;
    max-height: 1.2em;
    color: #94a3b8;
}

/* Right-panel transfer queue (row 2 under the tree) */
.queue-row {
    flex: 0 0 38%;
    max-height: 38%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
    padding: 10px 16px 12px;
}

.queue-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.queue-title { font-weight: 700; font-size: 14px; white-space: nowrap; }
.queue-track { flex: 1 1 auto; margin: 0; }
.queue-summary { font-size: 12px; color: var(--muted); white-space: nowrap; }

.queue-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    font-size: 12px;
    font-family: "SFMono-Regular", Consolas, monospace;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 8px;
}

.queue-empty { color: var(--muted); font-style: italic; }
.queue-item { display: flex; gap: 8px; align-items: baseline; padding: 1px 0; word-break: break-all; }
.q-ic { flex: 0 0 auto; width: 1.2em; text-align: center; }
.q-tx { flex: 1 1 auto; }
.q-done .q-tx { color: #15803d; }
.q-err .q-tx { color: var(--danger); }
.q-active .q-tx { color: var(--accent-dark); }

/* Info modal (jQuery UI) */
.ui-dialog .ui-dialog-titlebar-close { display: none; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th { text-align: left; padding: 6px 10px; color: var(--muted); width: 120px; vertical-align: top; font-weight: 600; }
.info-table td { padding: 6px 10px; word-break: break-all; }
.info-table .muted { color: var(--muted); font-size: 12px; }
.info-calc { color: var(--muted); font-style: italic; }

/* Transfer queue controls + split (success/failed) columns */
.queue-controls { display: flex; gap: 4px; margin-right: 8px; }

.queue-split { display: flex; gap: 12px; flex: 1 1 auto; min-height: 0; }
.queue-col { flex: 1 1 50%; display: flex; flex-direction: column; min-height: 0; }
.queue-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 4px;
    color: #334155;
}
#qOkList .queue-item { color: #15803d; }
#qFailList .queue-item { color: var(--danger); }

/* Footer wordmark with logo */
.footer-brand { display: inline-flex; align-items: center; gap: 6px; }
.footer-logo { vertical-align: middle; }

/* Draggable splitter between the tree and the transfer queue */
.v-resizer {
    flex: 0 0 auto;
    height: 7px;
    cursor: row-resize;
    background: var(--border);
    border-top: 1px solid #cbd5e1;
    position: relative;
}
.v-resizer::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 3px;
    border-radius: 2px;
    background: #94a3b8;
}
.v-resizer:hover, .v-resizer.dragging { background: #cbd5e1; }
.v-resizer:hover::after, .v-resizer.dragging::after { background: var(--accent); }

/* Error log viewer */
.err-table {
    table-layout: fixed;
}

.err-table th.err-when,
.err-table td.err-when {
    width: 160px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.err-table td.err-file {
    width: 220px;
    word-break: break-all;
    font-family: "Consolas", "Menlo", monospace;
    font-size: 12px;
    color: var(--muted);
}

.err-desc-cell {
    position: relative;
}

.err-desc {
    margin: 0;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 12px 12px 12px;
    font-family: "Consolas", "Menlo", monospace;
    font-size: 12px;
    line-height: 1.5;
}

.copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
}

/* File tree fills the pane; actions live on the right-click context menu. */
.tree-area {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    gap: 8px;
    padding: 12px 16px;
}

.tree-area .tree-status {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 16px;
    min-height: 18px;
}

.tree-area .tree-status .clip-info {
    margin: 0;
}

.tree-area .tree-status .sel-info {
    margin: 0 0 0 auto;
}

.tree-area .tree-wrap {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: 0;
}

/* Primary / default button states (used by the queue play/pause/stop). */
.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-dark);
}

.btn-default {
    background: #e2e8f0;
    color: #64748b;
    cursor: default;
}

.btn-default:hover {
    background: #e2e8f0;
}

.queue-controls .btn {
    padding: 4px 10px;
    min-width: 30px;
    font-size: 13px;
    border-radius: 6px;
    font-weight: 700;
}

/* Captcha on the registration form */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.captcha-img {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f1f5f9;
}

.captcha-refresh {
    line-height: 1;
    font-size: 16px;
}

.captcha-input {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
}

/* Text-file editor dialog */
#editDialog {
    padding: 6px 8px;
    box-sizing: border-box;
}

.edit-toolbar {
    display: flex;
    align-items: center;
    margin: 0 0 4px;
}

.edit-status {
    color: var(--muted);
    font-size: 12px;
}

.edit-area {
    display: block;
    width: 100%;
    box-sizing: border-box;
    resize: none;
    font-family: "Consolas", "Menlo", monospace;
    font-size: 13px;
    line-height: 1.45;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px;
    white-space: pre;
    overflow: auto;
}

.ctx-menu {
    position: fixed;
    z-index: 10000;
    min-width: 140px;
    padding: 4px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}

.ctx-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-radius: 6px;
    padding: 8px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}

.ctx-item:hover:not(.ctx-disabled) {
    background: #eff6ff;
    color: var(--accent-dark);
}

.ctx-item.ctx-disabled {
    color: var(--muted);
    cursor: default;
}

.ctx-item-danger {
    color: var(--danger);
}

.ctx-item-danger:hover:not(.ctx-disabled) {
    background: #fef2f2;
    color: #b91c1c;
}

.ctx-sep {
    height: 1px;
    margin: 4px 6px;
    background: var(--border);
}

.rename-hint {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 13px;
    word-break: break-all;
}

.rename-label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.rename-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
}

.rename-input:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
    border-color: var(--accent-dark);
}

.rename-error {
    margin: 8px 0 0;
    color: var(--danger);
    font-size: 12px;
}
