/* Variables del tema Default/legacy y valores base compartidos. */
:root,
html[data-theme="legacy"] {
    --bg: #000000;
    --panel: #000000;
    --text: #ffffff;
    --muted: #cccccc;
    --line: #4a4a4a;
    --accent: #ffc500;
    --accent-dark: #ff8700;
    --danger: #fa626b;
    --live-bg: #071b07;
    --live-text: #00ff00;
    --dead-bg: #210707;
    --unknown-bg: #1d1d1d;
    --unknown-text: #ffc500;
    --info-bg: #111111;
    --info-text: #cccccc;
    --success-bg: #071b07;
    --success-border: #145214;
    --success-text: #5ed84f;
    --alert-bg: #1f0707;
    --alert-border: #6a1b1b;
    --tab-link: #55aaff;
    --input-bg: #0c0c0c;
    --surface-2: #080808;
    --shadow: rgba(0, 0, 0, 0.72);
    --frame-bg: #0c0c0c;
    --scrollbar-track: #0c0c0c;
    --scrollbar-thumb: #4a4a4a;
}


:root,
html[data-theme="legacy"] {
    --download-bg: #ea4d00;
    --download-hover: #ff6600;
    --download-text: #ffffff;
    --mini-button-bg: #4b433b;
    --mini-button-hover: #5e554b;
    --mini-button-text: #ffc500;
    --state-live-bg: #071b07;
    --state-live-text: #00ff00;
    --state-dead-bg: #210707;
    --state-dead-text: #fa626b;
    --state-unknown-bg: #1d1d1d;
    --state-unknown-text: #ffc500;
    --state-info-bg: #111111;
    --state-info-text: #cccccc;
    --legacy-list-text: #ffffff;
    --legacy-report-text: #ffcc33;
    --legacy-mfname-text: #00ff00;
    --legacy-mfnam-text: #f5b041;
    --legacy-mfsize-text: #55aaff;
    --legacy-mfdate-text: #ff8700;
    --legacy-mflink-text: #55aaff;
    --legacy-warning-text: #ffcc33;
}

html[data-theme="legacy"] body {
    background: #000000;
    color: #ffffff;
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-size: 10px;
}

* {
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

[hidden] {
    display: none !important;
}

*::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
}

a {
    color: var(--accent);
    text-decoration: none;
}

/* Barra superior del panel. */
.topbar {
    align-items: center;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 28px;
    transition: background-color 160ms ease, border-color 160ms ease;
}

html[data-theme="legacy"] .topbar {
    display: none;
}

.topbar span {
    color: var(--muted);
    margin-left: 10px;
}

.topbar nav {
    display: flex;
    gap: 16px;
}

.layout {
    display: grid;
    gap: 18px;
    margin: 28px auto;
    max-width: 1280px;
    padding: 0 20px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
    transition: background-color 160ms ease, border-color 160ms ease;
}

html[data-theme="legacy"] .panel,
html[data-theme="legacy"] .result-panel {
    background: #000000;
    border-color: #4a4a4a;
    border-radius: 0;
    box-shadow: 0 0 1px 1px #302e30;
}

html[data-theme="legacy"] h1,
html[data-theme="legacy"] h2 {
    color: #ffc500;
    font-family: "Segoe UI", Tahoma, sans-serif;
}

/* Pantalla de login y acceso Telegram/manual. */
.auth-page {
    min-height: 100vh;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 20px;
}

.auth-card {
    max-width: 380px;
    width: 100%;
}

.telegram-auth-card {
    text-align: center;
}

.telegram-login-btn {
    background: #0088cc;
    border-radius: 3px;
    display: inline-block;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    min-width: 170px;
    padding: 10px 22px;
    width: auto;
}

.telegram-login-btn:hover {
    background: #006699;
}

.ip-info {
    color: var(--muted);
    font-size: 12px;
    margin-top: 18px;
}

.password-fallback {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 14px;
    text-align: left;
}

.password-fallback summary {
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    margin-bottom: 12px;
    text-align: center;
}

.password-fallback button[type="submit"] {
    display: block;
    font-size: 14px;
    margin: 4px auto 0;
    min-width: 120px;
    padding: 10px 24px;
}

h1, h2 {
    margin: 0 0 18px;
}

h1 {
    font-size: 20px;
}

h2 {
    font-size: 16px;
}

label {
    color: var(--muted);
    display: grid;
    font-size: 14px;
    gap: 7px;
    margin-bottom: 14px;
}

input, select, textarea {
    background: var(--input-bg);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-sizing: border-box;
    color: var(--text);
    font: inherit;
    padding: 11px 12px;
    width: 100%;
}

html[data-theme="legacy"] input,
html[data-theme="legacy"] select,
html[data-theme="legacy"] textarea {
    background: #0c0c0c;
    border-color: #4a4a4a;
    border-radius: 0;
    color: #ffffff;
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-size: 11px;
}

html[data-theme="legacy"] input:focus,
html[data-theme="legacy"] select:focus,
html[data-theme="legacy"] textarea:focus {
    border-color: #ffc500;
    box-shadow: 0 0 0 1px #ff8700;
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

#target-list::placeholder {
    text-align: center;
}

textarea {
    font-size: 10px;
    line-height: 1.45;
    min-height: 260px;
    resize: vertical;
}

#target-list,
#proxy-list {
    height: 300px;
    min-height: 300px;
}

#target-list,
#proxy-list {
    font-size: 13px;
}

button {
    background: var(--download-bg);
    border: 0;
    border-radius: 6px;
    color: var(--download-text);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    padding: 11px 16px;
}

button:hover {
    background: var(--download-hover);
}

button.ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--danger);
    padding: 8px 10px;
}


.job-form {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(160px, 220px) minmax(220px, 300px) 1fr auto;
}

.dashboard-grid {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: 180px minmax(0, 1fr);
}

/* Area de resultados Live/Dead/Unknow. */
.results-area {
    justify-self: center;
    width: 100%;
}

/* Footer informativo inspirado en el script viejo. */
.legacy-footer {
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.7;
    margin: 18px auto 28px;
    max-width: 1080px;
    padding: 0 20px;
    text-align: center;
}

.legacy-footer hr {
    background: var(--line);
    border: 0;
    color: var(--line);
    height: 1px;
    margin: 0 0 8px;
}

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

.legacy-footer .footer-line strong {
    color: var(--accent);
    font-weight: 800;
}

