    #gateway-task-status-panel {
        position: fixed;
        top: 150px;
        left: auto;
        right: 22px;
        bottom: auto;
        width: 250px;
        height: auto;
        min-width: 180px;
        min-height: 36px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        z-index: 99990;
        background: rgba(45, 38, 50, 0.78);
        border: 1px solid rgba(244, 114, 182, 0.28);
        border-radius: 14px;
        box-shadow: 0 10px 30px rgba(180, 50, 110, 0.18);
        overflow: visible;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        display: flex;
        flex-direction: column;
    }

    #gateway-task-status-panel.collapsed {
        width: 250px;
        min-height: 36px;
        height: 36px;
    }

    #gateway-task-status-panel.collapsed .gateway-task-status-content,
    #gateway-task-status-panel.collapsed .gateway-task-status-footer {
        display: none;
    }

    .gateway-task-status-header {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        height: 42px;
        padding: 0 12px 0 14px;
        cursor: move;
        user-select: none;
    }

    /* 내용 영역만 스크롤한다. header/footer는 flex:0 0 auto로 고정되고,
       이 영역만 flex:1 1 auto + overflow-y:auto로 남는 공간을 채우면서
       max-height를 넘는 내용은 내부 스크롤로 처리한다. */
    .gateway-task-status-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .gateway-task-status-footer {
        flex: 0 0 auto;
        padding: 8px 10px 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .gateway-task-status-title {
        display: flex;
        align-items: center;
        gap: 5px;
        min-width: 0;
        flex: 1;
        font-size: 12px;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.92);
        letter-spacing: 0;
        overflow: hidden;
    }

    .gateway-task-status-header-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .gateway-task-status-dot {
        flex: 0 0 auto;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.35);
    }

    .gateway-task-status-dot.connected {
        background: #6fd67a;
        box-shadow: 0 0 4px rgba(111, 214, 122, 0.7);
    }

    .gateway-task-status-dot.stopped {
        background: #ff8a7a;
        box-shadow: 0 0 4px rgba(255, 138, 122, 0.6);
    }

    .gateway-task-status-dot.checking {
        background: #f0c84b;
        box-shadow: 0 0 4px rgba(240, 200, 75, 0.6);
    }

    .gateway-task-status-toggle {
        border: 0;
        background: transparent;
        color: rgba(255, 255, 255, 0.72);
        font-size: 12px;
        line-height: 1;
        cursor: pointer;
        padding: 2px 3px;
        min-width: 20px;
        height: 22px;
    }

    .gateway-task-status-toggle:hover {
        background: rgba(255, 255, 255, 0.08);
        border-radius: 5px;
    }

    .gateway-task-status-content {
        padding: 0 10px 10px;
    }

    .gateway-task-status-gw-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .gateway-task-status-gw-action {
        margin-left: auto;
        padding: 5px 10px;
        font-size: 11px;
        border-radius: 7px;
        background: rgba(255,255,255,0.08);
        border: 1px solid rgba(255,255,255,0.18);
        color: rgba(255,255,255,0.9);
        cursor: pointer;
        white-space: nowrap;
    }

    
    .gateway-task-status-restart-btn {
        flex: 0 0 auto;
        width: 42px;
        padding: 3px 3px;
        font-size: 9px;
    }

    /* Gateway 상태 / DMM 로그인 공용 2줄 레이아웃.
       윗줄: dot + 라벨("Gateway 상태" / "DMM 로그인") + 액션 버튼(gw-row에서 처리)
       아랫줄: 상태값(연결됨/중지 중/확인 중/오류, 정상/확인 중/만료/오류) */
    .gateway-task-status-status-label {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
        font-size: 12px;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.88);
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .gateway-task-status-status-value {
        margin-top: 3px;
        font-size: 14px;
        font-weight: 800;
        color: rgba(255, 255, 255, 0.92);
    }

    .gateway-task-status-status-value.connected {
        color: #8be28f;
    }

    .gateway-task-status-status-value.stopped {
        color: #ff9a92;
    }

    .gateway-task-status-status-value.checking {
        color: #ffd86a;
    }

    .gateway-task-status-status-value.session-error {
        color: #ffab40;
    }