.legacy-footer .footer-limit {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.legacy-footer .powered {
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.legacy-footer .powered span {
    color: var(--accent);
    font-weight: 400;
    margin-left: 6px;
}

.legacy-footer .powered .dev-author {
    color: var(--text);
    font-weight: 400;
    margin-left: 0;
}

.legacy-footer .powered a {
    color: var(--accent-dark);
    font-weight: 400;
}

.legacy-footer .powered a:hover {
    color: var(--accent);
}

.legacy-footer .copyright {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: 0.2px;
    opacity: 0.78;
}

.legacy-footer .copyright a {
    color: var(--danger);
}

/* Vista List file para listar, seleccionar y borrar jobs guardados. */
.filelist-page {
    margin: 0 auto;
    max-width: 900px;
    text-align: center;
}

.filelist-actions {
    color: var(--muted);
    margin-bottom: 12px;
}

.filelist-actions a {
    margin: 0 5px;
}

.filelist-scroll {
    margin: 10px auto;
    max-height: 450px;
    overflow: auto;
    width: min(900px, calc(100vw - 36px));
}

.filelist-submit {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: center;
    margin: 12px 0 4px;
}

#table_filelist {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    border-spacing: 0;
    color: var(--text);
    min-width: 760px;
    overflow: hidden;
    width: 100%;
}

#table_filelist td {
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
}

#table_filelist .flisttblhdr td,
#table_filelist .flisttblftr td {
    background: var(--surface-2);
    color: var(--text);
}

#table_filelist .flistmouseoff {
    background: var(--panel);
}

#table_filelist .flistmouseoff:hover {
    background: var(--surface-2);
}

#table_filelist .filelist-name {
    color: var(--accent);
    font-weight: 700;
}

#table_filelist .filelist-source,
#table_filelist .filelist-date {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.dashboard-main {
    display: grid;
    gap: 18px;
    min-width: 0;
}

/* Menu superior estilo viejo usado por el tema Default. */
.legacy-main-nav {
    display: none;
}

.plugin-sidebar {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    height: 580px;
    max-height: none;
    overflow: hidden;
    padding: 14px;
}

.plugin-sidebar h2 {
    font-size: 14px;
    margin-bottom: 6px;
    text-align: center;
}

.plugin-sidebar h2 strong {
    color: var(--accent);
}

.plugin-count {
    display: inline;
}

.plugin-count-label {
    display: none;
}

.plugin-list {
    display: grid;
    gap: 0;
    list-style: none;
    margin: 8px 0 0;
    overflow-y: auto;
    padding: 0;
}

.plugin-list li {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 2px;
    padding: 4px 0;
}

html[data-theme="legacy"] .plugin-list li {
    border-top-color: #262626;
}

html[data-theme="legacy"] .plugin-list strong {
    color: #cccccc;
    font-weight: normal;
}

.plugin-list strong {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.premium-heading {
    border-top: 1px solid var(--line);
    font-size: 12px;
    font-weight: 700;
    margin-top: 10px;
    padding-top: 8px;
    text-align: center;
}

.premium-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
}

.premium-list li {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.premium-list strong {
    color: inherit;
    font-weight: 600;
}

.premium-list li.is-debrid strong {
    color: #33ff00;
}

.premium-more summary {
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
    list-style: none;
    margin-top: 4px;
}

.premium-more summary::-webkit-details-marker {
    display: none;
}

.workbench h1,
.compact-panel h2 {
    margin-bottom: 14px;
}

.legacy-welcome {
    display: none;
}

html[data-theme="legacy"] .layout {
    display: block;
    margin: 0 auto;
    max-width: 960px;
    padding: 0;
}

html[data-theme="legacy"] .dashboard-grid {
    align-items: start;
    display: grid;
    gap: 0;
    grid-template-columns: 122px 720px;
    justify-content: center;
    margin-top: 12px;
}

html[data-theme="legacy"] .dashboard-main {
    display: block;
}

html[data-theme="legacy"] .legacy-main-nav {
    border-spacing: 1px;
    display: flex;
    justify-content: center;
    margin: 0 auto;
}

html[data-theme="legacy"] .legacy-main-nav a,
html[data-theme="legacy"] .legacy-main-nav button {
    align-items: center;
    background: #4b433b url("images/button_bg1.gif") center no-repeat;
    border: 0;
    box-shadow: none;
    color: #ffc500;
    cursor: pointer;
    display: inline-flex;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 10px;
    font-weight: normal;
    height: 31px;
    justify-content: center;
    margin: 0 1px 0 0;
    padding: 0;
    text-decoration: none;
    text-shadow: none;
    width: 119px;
}

html[data-theme="legacy"] .legacy-main-nav a:hover,
html[data-theme="legacy"] .legacy-main-nav button:hover {
    background: #4b433b url("images/button_bg1.gif") center no-repeat;
    color: #ffc500;
}

html[data-theme="legacy"] .plugin-sidebar {
    background: transparent;
    border: 0;
    box-shadow: none;
    display: block;
    height: auto;
    overflow: visible;
    padding: 0;
    width: 140px;
}

html[data-theme="legacy"] .plugin-sidebar h2 {
    background: transparent;
    color: #ffc500;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 10px;
    font-weight: normal;
    height: auto;
    line-height: normal;
    margin: 0 0 2px;
    overflow: visible;
    text-align: center;
    width: 109px;
}

html[data-theme="legacy"] .plugin-title {
    background: url("images/button_bg2.gif") center no-repeat;
    color: #ffc500;
    display: block;
    height: 27px;
    line-height: 27px;
    width: 109px;
}

html[data-theme="legacy"] .plugin-count {
    background: #657b87;
    color: #eeeeee;
    display: block;
    font-size: 10px;
    font-weight: normal;
    height: 16px;
    line-height: 16px;
    margin: 1px auto 2px 1px;
    width: 102px;
}

html[data-theme="legacy"] .cell-plugin {
    background: url("images/button_bg2.gif") center no-repeat;
    color: #ffc500;
    display: block;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 10px;
    font-weight: normal;
    height: 27px;
    line-height: 27px;
    text-align: center;
    width: 109px;
}

html[data-theme="legacy"] .plugincolhd {
    background-color: #657b87;
    color: #eeeeee;
    display: block;
    margin: 1px auto 2px 1px;
    padding: 1px;
    width: 102px;
}

html[data-theme="legacy"] .plugincollst {
    color: #cccccc;
}

html[data-theme="legacy"] .plugin-count strong {
    color: #eeeeee;
    font-weight: bold;
}

html[data-theme="legacy"] .plugin-count-label {
    display: inline;
}

html[data-theme="legacy"] .plugin-list {
    border: 0;
    display: block;
    direction: rtl;
    height: 150px;
    margin: 0;
    overflow-y: scroll;
    padding-left: 5px;
}

html[data-theme="legacy"] .plugin-list li {
    border: 0;
    display: block;
    padding: 0;
}

html[data-theme="legacy"] .plugin-list strong {
    color: #cccccc;
    display: block;
    direction: ltr;
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-size: 11px;
    font-weight: normal;
    line-height: 14.5px;
    text-align: left;
}

html[data-theme="legacy"] .premium-heading {
    background: url("images/button_bg2.gif") center no-repeat;
    border: 0;
    color: #ffc500;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 10px;
    font-weight: normal;
    height: 27px;
    line-height: 27px;
    margin: 8px 0 0;
    padding: 0;
    text-align: center;
    width: 109px;
}

html[data-theme="legacy"] .premium-list {
    direction: rtl;
    margin-top: 5px;
    padding-left: 5px;
}

html[data-theme="legacy"] .premium-list li {
    color: #cccccc;
    direction: ltr;
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-size: 11px;
    line-height: 14.5px;
    text-align: left;
}

html[data-theme="legacy"] .premium-list strong {
    font-weight: normal;
}

html[data-theme="legacy"] .premium-list li.is-debrid strong {
    color: #33ff00;
}

html[data-theme="legacy"] .premium-more summary {
    color: #ff6600;
    direction: ltr;
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-size: 11px;
    line-height: 14.5px;
    text-align: left;
    text-decoration: none;
}

html[data-theme="legacy"] .workbench {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #ffffff;
    padding: 0;
    text-align: center;
}

html[data-theme="legacy"] .workbench::before {
    content: "";
    display: block;
    height: 5px;
}

html[data-theme="legacy"] .workbench h1 {
    display: none;
}

html[data-theme="legacy"] .legacy-welcome {
    display: block;
    margin-bottom: 4px;
}

html[data-theme="legacy"] .legacy-welcome span {
    color: #ff0000;
    font-weight: bold;
}

/* Formulario compacto del checker en tema Default. */
html[data-theme="legacy"] .bulk-form {
    display: block;
}

html[data-theme="legacy"] .input-columns {
    display: flex;
    gap: 4px;
    justify-content: center;
}

html[data-theme="legacy"] #target-list,
html[data-theme="legacy"] #proxy-list {
    border: 1px solid #4a4a4a;
    border-radius: 0;
    box-shadow: none;
    font-size: 10px;
    height: 100px;
    min-height: 100px;
    padding: 2px;
    resize: none;
}

html[data-theme="legacy"] #target-list::placeholder {
    font-size: 10px;
    text-align: center;
}

html[data-theme="legacy"] #target-list {
    width: 550px;
}

html[data-theme="legacy"] #proxy-list {
    width: 144px;
}

html[data-theme="legacy"] .checker-status {
    display: inline-block;
    margin: 6px 0 12px;
}

html[data-theme="legacy"] .bulk-status {
    display: block;
    font-size: 11px;
    padding: 0;
}

html[data-theme="legacy"] .bulk-status span {
    background: transparent;
    border: 0;
    color: #ffffff;
    display: inline;
    padding: 0;
}

html[data-theme="legacy"] .bulk-status strong,
html[data-theme="legacy"] .checker-status {
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 75%;
    font-weight: 700;
    height: 17px;
    line-height: normal;
    min-width: 24px;
    padding: 0 7px;
    text-align: center;
    vertical-align: baseline;
    white-space: nowrap;
}

html[data-theme="legacy"] .bulk-status span:nth-child(1) strong {
    background: #2f8f27;
    color: #ffffff;
}

html[data-theme="legacy"] .bulk-status span:nth-child(2) strong {
    background: #b8323a;
    color: #ffffff;
}

html[data-theme="legacy"] .bulk-status span:nth-child(3) strong,
html[data-theme="legacy"] .bulk-status span:nth-child(5) strong {
    background: #4a4d59;
    color: #ffffff;
}

html[data-theme="legacy"] .bulk-status span:nth-child(4) strong,
html[data-theme="legacy"] .checker-status {
    background: #17738a;
    color: #ffffff;
}

html[data-theme="legacy"] .bulk-status span:nth-child(6) strong {
    background: #286090;
    color: #ffffff;
}

html[data-theme="legacy"] .bulk-status span:nth-child(7) strong {
    background: #b4690e;
    color: #ffffff;
}

html[data-theme="legacy"] .workbench-options {
    border-top: 0;
    display: block;
    padding-top: 14px;
}

html[data-theme="legacy"] .run-options {
    display: block;
    margin-bottom: 14px;
}

html[data-theme="legacy"] .check-option {
    color: #ffffff;
    display: inline-flex;
    font-size: 11px;
    gap: 3px;
    margin: 0 12px 0 0;
}

html[data-theme="legacy"] .bulk-actions {
    display: block;
}

html[data-theme="legacy"] #download-button {
    background: #ea4d00;
    border: 1px solid #cccccc;
    border-radius: 5px;
    box-shadow: 0 1px 3px #111111;
    color: #ffffff;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    height: 22px;
    padding: 0;
    text-shadow: 0 1px 0 #000000;
    width: 65px;
}

html[data-theme="legacy"] #clear-targets {
    background: #ea4d00;
    border: 1px solid #cccccc;
    border-radius: 5px;
    box-shadow: 0 1px 3px #111111;
    color: #ffffff;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    height: 22px;
    padding: 0 8px;
    text-shadow: 0 1px 0 #000000;
}

html[data-theme="legacy"] #download-button:hover,
html[data-theme="legacy"] #clear-targets:hover {
    background: #ff6600;
}

/* Formulario de checker para temas modernos. */
.bulk-form {
    display: grid;
    gap: 12px;
}

.bulk-toolbar {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(180px, 260px) auto;
}

.bulk-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 0;
    white-space: nowrap;
}

.input-columns {
    align-items: start;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) 190px;
}

.target-column {
    display: grid;
    gap: 0;
    min-width: 0;
}

.input-columns label {
    margin-bottom: 0;
}

.bulk-status {
    display: flex;
    font-size: 12px;
    gap: 12px;
    justify-content: center;
    padding-top: 0;
    text-align: center;
    flex-wrap: wrap;
}

.bulk-status span {
    background: var(--state-info-bg);
    border-radius: 999px;
    color: var(--state-info-text);
    padding: 5px 9px;
}

html[data-theme="legacy"] .bulk-status span,
html[data-theme="legacy"] .checker-status,
html[data-theme="legacy"] .status {
    border: 1px solid #4a4a4a;
    border-radius: 0;
    font-size: 11px;
}

.bulk-status span:nth-child(1) {
    background: var(--state-live-bg);
    color: var(--state-live-text);
}

.bulk-status span:nth-child(2) {
    background: var(--state-dead-bg);
    color: var(--state-dead-text);
}