.gateway-task-status-gw-action:hover {
        background: rgba(255,255,255,0.16);
    }

    .gateway-task-status-log-view-btn {
        width: 100%;
        margin-left: 0;
        padding: 8px 10px;
        text-align: center;
    }

    /* 작업 로그 모달 — 기존 작업 상태 패널(#gateway-task-status-panel)과
       동일한 어두운 유리 느낌(dark glass) 스타일을 재사용한다. */
    .gateway-task-log-overlay {
        position: fixed;
        inset: 0;
        z-index: 99995;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 24px;
        background: rgba(10, 10, 14, 0.55);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    .gateway-task-log-overlay.show {
        display: flex;
    }

    .gateway-task-log-modal {
        width: min(480px, 92vw);
        max-height: min(640px, 86vh);
        display: flex;
        flex-direction: column;
        background: rgba(28, 30, 38, 0.94);
        border: 1px solid rgba(244, 114, 182, 0.35);
        border-radius: 12px;
        box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        overflow: hidden;
    }

    .gateway-task-log-modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 12px 14px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        flex: 0 0 auto;
    }

    .gateway-task-log-modal-title {
        font-size: 13px;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.92);
    }

    .gateway-task-log-close-btn {
        border: 0;
        background: transparent;
        color: rgba(255, 255, 255, 0.72);
        font-size: 14px;
        line-height: 1;
        cursor: pointer;
        padding: 4px 7px;
        border-radius: 5px;
    }

    .gateway-task-log-close-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .gateway-task-log-modal-body {
        padding: 10px 12px 14px;
        overflow-y: auto;
        flex: 1 1 auto;
    }

    .gateway-task-log-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .gateway-task-log-empty {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.55);
        text-align: center;
        padding: 26px 0;
    }

    .gateway-task-log-item {
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 8px;
        padding: 8px 10px;
    }

    .gateway-task-log-item-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 4px;
    }

    .gateway-task-log-item-name {
        font-size: 11px;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.9);
    }

    .gateway-task-log-item-badge {
        flex: 0 0 auto;
        font-size: 9px;
        font-weight: 700;
        padding: 2px 6px;
        border-radius: 5px;
        white-space: nowrap;
    }

    .gateway-task-log-item-badge.success {
        background: rgba(111, 214, 122, 0.18);
        color: #8be28f;
    }

    .gateway-task-log-item-badge.failed {
        background: rgba(255, 138, 122, 0.18);
        color: #ff9a92;
    }

    .gateway-task-log-item-time {
        font-size: 9px;
        color: rgba(255, 255, 255, 0.5);
    }

    .gateway-task-log-item-counts {
        font-size: 9px;
        color: rgba(255, 255, 255, 0.65);
        margin-top: 2px;
    }

    .gateway-task-log-item-message {
        font-size: 10px;
        color: rgba(255, 255, 255, 0.75);
        margin-top: 4px;
        line-height: 1.4;
        white-space: pre-line;
    }

    .gateway-task-status-job-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }

    .gateway-task-status-job-name {
        font-size: 10px;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.88);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .gateway-task-status-badge {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        min-height: 22px;
        padding: 3px 10px;
        border-radius: 999px;
        font-size: 11px;
        font-weight: 800;
        background: rgba(255, 193, 7, 0.14);
        color: #ffd86a;
    }

    .gateway-task-status-badge.running {
        background: rgba(33, 150, 243, 0.16);
        color: #7fc8ff;
    }

    .gateway-task-status-badge.success {
        background: rgba(76, 175, 80, 0.14);
        color: #8be28f;
    }

    .gateway-task-status-badge.failed {
        background: rgba(244, 67, 54, 0.14);
        color: #ff9a92;
    }

    .gateway-task-status-progress {
        height: 5px;
        margin-top: 7px;
        overflow: hidden;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.08);
    }

    .gateway-task-status-progress-bar {
        width: 0;
        height: 100%;
        border-radius: inherit;
        background: #f0c84b;
        transition: width 0.25s ease;
    }

    .gateway-task-status-progress-text {
        margin-top: 3px;
        font-size: 9px;
        line-height: 1.3;
        color: rgba(255, 255, 255, 0.6);
    }

    .gateway-task-status-progress-text:empty {
        display: none;
    }

    .gateway-task-status-current {
        margin-top: 5px;
        font-size: 9px;
        line-height: 1.35;
        color: rgba(255, 255, 255, 0.62);
        word-break: keep-all;
    }

    .gateway-task-status-current:empty {
        display: none;
    }

    .gateway-task-status-counts {
        margin-top: 3px;
        font-size: 9px;
        line-height: 1.35;
        color: rgba(255, 255, 255, 0.62);
        word-break: keep-all;
    }

    .gateway-task-status-counts:empty {
        display: none;
    }

    .gateway-task-status-time {
        margin-top: 3px;
        font-size: 9px;
        line-height: 1.35;
        color: rgba(255, 255, 255, 0.5);
        word-break: keep-all;
    }

    .gateway-task-status-time:empty {
        display: none;
    }

    .gateway-task-status-message {
        margin-top: 6px;
        font-size: 10px;
        line-height: 1.35;
        color: rgba(255, 255, 255, 0.84);
        word-break: keep-all;
    }

    .gateway-task-status-message:empty {
        display: none;
    }

    .gateway-task-status-section {
        margin-top: 10px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .gateway-task-status-section:first-child {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

    .gateway-task-status-section-title {
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0;
        color: rgba(255, 255, 255, 0.55);
        margin-bottom: 6px;
    }

    .gateway-task-status-queue-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        font-size: 10px;
        line-height: 1.6;
        color: rgba(255, 255, 255, 0.72);
    }

    .gateway-task-status-queue-row + .gateway-task-status-queue-row {
        margin-top: 2px;
    }

    .gateway-task-status-telegram-row {
        display: flex;
        align-items: center;
        gap: 5px;
        margin-bottom: 5px;
    }

    .gateway-task-status-telegram-recent,
    .gateway-task-status-telegram-next {
        margin-top: 4px;
        font-size: 9px;
        line-height: 1.4;
        color: rgba(255, 255, 255, 0.58);
        word-break: keep-all;
    }

    .gateway-task-status-telegram-recent:empty,
    .gateway-task-status-telegram-next:empty {
        display: none;
    }

    .gateway-task-status-recent-log {
        display: flex;
        flex-direction: column;
        gap: 4px;
        max-height: 120px;
        overflow-y: auto;
    }

    .gateway-task-status-recent-log-row {
        display: flex;
        align-items: baseline;
        gap: 6px;
        font-size: 9px;
        line-height: 1.5;
        color: rgba(255, 255, 255, 0.68);
    }

    .gateway-task-status-recent-log-time {
        flex: 0 0 auto;
        color: rgba(255, 255, 255, 0.42);
        font-variant-numeric: tabular-nums;
    }

    .gateway-task-status-recent-log-label {
        flex: 0 0 auto;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.85);
    }

    .gateway-task-status-recent-log-detail {
        flex: 1 1 auto;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: rgba(255, 255, 255, 0.6);
    }

    .gateway-task-status-recent-log-empty {
        font-size: 9px;
        color: rgba(255, 255, 255, 0.5);
    }

    /* 8방향 크기 조절 핸들 */
    .gateway-task-status-resize-handle {
        position: absolute;
        z-index: 2;
    }

    .gateway-task-status-resize-handle-n,
    .gateway-task-status-resize-handle-s {
        left: 8px;
        right: 8px;
        height: 7px;
        cursor: ns-resize;
    }

    .gateway-task-status-resize-handle-n { top: -3px; }
    .gateway-task-status-resize-handle-s { bottom: -3px; }

    .gateway-task-status-resize-handle-e,
    .gateway-task-status-resize-handle-w {
        top: 8px;
        bottom: 8px;
        width: 7px;
        cursor: ew-resize;
    }

    .gateway-task-status-resize-handle-e { right: -3px; }
    .gateway-task-status-resize-handle-w { left: -3px; }

    .gateway-task-status-resize-handle-ne,
    .gateway-task-status-resize-handle-nw,
    .gateway-task-status-resize-handle-se,
    .gateway-task-status-resize-handle-sw {
        width: 10px;
        height: 10px;
    }

    .gateway-task-status-resize-handle-ne { top: -4px; right: -4px; cursor: nesw-resize; }
    .gateway-task-status-resize-handle-nw { top: -4px; left: -4px; cursor: nwse-resize; }
    .gateway-task-status-resize-handle-se { bottom: -4px; right: -4px; cursor: nwse-resize; }
    .gateway-task-status-resize-handle-sw { bottom: -4px; left: -4px; cursor: nesw-resize; }

    @media (max-width: 600px) {
        #gateway-task-status-panel {
            width: 220px;
            right: 12px;
            top: 110px;
        }

        #gateway-task-status-panel.collapsed {
            width: 220px;
        }
    }


    .dmm-uncovered-badge {
        display: inline-flex;
        align-items: center;
        margin-left: 5px;
        padding: 2px 8px;
        border-radius: 999px;
        background: rgba(244, 114, 182, 0.18);
        color: #ff9ac5;
        font-size: 11px;
        font-weight: 800;
    }


    .gateway-task-status-telegram-queue > div {
        display: grid;
        grid-template-columns: 24px 1fr auto;
        align-items: center;
        gap: 6px;
        line-height: 1.8;
    }


    .gateway-task-status-telegram-queue strong {
        font-size: 11px;
        font-weight: 800;
        color: #ffb3d3;
    }


    .gateway-task-status-telegram-queue > div {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        line-height: 1.8;
    }

    .telegram-count-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: 4px;
        padding: 1px 5px;
        min-width: 24px;
        height: 18px;
        border-radius: 999px;
        background: rgba(244, 114, 182, 0.18);
        color: #ff9ac5;
        font-size: 10px;
        font-weight: 800;
    }

    .gateway-task-status-dmm-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        font-size: 10px;
        line-height: 1.5;
        color: rgba(255, 255, 255, 0.75);
        white-space: nowrap;
    }

    .gateway-task-status-dmm-row button {
        font-size: 10px;
        padding: 4px 8px;
    }

    /* DMM 로그인 세션 상태 행. dot/상태값은 Gateway 상태와 동일한
       공용 클래스(.gateway-task-status-status-label / -status-value,
       connected/stopped/checking)를 그대로 재사용한다. "error"(네트워크
       오류 등 접속 자체 실패)만 "만료"와 시각적으로 구분되도록 별도
       색상(주황)을 추가한다 - 세션이 실제로 만료됐는지 알 수 없는
       상태이므로 만료(빨강)와 혼동되면 안 된다. */

    .gateway-task-status-dot.session-error {
        background: #ffab40;
        box-shadow: 0 0 4px rgba(255, 171, 64, 0.65);
    }

    .gateway-task-status-gw-action:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

    .gateway-task-status-gw-action:disabled:hover {
        background: rgba(255, 255, 255, 0.08);
    }