.bulk-status span:nth-child(3) {
    background: var(--state-unknown-bg);
    color: var(--state-unknown-text);
}

.bulk-status span:nth-child(4),
.bulk-status span:nth-child(5) {
    background: var(--state-info-bg);
    color: var(--state-info-text);
}

html[data-theme="legacy"] .bulk-status span {
    background: transparent;
    border: 0;
    border-radius: 0;
    color: #ffffff;
    display: inline;
    padding: 0;
}

html[data-theme="legacy"] .bulk-status span:nth-child(n) {
    background: transparent;
    color: #ffffff;
}

html[data-theme="legacy"] .bulk-status strong {
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 75%;
    font-weight: 700;
    height: 17px;
    line-height: normal;
    min-width: 24px;
    padding: 0 7px;
    text-align: center;
}

html[data-theme="legacy"] .bulk-status span:nth-child(1) strong {
    background: #2f8f27;
}

html[data-theme="legacy"] .bulk-status span:nth-child(2) strong {
    background: #b8323a;
}

html[data-theme="legacy"] .bulk-status span:nth-child(3) strong,
html[data-theme="legacy"] .bulk-status span:nth-child(5) strong {
    background: #4a4d59;
}

html[data-theme="legacy"] .bulk-status span:nth-child(4) strong {
    background: #17738a;
}

html[data-theme="legacy"] .bulk-status span:nth-child(6) strong {
    background: #286090;
    color: #ffffff;
}

html[data-theme="legacy"] .bulk-status span:nth-child(7) strong {
    background: #b4690e;
    color: #ffffff;
}

.checker-status {
    border-radius: 999px;
    display: inline-block;
    font-size: 13px;
    justify-self: center;
    margin-top: 2px;
    padding: 6px 12px;
}

.status-waiting {
    background: var(--state-info-bg);
    color: var(--state-info-text);
}

.status-running {
    background: var(--state-unknown-bg);
    color: var(--state-unknown-text);
}

.status-success {
    background: var(--state-live-bg);
    color: var(--state-live-text);
}

.status-error {
    background: var(--state-dead-bg);
    color: var(--state-dead-text);
}

.workbench-options {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 12px;
    padding-top: 12px;
}

.run-options,
.telegram-options {
    align-items: end;
    display: grid;
    gap: 12px;
}

.run-options {
    justify-content: center;
    grid-template-columns: repeat(5, max-content);
}

.telegram-options {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px var(--shadow);
    column-gap: 22px;
    grid-template-columns: minmax(140px, 190px) minmax(220px, 320px) minmax(max-content, 1fr);
    left: 50%;
    max-width: calc(100vw - 32px);
    padding: 12px;
    position: fixed;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(620px, calc(100vw - 32px));
    z-index: 60;
}

.telegram-options label {
    min-width: 0;
}

.telegram-chat-field {
    grid-column: 1;
    grid-row: 1;
}

.telegram-message-field {
    grid-column: 2;
    grid-row: 1;
}

.telegram-options input,
.telegram-options select {
    box-sizing: border-box;
    width: 100%;
}

.telegram-close {
    align-self: end;
    background: var(--mini-button-bg);
    color: var(--mini-button-text);
    font-size: 12px;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    max-width: max-content;
    min-width: 0;
    padding: 8px 10px;
    white-space: nowrap;
    width: auto;
}

.telegram-close:hover {
    background: var(--mini-button-hover);
}

.check-option {
    align-items: center;
    display: flex;
    gap: 7px;
    margin: 0 0 14px;
    white-space: nowrap;
}

.check-option input {
    width: auto;
}

.results-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

.result-tabs {
    border-top: 1px solid var(--line);
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    padding: 12px 4px 0;
}

.result-tabs nav {
    display: flex;
    gap: 18px;
}

.result-tabs a {
    color: var(--tab-link);
    font-weight: 700;
}

.result-tabs a[data-result-panel="liv"] {
    color: var(--state-live-text);
}

.result-tabs a[data-result-panel="dea"] {
    color: var(--state-dead-text);
}

.result-tabs a[data-result-panel="unkk"] {
    color: var(--state-unknown-text);
}

/* Panel visual de cada tipo de resultado. */
.result-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-left: -14%;
    min-width: 0;
    width: 128%;
}

html[data-theme="legacy"] .results-area {
    left: 50%;
    margin: 12px auto 0;
    max-width: 1534px;
    position: relative;
    transform: translateX(-50%);
    width: min(1534px, calc(100vw - 28px));
}

html[data-theme="legacy"] .legacy-footer {
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 11px;
    line-height: 17px;
    margin: 16px auto 20px;
    max-width: 900px;
    padding: 0 10px;
    text-align: center;
}

html[data-theme="legacy"] .legacy-footer hr {
    background: #4a4a4a;
    color: #4a4a4a;
    height: 1px;
    margin: 0 0 8px;
}

html[data-theme="legacy"] .legacy-footer .footer-line {
    color: #cccccc;
    font-size: 10px;
}

html[data-theme="legacy"] .legacy-footer .footer-line strong {
    color: #55aaff;
    font-weight: bold;
}

html[data-theme="legacy"] .legacy-footer .footer-limit {
    color: #ffc500;
    font-size: 10px;
    font-weight: bold;
}

html[data-theme="legacy"] .legacy-footer .footer-limit strong {
    color: #ff8700;
}

html[data-theme="legacy"] .legacy-footer .powered {
    color: #cccccc;
    font-size: 11px;
    font-weight: 400;
    line-height: 17px;
}

html[data-theme="legacy"] .legacy-footer .powered span {
    color: #ffc500;
    font-weight: 400;
}

html[data-theme="legacy"] .legacy-footer .powered .dev-author {
    color: #ff8700;
    font-weight: 400;
}

html[data-theme="legacy"] .legacy-footer .powered a {
    color: #ffc500;
    font-weight: 400;
}

html[data-theme="legacy"] .legacy-footer .powered a:hover {
    color: #ff8700;
}

html[data-theme="legacy"] .legacy-footer .copyright {
    color: #999999;
    font-size: 10.5px;
    font-weight: 400;
    line-height: 16px;
}

html[data-theme="legacy"] .legacy-footer .copyright a {
    color: red;
    text-decoration: none;
}

html[data-theme="legacy"] .filelist-page {
    color: #ffffff;
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-size: 11px;
}

html[data-theme="legacy"] .filelist-actions a {
    color: #55aaff;
}

html[data-theme="legacy"] .filelist-scroll {
    width: 800px;
}

html[data-theme="legacy"] #table_filelist {
    background: #151821;
    border-color: #ffffff;
    border-radius: 8px;
    color: #ffffff;
}

html[data-theme="legacy"] #table_filelist td {
    border-bottom-color: #2d3440;
}

html[data-theme="legacy"] #table_filelist .flisttblhdr td,
html[data-theme="legacy"] #table_filelist .flisttblftr td {
    background: #252b36;
    color: #ffffff;
}

html[data-theme="legacy"] #table_filelist .flistmouseoff {
    background: #191e28;
}

html[data-theme="legacy"] #table_filelist .flistmouseoff:hover {
    background: #222a38;
}

html[data-theme="legacy"] #table_filelist .filelist-name {
    color: #ffc500;
}

html[data-theme="legacy"] #table_filelist .filelist-source,
html[data-theme="legacy"] #table_filelist .filelist-date {
    color: #bfc7d5;
}

html[data-theme="legacy"] .results-grid {
    margin-top: 1em;
}

html[data-theme="legacy"] .result-tabs {
    border-top: 1px solid #4a4a4a;
    display: block;
    margin-top: 8px;
    padding-top: 10px;
    text-align: left;
}

html[data-theme="legacy"] .result-tabs span {
    color: #55bbff;
    font-size: 11px;
}

html[data-theme="legacy"] .result-tabs nav {
    display: block;
    text-align: right;
}

html[data-theme="legacy"] .result-tabs a {
    color: #ff6600;
    font-weight: bold;
    margin-left: 18px;
}

html[data-theme="legacy"] .result-panel {
    border: 1px solid #ffffff;
    border-radius: 15px;
    box-shadow: 1px 1px 5px #333333;
    margin: 0 auto;
    overflow: hidden;
    width: 100%;
}

.result-header {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 13px;
}

html[data-theme="legacy"] .result-header {
    background: url("images/bg.gif") repeat-x;
    border: 1px solid #ffffff;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    border-radius: 15px 15px 0 0;
    color: #ffffff;
    font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    line-height: 35px;
    min-height: 35px;
    padding: 0;
}

html[data-theme="legacy"] .live-panel .result-header strong {
    color: #2f8f27;
}

html[data-theme="legacy"] .dead-panel .result-header strong {
    color: #b8323a;
}

html[data-theme="legacy"] .unknown-panel .result-header strong {
    color: #4a4d59;
}

html[data-theme="legacy"] .result-header strong {
    margin-left: 12px;
}

html[data-theme="legacy"] .result-header strong span {
    border-radius: 4px;
    color: #ffffff;
    display: inline-block;
    font-size: 75%;
    line-height: 1;
    margin-left: 4px;
    padding: .2em .6em .3em;
}

html[data-theme="legacy"] .live-panel .result-header strong span {
    background: #2f8f27;
}

html[data-theme="legacy"] .dead-panel .result-header strong span {
    background: #b8323a;
}

html[data-theme="legacy"] .unknown-panel .result-header strong span {
    background: #4a4d59;
}

html[data-theme="legacy"] .result-body {
    background: #1c1f2a;
    border-radius: 0 0 15px 15px;
    color: #cccccc;
    min-height: 120px;
    padding: 1px;
}

.result-body {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
    min-height: 240px;
    overflow: auto;
    padding: 10px;
}

/* Clases legacy emitidas por plugins: no se modifican los plugins, solo se colorea su salida. */
.result-body .list,
.result-body .shad {
    color: var(--legacy-list-text);
    font-weight: 400;
}

.result-body .report {
    color: var(--legacy-report-text);
    font-weight: 400;
}

.result-body .mfname {
    color: var(--legacy-mfname-text);
    font-weight: 400;
}

.result-body .mfnam {
    color: var(--legacy-mfnam-text);
    font-weight: 400;
}

.result-body .mfsize {
    color: var(--legacy-mfsize-text);
    font-weight: 400;
}

.result-body .mfdate {
    color: var(--legacy-mfdate-text);
    font-weight: 400;
}

.result-body .mflink,
.result-body .mflink a {
    color: var(--legacy-mflink-text);
    font-weight: 400;
}

.result-body .error {
    color: var(--danger);
    font-weight: 400;
}

.result-body .content,
.result-body .tdgridClassTicket,
.result-body .download_link,
.result-body .pl-1,
.result-body .col-6,
.result-body .col-xs-12col-6 {
    color: var(--text);
}

.result-body .alert {
    display: inline-block;
    margin: 2px 0;
    padding: 2px 6px;
}

.result-body .alert-warning {
    color: var(--legacy-warning-text);
}

.result-body .alert-danger {
    color: var(--danger);
}

html[data-theme="legacy"] .result-body .list,
html[data-theme="legacy"] .result-body .shad {
    color: #ffffff;
}

html[data-theme="legacy"] .result-body .report {
    color: #ffcc33;
}

html[data-theme="legacy"] .result-body .mfname {
    color: #00ff00;
}

html[data-theme="legacy"] .result-body .mfnam {
    color: #f5b041;
}

html[data-theme="legacy"] .result-body .mfsize {
    color: #55aaff;
}

html[data-theme="legacy"] .result-body .mfdate {
    color: #ff8700;
}

html[data-theme="legacy"] .result-body .mflink,
html[data-theme="legacy"] .result-body .mflink a {
    color: #55aaff;
}

.unknown-frame-wrap {
    border: 1px solid var(--line);
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
}

.unknown-frame-title {
    background: var(--state-unknown-bg);
    border-bottom: 1px solid var(--line);
    color: var(--state-unknown-text);
    font-size: 12px;
    overflow-wrap: anywhere;
    padding: 7px 9px;
}

.unknown-frame {
    background: var(--frame-bg);
    border: 0;
    display: block;
    height: 420px;
    width: 100%;
}

.live-panel .result-header {
    background: var(--state-live-bg);
    color: var(--state-live-text);
}

.dead-panel .result-header {
    background: var(--state-dead-bg);
    color: var(--state-dead-text);
}

.unknown-panel .result-header {
    background: var(--state-unknown-bg);
    color: var(--state-unknown-text);
}

.mini-button {
    background: var(--mini-button-bg);
    border-radius: 4px;
    color: var(--mini-button-text);
    font-size: 12px;
    padding: 5px 8px;
}

.mini-button:hover {
    background: var(--mini-button-hover);
}

html[data-theme="legacy"] .mini-button {
    background: #ea4d00;
    border: 1px solid #cccccc;
    border-radius: 5px;
    box-shadow: 0 1px 3px #111111;
    color: #ffffff;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    padding: 5px 10px;
    text-shadow: 0 1px 0 #000000;
}

html[data-theme="legacy"] .mini-button:hover {
    background: #ff6600;
}

html[data-theme="legacy"] .telegram-login-btn {
    background: #0088cc;
    border: 0;
    border-radius: 3px;
    box-shadow: none;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    min-width: 170px;
    padding: 10px 22px;
    text-shadow: none;
}

html[data-theme="legacy"] .telegram-login-btn:hover {
    background: #006699;
}

.notice, .alert {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: 6px;
    color: var(--success-text);
    margin: 0;
    padding: 12px;
}

.alert {
    background: var(--alert-bg);
    border-color: var(--alert-border);
    color: var(--danger);
    margin-bottom: 14px;
}

.muted {
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    min-width: 980px;
    width: 100%;
}

th, td {
    border-bottom: 1px solid var(--line);
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

tbody tr:nth-child(even) {
    background: var(--surface-2);
}

th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.target {
    max-width: 420px;
    overflow-wrap: anywhere;
}

.status {
    background: var(--state-info-bg);
    border-radius: 999px;
    color: var(--state-info-text);
    display: inline-block;
    font-size: 12px;
    padding: 5px 9px;
}

td form {
    margin: 0 0 6px;
}

/* Ajustes responsive para pantallas pequenas. */
@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 16px 20px;
    }

    .job-form {
        grid-template-columns: 1fr;
    }

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

    .plugin-sidebar {
        max-height: 260px;
        position: static;
    }

    .bulk-toolbar {
        grid-template-columns: 1fr;
    }

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

    .telegram-options {
        column-gap: 10px;
        grid-template-columns: minmax(80px, 115px) minmax(80px, 1fr) auto;
        top: 50%;
    }

    .telegram-close {
        grid-column: 3;
        grid-row: 1;
    }

    .run-options,
    .results-grid {
        grid-template-columns: 1fr;
    }

    .bulk-actions {
        margin-bottom: 0;
    }

    .bulk-status {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

/* ==========================================================================
   BYW Secure v4.0 Enhanced — Classic Legacy Theme Exclusive
   Quick Tools, Clean Footer & Performance Optimizations
   ========================================================================== */

/* Plugin Search & Quick Tools */
.plugin-search-wrap {
    margin: 4px 0;
}

html[data-theme="legacy"] .plugin-search-wrap {
    width: 109px;
}

.plugin-search-input {
    font-size: 11px !important;
    height: 24px;
    padding: 4px 6px !important;
}

#sidebar-plugin-list li {
    cursor: pointer;
}

#sidebar-plugin-list li:hover strong {
    color: var(--accent) !important;
}

.quick-tools-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 6px;
}

.mini-tool-btn {
    align-items: center;
    background: var(--surface-2, #1c222d);
    border: 1px solid var(--line, #4a4a4a);
    border-radius: 5px;
    color: var(--accent, #ffc500);
    cursor: pointer;
    display: inline-flex;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 11px;
    font-weight: 600;
    gap: 5px;
    height: 24px;
    margin: 0;
    padding: 0 10px;
    transition: border-color 140ms ease, background-color 140ms ease;
}

.mini-tool-btn:hover {
    border-color: var(--accent);
}

.drag-over {
    border-color: var(--accent) !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.45) !important;
}

.progress-wrap {
    background: #141821;
    border: 1px solid var(--line);
    border-radius: 999px;
    height: 8px;
    margin: 6px auto 4px;
    max-width: 698px;
    overflow: hidden;
    width: 100%;
}

.progress-bar {
    background: linear-gradient(90deg, var(--accent-dark), var(--accent), #10b981);
    height: 100%;
    transition: width 180ms ease;
}

.result-filter-wrap {
    display: inline-block;
    margin: 0 12px;
}

.result-filter-input {
    font-size: 11px !important;
    height: 24px;
    max-width: 220px;
    padding: 4px 8px !important;
}

#ajax-message {
    font-size: 11px;
    margin: 0 auto 10px;
    max-width: 698px;
    padding: 6px 10px;
}

/* Clean Text Footer (No Cards, No Bold) */
.sv4-footer {
    max-width: 920px !important;
    margin: 18px auto 26px !important;
    padding: 0 12px !important;
}

.legacy-footer .footer-line,
html[data-theme="legacy"] .legacy-footer .footer-line,
.legacy-footer .footer-limit,
html[data-theme="legacy"] .legacy-footer .footer-limit {
    font-weight: 400 !important;
}

.legacy-footer .footer-limit span {
    color: var(--accent-dark, #ff8700);
    font-weight: 400;
}

.legacy-footer .footer-line span {
    color: #55aaff;
    font-weight: 400;
}

.legacy-footer .powered .dot {
    color: var(--line, #4a4a4a);
    margin: 0 4px;
}

.legacy-footer .powered .ver-badge {
    color: var(--accent, #ffc500);
    font-weight: 400;
    margin-left: 0;
}

.legacy-footer .powered .ai-author {
    color: var(--accent, #ffc500);
    font-weight: 400;
    margin-left: 0;
}

html[data-theme="legacy"] .legacy-footer .powered .ai-author {
    color: #55aaff;
    font-weight: 400;
}

/* Rendering performance optimization for large result lists */
.result-body .result-entry {
    content-visibility: auto;
    contain-intrinsic-size: 18px;
}

/* ==========================================================================
   Full Mobile & Tablet Responsiveness (All Themes: Legacy, Cyber, Matrix)
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

/* Tablet & Mobile (<= 960px) */
@media (max-width: 960px) {
    html[data-theme="legacy"] .layout,
    .layout {
        max-width: 100%;
        padding: 0 12px;
        margin: 12px auto;
    }

    html[data-theme="legacy"] .dashboard-grid,
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    html[data-theme="legacy"] .input-columns,
    .input-columns {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    html[data-theme="legacy"] .target-column,
    .target-column,
    html[data-theme="legacy"] #target-list,
    html[data-theme="legacy"] #proxy-list,
    #target-list,
    #proxy-list {
        width: 100% !important;
        max-width: 100% !important;
    }

    html[data-theme="legacy"] #target-list {
        height: 150px;
        min-height: 130px;
    }

    html[data-theme="legacy"] #proxy-list {
        height: 85px;
        min-height: 75px;
    }

    html[data-theme="legacy"] .plugin-sidebar,
    .plugin-sidebar {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        order: 2;
        padding: 10px !important;
        border: 1px solid var(--line, #3a3a3a) !important;
        border-radius: 8px !important;
    }

    .dashboard-main {
        order: 1;
        width: 100%;
    }

    html[data-theme="legacy"] .plugin-sidebar h2,
    html[data-theme="legacy"] .plugin-title,
    html[data-theme="legacy"] .cell-plugin,
    html[data-theme="legacy"] .plugin-count,
    html[data-theme="legacy"] .plugincolhd,
    html[data-theme="legacy"] .plugin-search-wrap,
    html[data-theme="legacy"] .premium-heading {
        width: 100% !important;
        background-size: 100% 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    html[data-theme="legacy"] .plugin-list,
    .plugin-list {
        direction: ltr !important;
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)) !important;
        gap: 4px 8px !important;
        height: 140px !important;
        max-height: 140px !important;
        overflow-y: auto !important;
        padding: 6px !important;
    }

    html[data-theme="legacy"] .premium-list {
        direction: ltr !important;
        display: flex;
        flex-wrap: wrap;
        gap: 6px 14px;
        justify-content: center;
    }

    html[data-theme="legacy"] .results-area,
    .results-area {
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 4px;
    }

    .result-panel,
    html[data-theme="legacy"] .result-panel {
        margin-left: 0 !important;
        width: 100% !important;
    }

    html[data-theme="legacy"] .filelist-scroll,
    .filelist-scroll {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto;
    }
}

/* Phones (<= 640px) */
@media (max-width: 640px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
    }

    .topbar-nav {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px;
    }

    html[data-theme="legacy"] .legacy-main-nav,
    .legacy-main-nav {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        justify-content: center !important;
        margin-bottom: 8px !important;
    }

    html[data-theme="legacy"] .legacy-main-nav a,
    html[data-theme="legacy"] .legacy-main-nav button {
        flex: 1 1 calc(33.333% - 6px);
        min-width: 92px;
        width: auto !important;
        background-size: 100% 100% !important;
        margin: 0 !important;
    }

    .quick-tools-bar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .mini-tool-btn {
        justify-content: center;
        height: 30px;
        font-size: 11px;
    }

    html[data-theme="legacy"] .bulk-status,
    .bulk-status {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px 8px !important;
    }

    html[data-theme="legacy"] .run-options,
    .run-options {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px 12px !important;
    }

    html[data-theme="legacy"] .check-option,
    .check-option {
        margin: 0 !important;
        font-size: 12px !important;
    }

    html[data-theme="legacy"] #download-button,
    html[data-theme="legacy"] #clear-targets,
    #download-button,
    #clear-targets {
        height: 34px !important;
        min-width: 110px !important;
        font-size: 13px !important;
        padding: 0 16px !important;
    }

    .result-tabs,
    html[data-theme="legacy"] .result-tabs {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        text-align: center !important;
    }

    .result-filter-wrap {
        margin: 0;
        width: 100%;
    }

    .result-filter-input {
        max-width: 100% !important;
        width: 100% !important;
        height: 30px !important;
    }

    .result-tabs nav,
    html[data-theme="legacy"] .result-tabs nav {
        display: flex !important;
        justify-content: center !important;
        gap: 16px !important;
    }

    html[data-theme="legacy"] .result-tabs a {
        margin-left: 0 !important;
    }

    .result-header,
    html[data-theme="legacy"] .result-header {
        flex-wrap: wrap;
        gap: 6px;
        height: auto !important;
        line-height: 1.4 !important;
        padding: 8px 10px !important;
    }

    html[data-theme="legacy"] .result-header strong {
        margin-left: 0;
    }

    .result-header > span {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .telegram-options {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: calc(100vw - 24px) !important;
        padding: 14px !important;
    }

    .telegram-chat-field,
    .telegram-message-field,
    .telegram-close {
        grid-column: 1 !important;
        grid-row: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        justify-self: stretch !important;
    }

    .footer-telemetry-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .telemetry-pill:last-child:nth-child(odd) {
        grid-column: span 2;
    }

    .telemetry-pill {
        justify-content: center;
        padding: 5px 6px;
    }
}



/* ==========================================================================
   Admin Panel Styles — Harmonized, Structured & Perfectly Aligned
   ========================================================================== */

.topbar-admin-btn {
    background: var(--surface-2, #1e293b);
    border: 1px solid var(--accent, #ffc500);
    border-radius: 6px;
    color: var(--accent, #ffc500);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 11px;
    text-decoration: none;
}

.admin-panel-page {
    margin: 4px auto 10px;
    max-width: 710px;
    text-align: left;
    width: 100%;
}

.admin-header {
    border-bottom: 1px solid var(--line, #4a4a4a);
    margin-bottom: 14px;
    padding-bottom: 10px;
    text-align: center;
}

.admin-header h2 {
    color: var(--accent, #ffc500);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin: 0 0 4px;
    width: 100% !important;
}

.admin-header p {
    color: var(--muted, #cccccc);
    font-size: 11px;
    margin: 0;
}

.admin-header p span {
    color: var(--accent-dark, #ff8700);
}

.admin-notice {
    margin-bottom: 14px !important;
    text-align: center;
}

.admin-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

.admin-section {
    background: var(--input-bg, #0a0a0a);
    border: 1px solid var(--line, #4a4a4a);
    border-radius: 6px;
    overflow: hidden;
}

.admin-section-title {
    background: var(--surface-2, #141414);
    border-bottom: 1px solid var(--line, #4a4a4a);
    color: var(--accent, #ffc500);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 8px 14px;
    text-align: left;
}

.admin-section-body {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.admin-row-2 {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-row-3 {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    margin: 0 !important;
    min-width: 0;
    text-align: left;
}

.admin-field .field-label {
    color: var(--muted, #cccccc);
    display: block;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-field .field-label small {
    color: #888888;
    font-size: 10px;
}

.admin-field code,
.admin-section-title code,
.admin-switch code {
    color: var(--accent-dark, #ff8700);
    font-family: Consolas, monospace;
    font-size: 10.5px;
}

.admin-field input[type="text"],
.admin-field input[type="url"],
.admin-field input[type="password"],
.admin-field input[type="number"],
.admin-field select {
    background: var(--panel, #050505) !important;
    border: 1px solid var(--line, #4a4a4a) !important;
    border-radius: 4px !important;
    color: var(--text, #ffffff) !important;
    font-size: 11.5px !important;
    height: 32px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 10px !important;
    width: 100% !important;
}

.admin-field textarea {
    background: var(--panel, #050505) !important;
    border: 1px solid var(--line, #4a4a4a) !important;
    border-radius: 4px !important;
    color: var(--text, #ffffff) !important;
    font-family: Consolas, "Courier New", monospace !important;
    font-size: 11.5px !important;
    height: auto !important;
    line-height: 1.45 !important;
    margin: 0 !important;
    min-height: 78px !important;
    padding: 8px 10px !important;
    resize: vertical !important;
    width: 100% !important;
}

.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus {
    border-color: var(--accent, #ffc500) !important;
    outline: none !important;
}

.admin-toggle-row {
    border-top: 1px dashed var(--line, #333333);
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 2px;
    padding-top: 10px;
}

.admin-switch {
    align-items: center !important;
    background: var(--surface-2, #121212);
    border: 1px solid var(--line, #3a3a3a);
    border-radius: 4px;
    color: var(--text, #ffffff) !important;
    cursor: pointer;
    display: flex !important;
    flex-direction: row !important;
    font-size: 11px !important;
    gap: 8px !important;
    margin: 0 !important;
    min-height: 32px;
    padding: 4px 10px;
}

.admin-switch input[type="checkbox"] {
    height: 14px !important;
    margin: 0 !important;
    width: 14px !important;
    flex-shrink: 0;
}

.admin-actions-bar {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 16px 0;
}

.admin-save-btn {
    align-items: center;
    background: var(--download-bg, #ea4d00);
    border: 1px solid var(--accent, #ffc500);
    border-radius: 5px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-size: 12px;
    font-weight: 500;
    height: 34px;
    justify-content: center;
    padding: 0 22px;
}

.admin-save-btn:hover {
    background: var(--download-hover, #ff6600);
}

.admin-back-btn {
    align-items: center;
    background: var(--surface-2, #181818);
    border: 1px solid var(--line, #4a4a4a);
    border-radius: 5px;
    color: var(--accent, #ffc500);
    display: inline-flex;
    font-size: 11.5px;
    height: 34px;
    justify-content: center;
    padding: 0 16px;
    text-decoration: none;
}

.admin-back-btn:hover {
    border-color: var(--accent, #ffc500);
}

.admin-maintenance-section {
    margin-top: 6px;
}

.admin-maint-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-maint-grid form {
    margin: 0;
    width: 100%;
}

.admin-action-btn {
    align-items: center;
    background: var(--surface-2, #161820);
    border: 1px solid var(--line, #4a4a4a);
    border-radius: 4px;
    color: var(--accent, #ffc500);
    cursor: pointer;
    display: inline-flex;
    font-size: 11px;
    font-weight: 400;
    height: 30px;
    justify-content: center;
    padding: 0 8px;
    width: 100%;
}

.admin-action-btn:hover {
    border-color: var(--accent, #ffc500);
    background: var(--panel, #1f2430);
}

.admin-action-btn.is-danger {
    color: var(--danger, #fa626b);
}

.admin-action-btn.is-danger:hover {
    border-color: var(--danger, #fa626b);
}

.admin-log-details {
    border-top: 1px solid var(--line, #333333);
    margin-top: 6px;
    padding-top: 10px;
    text-align: left;
}

.admin-log-details summary {
    color: var(--accent, #ffc500);
    cursor: pointer;
    font-size: 11px;
    text-align: center;
}

.admin-log-pre {
    background: var(--panel, #050505);
    border: 1px solid var(--line, #4a4a4a);
    border-radius: 4px;
    color: var(--muted, #cccccc);
    font-size: 10.5px;
    margin: 8px 0 0;
    max-height: 200px;
    overflow: auto;
    padding: 10px;
    white-space: pre-wrap;
}

@media (max-width: 720px) {
    .admin-row-3 {
        grid-template-columns: 1fr;
    }

    .admin-row-2,
    .admin-toggle-row {
        grid-template-columns: 1fr;
    }

    .admin-maint-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-maint-grid .span-full-mobile {
        grid-column: span 2;
    }
}

/* ==========================================================================
   Harmonized List File Section (Matches Admin Panel Theme)
   ========================================================================== */

.filelist-page {
    max-width: 710px !important;
    margin: 4px auto 10px !important;
    width: 100% !important;
}

.filelist-bar-title {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
}

.filelist-actions {
    align-items: center;
    display: flex;
    gap: 6px;
    margin: 0 !important;
}

.filelist-chip {
    align-items: center;
    background: var(--panel, #080808);
    border: 1px solid var(--line, #4a4a4a);
    border-radius: 4px;
    color: var(--muted, #cccccc);
    cursor: pointer;
    display: inline-flex;
    font-size: 10.5px;
    font-weight: 400;
    height: 24px;
    padding: 0 8px;
}

.filelist-chip:hover {
    border-color: var(--accent, #ffc500);
    color: var(--accent, #ffc500);
}

.filelist-scroll,
html[data-theme="legacy"] .filelist-scroll {
    margin: 0 !important;
    max-height: 440px;
    overflow: auto;
    width: 100% !important;
}

#table_filelist,
html[data-theme="legacy"] #table_filelist {
    background: var(--input-bg, #0a0a0a) !important;
    border: 0 !important;
    border-radius: 0 !important;
    border-collapse: collapse;
    color: var(--text, #ffffff) !important;
    min-width: 580px !important;
    width: 100% !important;
}

#table_filelist th,
#table_filelist td,
html[data-theme="legacy"] #table_filelist th,
html[data-theme="legacy"] #table_filelist td {
    border-bottom: 1px solid var(--line, #2a2a2a) !important;
    font-size: 11px;
    font-weight: 400;
    padding: 8px 10px !important;
    text-align: left;
    vertical-align: middle;
}

#table_filelist .flisttblhdr th,
html[data-theme="legacy"] #table_filelist .flisttblhdr th {
    background: var(--panel, #060606) !important;
    color: var(--muted, #cccccc) !important;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

#table_filelist .flistmouseoff,
html[data-theme="legacy"] #table_filelist .flistmouseoff {
    background: var(--input-bg, #0a0a0a) !important;
}

#table_filelist .flistmouseoff:hover,
html[data-theme="legacy"] #table_filelist .flistmouseoff:hover {
    background: var(--surface-2, #151515) !important;
}

#table_filelist .flisttblftr td,
html[data-theme="legacy"] #table_filelist .flisttblftr td {
    background: var(--surface-2, #141414) !important;
    border-bottom: 0 !important;
    color: var(--muted, #cccccc) !important;
    font-size: 11px;
}

#table_filelist .flisttblftr td span {
    color: var(--accent, #ffc500);
}

#table_filelist .filelist-name,
html[data-theme="legacy"] #table_filelist .filelist-name {
    color: var(--accent, #ffc500) !important;
    font-weight: 400 !important;
}

#table_filelist a.filelist-name:hover {
    color: var(--accent-dark, #ff8700) !important;
    text-decoration: underline;
}

#table_filelist .filelist-source,
#table_filelist .filelist-date,
html[data-theme="legacy"] #table_filelist .filelist-source,
html[data-theme="legacy"] #table_filelist .filelist-date {
    color: var(--muted, #aaaaaa) !important;
    font-size: 10.5px;
}

#table_filelist input[type="checkbox"] {
    cursor: pointer;
    height: 14px;
    margin: 0;
    width: 14px;
}
