:root{
    --bg: #f8fafc;
    --bg2: #f1f5f9;
    --card: rgba(255,255,255,0.94);
    --card-border: rgba(226,232,240,0.95);

    --text: #0f172a;
    --muted: #64748b;

    --line: #e2e8f0;
    --line-strong: #cbd5e1;

    --brand-orange: #f97316;

    --primary: #c45a1c;
    --primary-hover: #9f4615;
    --primary-soft: rgba(196, 90, 28, 0.10);

    --danger: #dc2626;
    --danger-soft: rgba(220,38,38,0.08);
    --success: #059669;

    --shadow: 0 24px 60px rgba(15, 23, 42, 0.10);

    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 16px;

    --soft-shadow: 0 8px 22px rgba(15, 23, 42, .045);
    --header-gradient:
        radial-gradient(circle at top right, rgba(249, 115, 22, .28), transparent 34%),
        linear-gradient(135deg, #1e293b 0%, #334155 52%, #0f172a 100%);
}

/* 모션 민감도 배려 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===========================Base
   =========================== */
* {
    box-sizing: border-box;
}
body,
html {
    height: 100%;
    overscroll-behavior-y: none;   /* 또는 contain */
}
body {
    margin: 0;
    background: var(--bg-gradient, var(--bg));
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Apple SD Gothic Neo, Noto Sans KR, "맑은 고딕", sans-serif;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
}

body.main-page {
    overflow: hidden;
}

/* ==============================
   상단 헤더
============================== */

.sk-topbar {
    flex: 0 0 auto;
    width: 100%;
    height: 72px;
    margin: 0;
    padding: 0 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    box-sizing: border-box;

    background: rgba(248, 250, 252, 0.88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
    z-index: 40;
}

.sk-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sk-brand-text {
    min-width: 0;
}

.sk-brand-title {
    margin: 0;
    font-size: 22px;
    font-weight: 950;
    letter-spacing: -0.045em;
    color: var(--text);
}

.sk-brand-sub {
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
    font-weight: 800;
}

.sk-top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex: 0 0 auto;
}

.sk-top-actions .sk-msg-float,
.sk-top-actions .kds-support-float {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    z-index: auto;
    flex: 0 0 auto;
    margin: 0;
    transform: none !important;
}

.sk-comm-switcher {
    position: absolute;
    top: 9px;
    left: calc(50% + 285px);
    z-index: 97000;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: move;
    user-select: none;
    touch-action: none;
}

.sk-comm-switcher-support {
    left: calc(50% + 345px);
}

.sk-comm-switcher:empty {
    display: none;
}

.sk-comm-switcher .sk-msg-float,
.sk-comm-switcher .kds-support-float {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    z-index: auto;
    flex: 0 0 auto;
    margin: 0;
    transform: none !important;
    cursor: move;
}

.sk-user-chip {
    height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .88);
    border: 1px solid var(--card-border);
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    box-shadow: var(--soft-shadow);
    box-sizing: border-box;
}

button.sk-user-chip {
    font-family: inherit;
    cursor: pointer;
}

.sk-user-chip:focus-visible {
    outline: 2px solid rgba(249, 115, 22, .45);
    outline-offset: 2px;
}

.sk-user-chip ion-icon {
    color: var(--primary);
    font-size: 17px;
}

.sk-btn {
    height: 40px;
    border: 0;
    border-radius: 999px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: .16s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.sk-btn-soft {
    background: rgba(255, 255, 255, .88);
    color: var(--text);
    border: 1px solid var(--card-border);
    box-shadow: var(--soft-shadow);
}

.sk-btn-soft:hover {
    border-color: rgba(196, 90, 28, 0.35);
    color: var(--primary);
    transform: translateY(-1px);
}

.sk-btn-soft ion-icon {
    font-size: 17px;
}

/* ==============================
   모바일 메뉴 버튼
============================== */

.sk-mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--soft-shadow);
    flex: 0 0 auto;
}

.sk-mobile-menu-btn ion-icon {
    font-size: 22px;
}

@media (max-width: 1500px) {
    .sk-main-wrap {
        padding: 26px 30px 34px;
    }

    .sk-hero {
        grid-template-columns: minmax(0, 1.55fr) minmax(310px, .95fr);
    }
}

@media (max-width: 1280px) {
    .sk-topbar {
        padding: 0 26px;
    }
}

@media (max-width: 1024px) {
    .sk-topbar {
        height: 64px;
        padding: 0 18px;
    }
    
    .sk-mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sk-mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .sk-topbar {
        height: auto;
        min-height: 68px;
        padding: 12px 14px;
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .sk-top-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr auto;
    }

    .sk-top-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr auto;
    }

    .sk-user-chip {
        justify-content: center;
        min-width: 0;
    }
}

@media (max-width: 420px) {
    .sk-brand-title {
        font-size: 20px;
    }

    .sk-top-actions {
        grid-template-columns: 1fr;
    }

    .sk-btn,
    .sk-user-chip {
        width: 100%;
        box-sizing: border-box;
    }
}

/* ===========================
   common_confirm.css
   공용 커스텀 Confirm
   =========================== */

.custom-confirm-lock {
    overflow: hidden !important;
    touch-action: none;
}

.custom-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(8px);
}

.custom-confirm-backdrop.is-open {
    display: flex;
    animation: customConfirmFadeIn .16s ease both;
}

.custom-confirm-box {
    width: min(430px, 100%);
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
    overflow: hidden;
    position: relative;
    transform: translateY(8px) scale(.98);
    animation: customConfirmPop .18s ease both;
}

.custom-confirm-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px 22px 14px;
}

.custom-confirm-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft, rgba(196, 90, 28, .10));
    color: var(--primary, #c45a1c);
    font-size: 24px;
}

.custom-confirm-icon.danger {
    background: var(--danger-soft, rgba(220, 38, 38, .08));
    color: var(--danger, #dc2626);
}

.custom-confirm-icon.success {
    background: rgba(5, 150, 105, .10);
    color: var(--success, #059669);
}

.custom-confirm-icon.warning {
    background: rgba(249, 115, 22, .12);
    color: var(--brand-orange, #f97316);
}

.custom-confirm-title-wrap {
    min-width: 0;
    flex: 1;
}

.custom-confirm-title {
    margin: 0;
    color: var(--text, #0f172a);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -.03em;
    line-height: 1.3;
}

.custom-confirm-message {
    margin: 8px 0 0;
    color: var(--muted, #64748b);
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-line;
}

.custom-confirm-sub {
    margin: 12px 22px 0;
    padding: 13px 14px;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 16px;
    background: #f8fafc;
    color: var(--muted, #64748b);
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-line;
}

.custom-confirm-sub.danger {
    border-color: rgba(220, 38, 38, .18);
    background: rgba(220, 38, 38, .06);
    color: #991b1b;
}

.custom-confirm-character {
    position: absolute;
    right: 28px;
    bottom: 74px;
    width: 88px;
    pointer-events: none;
    filter: drop-shadow(0 14px 24px rgba(15, 23, 42, .16));
}

.custom-confirm-character img {
    display: block;
    width: 100%;
    height: auto;
}

.custom-confirm-box.has-character .custom-confirm-title-wrap {
    padding-right: 100px;
}

.custom-confirm-box.has-character .custom-confirm-sub {
    margin-right: 120px;
}

.custom-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 20px 22px 22px;
}

.custom-confirm-btn {
    height: 42px;
    min-width: 88px;
    border: 0;
    outline: 0;
    border-radius: 14px;
    padding: 0 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 900;
    transition: .16s ease;
    white-space: nowrap;
}

.custom-confirm-btn.cancel {
    background: #fff;
    color: var(--text, #0f172a);
    border: 1px solid var(--line, #e2e8f0);
}

.custom-confirm-btn.cancel:hover {
    background: #f8fafc;
    border-color: var(--line-strong, #cbd5e1);
}

.custom-confirm-btn.confirm {
    background: var(--primary, #c45a1c);
    color: #fff;
    box-shadow: 0 12px 26px rgba(196, 90, 28, .22);
}

.custom-confirm-btn.confirm:hover {
    background: var(--primary-hover, #9f4615);
    transform: translateY(-1px);
}

.custom-confirm-btn.confirm.danger {
    background: var(--danger, #dc2626);
    box-shadow: 0 12px 26px rgba(220, 38, 38, .22);
}

.custom-confirm-btn.confirm.danger:hover {
    background: #b91c1c;
}

.custom-confirm-btn.confirm.success {
    background: var(--success, #059669);
    box-shadow: 0 12px 26px rgba(5, 150, 105, .22);
}

.custom-confirm-btn.confirm.success:hover {
    background: #047857;
}

@keyframes customConfirmFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes customConfirmPop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 520px) {
    .custom-confirm-backdrop {
        align-items: flex-end;
        padding: 12px;
    }

    .custom-confirm-box {
        border-radius: 22px;
    }

    .custom-confirm-character {
        position: static;
        width: 92px;
        margin: 0 18px -6px auto;
    }

    .custom-confirm-box.has-character .custom-confirm-title-wrap,
    .custom-confirm-box.has-character .custom-confirm-sub {
        padding-right: 0;
        margin-right: 18px;
    }

    .custom-confirm-head {
        padding: 20px 18px 12px;
    }

    .custom-confirm-sub {
        margin: 10px 18px 0;
    }

    .custom-confirm-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 18px;
    }

    .custom-confirm-btn {
        width: 100%;
    }
}

/* ===========================
   Common Custom Alert
   header.html 공용
   =========================== */

.custom-alert-lock {
    overflow: hidden !important;
    touch-action: none;
}

.custom-alert-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(8px);
}

.custom-alert-backdrop.is-open {
    display: flex;
    animation: customAlertFadeIn .16s ease both;
}

.custom-alert-box {
    position: relative;
    width: min(430px, 100%);
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
    overflow: hidden;
    animation: customAlertPop .18s ease both;
}

.custom-alert-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px 22px 14px;
}

.custom-alert-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft, rgba(196, 90, 28, .10));
    color: var(--primary, #c45a1c);
    font-size: 24px;
}

.custom-alert-icon.success {
    background: rgba(5, 150, 105, .10);
    color: var(--success, #059669);
}

.custom-alert-icon.danger {
    background: var(--danger-soft, rgba(220, 38, 38, .08));
    color: var(--danger, #dc2626);
}

.custom-alert-icon.warning {
    background: rgba(249, 115, 22, .12);
    color: var(--brand-orange, #f97316);
}

.custom-alert-icon.info {
    background: rgba(37, 99, 235, .10);
    color: #2563eb;
}

.custom-alert-content {
    min-width: 0;
    flex: 1;
}

.custom-alert-title {
    margin: 0;
    color: var(--text, #0f172a);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -.03em;
    line-height: 1.3;
}

.custom-alert-message {
    margin: 8px 0 0;
    color: var(--muted, #64748b);
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-line;
    word-break: keep-all;
}

.custom-alert-sub {
    margin: 12px 22px 0;
    padding: 13px 14px;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 16px;
    background: #f8fafc;
    color: var(--muted, #64748b);
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-line;
}

.custom-alert-sub.danger {
    border-color: rgba(220, 38, 38, .18);
    background: rgba(220, 38, 38, .06);
    color: #991b1b;
}

.custom-alert-actions {
    display: flex;
    justify-content: flex-end;
    padding: 20px 22px 22px;
}

/* ===========================
   SK Messenger
   =========================== */

.sk-msg-float {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 95000;
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 18px;
    background: #0f172a;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .24);
    cursor: pointer;
    user-select: none;
    touch-action: none;
}

.sk-msg-float ion-icon {
    font-size: 25px;
}

.sk-msg-badge {
    position: absolute;
    right: -6px;
    top: -6px;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    border: 2px solid #fff;
}

.sk-msg-badge.is-show {
    display: inline-flex;
}

.sk-msg-panel,
.sk-msg-chat {
    position: fixed;
    background: #fff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
    overflow: hidden;
    display: none;
}

.sk-msg-panel {
    z-index: 95010;
}

.sk-msg-chat {
    z-index: 95020;
}

.sk-msg-resize {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
}

.sk-msg-resize::before {
    content: none;
}

.sk-window-resize-handle,
.kds-window-resize-handle {
    position: absolute;
    z-index: 2;
    background: transparent;
    pointer-events: auto;
}

.sk-window-resize-handle[data-resize-dir="n"],
.kds-window-resize-handle[data-resize-dir="n"] {
    left: 16px;
    right: 16px;
    top: 0;
    height: 8px;
    cursor: ns-resize;
}

.sk-window-resize-handle[data-resize-dir="s"],
.kds-window-resize-handle[data-resize-dir="s"] {
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 8px;
    cursor: ns-resize;
}

.sk-window-resize-handle[data-resize-dir="e"],
.kds-window-resize-handle[data-resize-dir="e"] {
    top: 16px;
    right: 0;
    bottom: 16px;
    width: 8px;
    cursor: ew-resize;
}

.sk-window-resize-handle[data-resize-dir="w"],
.kds-window-resize-handle[data-resize-dir="w"] {
    top: 16px;
    left: 0;
    bottom: 16px;
    width: 8px;
    cursor: ew-resize;
}

.sk-window-resize-handle[data-resize-dir="nw"],
.kds-window-resize-handle[data-resize-dir="nw"] {
    left: 0;
    top: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
}

.sk-window-resize-handle[data-resize-dir="ne"],
.kds-window-resize-handle[data-resize-dir="ne"] {
    right: 0;
    top: 0;
    width: 16px;
    height: 16px;
    cursor: nesw-resize;
}

.sk-window-resize-handle[data-resize-dir="sw"],
.kds-window-resize-handle[data-resize-dir="sw"] {
    left: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: nesw-resize;
}

.sk-window-resize-handle[data-resize-dir="se"],
.kds-window-resize-handle[data-resize-dir="se"] {
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
}

.sk-msg-panel.is-open,
.sk-msg-chat.is-open {
    display: flex;
    flex-direction: column;
}

.sk-msg-panel {
    right: 22px;
    bottom: 86px;
    width: 390px;
    height: 520px;
    border-radius: 14px;
}

.sk-msg-chat {
    right: 430px;
    bottom: 86px;
    width: 470px;
    height: 560px;
    border-radius: 14px;
}

.sk-msg-titlebar,
.sk-msg-chat-head {
    min-height: 50px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: linear-gradient(180deg, #e0f2fe 0%, #bfdbfe 100%);
    border-bottom: 1px solid #93c5fd;
    color: #0f172a;
}

.sk-msg-titlebar strong,
.sk-msg-chat-head strong {
    display: block;
    font-size: 15px;
    font-weight: 900;
}

.sk-msg-titlebar span,
.sk-msg-chat-head span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #475569;
}

.sk-msg-titlebar button,
.sk-msg-chat-head button {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
    color: #0f172a;
    cursor: pointer;
}

.sk-msg-profile {
    display: grid;
    grid-template-columns: 82px 84px 1fr;
    gap: 7px;
    align-items: center;
    padding: 10px 12px;
    background: #fef9c3;
    border-bottom: 1px solid #e2e8f0;
}

.sk-msg-profile strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.sk-msg-profile select,
.sk-msg-profile input,
.sk-msg-search input,
.sk-msg-chat-search input {
    height: 32px;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    padding: 0 9px;
    background: #fff;
    font-size: 13px;
}

.sk-msg-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
}

.sk-msg-search ion-icon {
    color: #64748b;
}

.sk-msg-search input {
    width: 100%;
}

.sk-msg-user-list {
    flex: 1;
    overflow: auto;
    background: #fff;
}

.sk-msg-user {
    width: 100%;
    min-height: 38px;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    display: grid;
    grid-template-columns: 14px 82px 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    text-align: left;
    cursor: pointer;
    color: #0f172a;
}

.sk-msg-user:hover,
.sk-msg-user.is-active {
    background: #fff7ed;
}

.sk-msg-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #94a3b8;
}

.sk-msg-dot.is-online {
    background: #10b981;
}

.sk-msg-dot.is-away {
    background: #f97316;
}

.sk-msg-dot.is-offline {
    background: #ef4444;
}

.sk-msg-name,
.sk-msg-online,
.sk-msg-state {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
}

.sk-msg-name {
    font-weight: 800;
}

.sk-msg-online {
    justify-self: start;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.sk-msg-state {
    color: #475569;
}

.sk-msg-user em {
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}

.sk-msg-chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px;
    background: #ecfdf5;
    border-bottom: 1px solid #cbd5e1;
}

.sk-msg-chat-toolbar button {
    height: 30px;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.sk-msg-chat-search {
    display: flex;
    gap: 4px;
}

.sk-msg-chat-search input {
    width: 140px;
    height: 30px;
}

.sk-msg-chat-body {
    flex: 1;
    overflow: auto;
    padding: 8px 10px;
    background: #fff;
}

.sk-msg-line {
    display: flex;
    align-items: flex-start;
    margin-bottom: 5px;
    min-height: 0;
}

.sk-msg-line.is-mine {
    justify-content: flex-end;
}

.sk-msg-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 70%;
    min-height: 0;
}

.sk-msg-line.is-mine .sk-msg-stack {
    align-items: flex-end;
}

.sk-msg-bubble {
    display: inline-block;
    width: auto !important;
    height: auto !important;
    min-width: 0;
    min-height: 0 !important;
    max-height: none;
    max-width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px 8px !important;
    background: #f8fafc;
    color: #0f172a;
    font-size: 12px;
    line-height: 1.25 !important;
    white-space: normal;
}

.sk-msg-text {
    white-space: pre-wrap;
}

.sk-msg-line.is-mine .sk-msg-bubble {
    border-color: #fed7aa;
    background: #fff7ed;
}

.sk-msg-time {
    display: block;
    margin-top: 1px;
    color: #94a3b8;
    font-size: 10px;
    line-height: 1;
    text-align: right;
}

.sk-msg-chat-input {
    display: grid;
    grid-template-columns: 34px 1fr 56px;
    align-items: stretch;
    gap: 6px;
    padding: 6px;
    border-top: 1px solid #cbd5e1;
    background: #fff7ed;
}

.sk-msg-chat-input .sk-msg-attach-btn {
    grid-column: 1;
    grid-row: 2;
    width: 34px;
    min-height: 34px;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sk-msg-chat-input .sk-msg-attach-btn ion-icon {
    display: block;
    width: 20px;
    min-width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: currentColor;
    font-size: 20px;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
}

.sk-msg-pending-files {
    display: none;
    grid-column: 1 / -1;
    grid-row: 1;
    flex-wrap: wrap;
    gap: 4px;
}

.sk-msg-pending-files.is-show {
    display: flex;
}

.sk-msg-pending-file {
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border: 1px solid #fdba74;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 11px;
    font-weight: 800;
}

.sk-msg-pending-file button {
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 50%;
    background: #fed7aa;
    color: #9a3412;
    line-height: 16px;
    cursor: pointer;
}

.sk-msg-chat-input textarea {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    height: 34px;
    min-height: 34px;
    max-height: 120px;
    resize: none;
    overflow-y: auto;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    padding: 7px 8px;
    font-size: 12px;
    line-height: 18px;
}

.sk-msg-chat-input > button:not(.sk-msg-attach-btn) {
    grid-column: 3;
    grid-row: 2;
    border: 1px solid #0284c7;
    border-radius: 6px;
    background: #e0f2fe;
    color: #0f172a;
    font-weight: 900;
    cursor: pointer;
}

.sk-msg-chat.is-dragging .sk-msg-chat-body {
    outline: 2px dashed #f97316;
    outline-offset: -8px;
    background: #fff7ed;
}

.sk-msg-text {
    white-space: pre-wrap;
}

.sk-msg-attachments {
    display: grid;
    gap: 5px;
    margin-top: 6px;
}

.sk-msg-image-attach {
    max-width: 180px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    text-align: left;
}

.sk-msg-image-attach img {
    display: block;
    max-width: 170px;
    max-height: 110px;
    border-radius: 6px;
    object-fit: cover;
}

.sk-msg-image-attach span {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.sk-msg-file-attach {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 220px;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.sk-msg-file-attach span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sk-msg-file-attach em {
    color: #64748b;
    font-style: normal;
    font-weight: 700;
}

.sk-msg-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 96000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(15, 23, 42, .58);
}

.sk-msg-image-viewer.is-open {
    display: flex;
}

.sk-msg-image-box {
    position: relative;
    max-width: min(900px, 92vw);
    max-height: 86vh;
    padding: 14px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .34);
}

.sk-msg-image-box img {
    display: block;
    max-width: 100%;
    max-height: calc(86vh - 76px);
    border-radius: 8px;
    object-fit: contain;
}

.sk-msg-image-close {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 30px;
    height: 30px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.sk-msg-image-box a {
    display: inline-flex;
    margin-top: 10px;
    padding: 7px 12px;
    border-radius: 8px;
    background: #f97316;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.sk-msg-empty {
    padding: 22px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

/* ===========================
   KDS Support Widget
   =========================== */

.kds-support-float {
    position: fixed;
    right: 88px;
    bottom: 22px;
    z-index: 95000;
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 18px;
    background: #f97316;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 40px rgba(249, 115, 22, .24);
    cursor: pointer;
    user-select: none;
    touch-action: none;
}

.kds-support-float ion-icon {
    font-size: 25px;
}

.kds-support-badge {
    position: absolute;
    right: -6px;
    top: -6px;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    border: 2px solid #fff;
}

.kds-support-badge.is-show {
    display: inline-flex;
}

.kds-support-panel {
    position: fixed;
    right: 22px;
    bottom: 86px;
    z-index: 95030;
    width: 360px;
    height: 460px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #b7cede;
    box-shadow: 0 20px 52px rgba(15, 23, 42, .22);
}

.kds-support-panel.is-open {
    display: flex;
}

.kds-support-helper {
    position: fixed;
    z-index: 95031;
    display: none;
    align-items: flex-start;
    gap: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.kds-support-helper.is-visible {
    display: flex;
}

.kds-support-helper img {
    width: 87px;
    height: auto;
    filter: drop-shadow(0 8px 14px rgba(15, 23, 42, .20));
}

.kds-support-helper-bubble {
    position: relative;
    width: 148px;
    min-height: 34px;
    margin-top: 4px;
    padding: 6px 8px;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
    text-align: left;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .15);
    word-break: keep-all;
}

.kds-support-helper-bubble::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 15px;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
}

.kds-support-resize {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
}

.kds-support-resize::before {
    content: none;
}

.kds-support-head {
    min-height: 46px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #c9e3f6;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    color: #0f172a;
}

.kds-support-head strong,
.kds-support-head span {
    display: block;
}

.kds-support-head strong {
    font-size: 14px;
    font-weight: 900;
}

.kds-support-head span {
    margin-top: 1px;
    color: #475569;
    font-size: 12px;
}

.kds-support-head button {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .76);
    cursor: pointer;
}

.kds-support-quick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 5px 8px;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    background: #eef6fb;
}

.kds-support-guide {
    grid-column: 1 / -1;
    color: #475569;
    font-size: 11px;
    line-height: 1.25;
}

.kds-support-quick button,
.kds-support-conversations button {
    border: 1px solid #d7e3ee;
    border-radius: 7px;
    background: #fff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.kds-support-quick button {
    min-height: 26px;
}

.kds-support-staff {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 132px 1fr;
}

.kds-support-conversations {
    overflow: auto;
    border-right: 1px solid #e2e8f0;
    background: #f8fafc;
}

.kds-support-conversations button {
    width: 100%;
    display: block;
    border-width: 0 0 1px;
    border-radius: 0;
    padding: 9px;
    text-align: left;
}

.kds-support-conversations button.is-active {
    background: #fff7ed;
}

.kds-support-conversations button.is-ended {
    opacity: .68;
}

.kds-support-conversations button.has-unread strong::after {
    content: "●";
    display: inline-block;
    margin-left: 5px;
    color: #ef4444;
    font-size: 9px;
    vertical-align: 1px;
}

.kds-support-conversations strong,
.kds-support-conversations span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kds-support-conversations span {
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
}

.kds-support-conversation-sub {
    display: flex !important;
    align-items: center;
    gap: 6px;
}

.kds-support-conversation-sub em {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-style: normal;
}

.kds-support-room-state {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    color: #475569;
    font-size: 10px;
    font-weight: 900;
}

.kds-support-room-state i {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, .12);
}

.kds-support-room-state.is-busy i {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, .14);
}

.kds-support-chat {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 6px 9px 4px;
    background: #b7cede;
}

.kds-support-line {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin: 3px 0;
    min-height: 0;
}

.kds-support-line.is-mine {
    justify-content: flex-end;
}

.kds-support-avatar {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, .65);
    box-shadow: 0 2px 7px rgba(15, 23, 42, .12);
}

.kds-support-bubble {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-width: 70%;
    padding: 5px 7px;
    border-radius: 5px;
    background: #fff;
    color: #0f172a;
    font-size: 12px;
    line-height: calc(1em + 5px);
    white-space: normal;
    box-shadow: 0 1px 1px rgba(15, 23, 42, .05);
    align-self: flex-start;
}

.kds-support-line.is-mine .kds-support-bubble {
    background: #ffe34d;
    border-top-right-radius: 2px;
    padding: 5px 7px;
    max-width: 70%;
}

.kds-support-line.is-other .kds-support-bubble {
    max-width: calc(100% - 30px);
}

.kds-support-bubble > div {
    margin: 0;
    min-height: 0;
    line-height: calc(1em + 5px);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.kds-support-bubble strong {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    color: #26384b;
}

.kds-support-image-link {
    display: block;
    margin-top: 6px;
}

.kds-support-image-link img {
    display: block;
    max-width: 160px;
    max-height: 110px;
    border-radius: 6px;
    object-fit: cover;
}

.kds-support-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
}

.kds-support-bubble > div + .kds-support-action-links {
    margin-top: 10px !important;
}

.kds-support-links a,
.kds-support-links button {
    appearance: none;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 0;
    padding: 4px 10px;
    border: 1px solid #fdba74;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 11px;
    line-height: 1;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    vertical-align: middle;
}

.kds-support-links a span,
.kds-support-links button span {
    display: block;
    transform: translateY(-1px);
}

.kds-support-result-toggle {
    border-style: dashed !important;
}

.kds-support-input {
    display: grid;
    grid-template-columns: auto 1fr 56px;
    gap: 6px;
    padding: 6px;
    border-top: 1px solid rgba(15, 23, 42, .10);
    background: #fff;
}

.kds-support-widget:not([data-is-staff="1"]) .kds-support-input {
    grid-template-columns: 1fr 56px;
}

.kds-support-end-btn {
    min-width: 68px;
    border: 1px solid #fecaca !important;
    border-radius: 7px;
    background: #fff1f2 !important;
    color: #dc2626 !important;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.kds-support-input textarea {
    resize: none;
    height: 34px;
    min-height: 34px;
    max-height: 72px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 7px 8px;
    font-size: 12px;
    line-height: 18px;
}

.kds-support-input textarea:disabled {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

.kds-support-input button {
    border: 0;
    border-radius: 7px;
    background: #f97316;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.kds-support-input button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.sk-msg-chat-input textarea:placeholder-shown,
.kds-support-input textarea:placeholder-shown {
    text-align: center;
}

.sk-msg-chat-input textarea:focus,
.kds-support-input textarea:focus {
    text-align: left;
}

.kds-support-empty {
    padding: 18px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

@media (max-width: 980px) {
    .sk-msg-panel,
    .sk-msg-chat,
    .kds-support-panel {
        right: 12px;
        left: 12px;
        bottom: 78px;
        width: auto;
        height: min(560px, calc(100vh - 98px));
    }

    .sk-msg-chat {
        z-index: 95020;
    }

    .sk-msg-profile {
        grid-template-columns: 1fr;
    }
}

.custom-alert-character {
    position: absolute;
    right: 28px;
    bottom: 72px;
    width: 88px;
    pointer-events: none;
    filter: drop-shadow(0 14px 24px rgba(15, 23, 42, .16));
}

.custom-alert-character img {
    display: block;
    width: 100%;
    height: auto;
}

.custom-alert-box.has-character .custom-alert-content {
    padding-right: 100px;
}

.custom-alert-box.has-character .custom-alert-sub {
    margin-right: 120px;
}

.custom-alert-btn {
    height: 42px;
    min-width: 92px;
    border: 0;
    outline: 0;
    border-radius: 14px;
    padding: 0 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 900;
    transition: .16s ease;
    white-space: nowrap;
    background: var(--primary, #c45a1c);
    color: #fff;
    box-shadow: 0 12px 26px rgba(196, 90, 28, .22);
}

.custom-alert-btn:hover {
    background: var(--primary-hover, #9f4615);
    transform: translateY(-1px);
}

.custom-alert-btn.success {
    background: var(--success, #059669);
    box-shadow: 0 12px 26px rgba(5, 150, 105, .22);
}

.custom-alert-btn.success:hover {
    background: #047857;
}

.custom-alert-btn.danger {
    background: var(--danger, #dc2626);
    box-shadow: 0 12px 26px rgba(220, 38, 38, .22);
}

.custom-alert-btn.danger:hover {
    background: #b91c1c;
}

.custom-alert-btn.warning {
    background: var(--brand-orange, #f97316);
    box-shadow: 0 12px 26px rgba(249, 115, 22, .22);
}

.custom-alert-btn.warning:hover {
    background: #ea580c;
}

.custom-alert-btn.info {
    background: #2563eb;
    box-shadow: 0 12px 26px rgba(37, 99, 235, .22);
}

.custom-alert-btn.info:hover {
    background: #1d4ed8;
}

@keyframes customAlertFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes customAlertPop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 520px) {
    .custom-alert-backdrop {
        align-items: flex-end;
        padding: 12px;
    }

    .custom-alert-box {
        border-radius: 22px;
    }

    .custom-alert-character {
        position: static;
        width: 92px;
        margin: 0 18px -6px auto;
    }

    .custom-alert-box.has-character .custom-alert-content,
    .custom-alert-box.has-character .custom-alert-sub {
        padding-right: 0;
        margin-right: 18px;
    }

    .custom-alert-head {
        padding: 20px 18px 12px;
    }

    .custom-alert-sub {
        margin: 10px 18px 0;
    }

    .custom-alert-actions {
        padding: 18px;
    }

    .custom-alert-btn {
        width: 100%;
    }
    .m_none{
    display: none !important;
}
}

/* Compact common dialogs */
.custom-alert-backdrop,
.custom-confirm-backdrop {
    padding: 20px;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(2px);
}

.custom-alert-box,
.custom-confirm-box {
    width: min(400px, calc(100vw - 32px));
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .20);
}

.custom-alert-head,
.custom-confirm-head {
    gap: 12px;
    padding: 20px 20px 14px;
}

.custom-alert-icon,
.custom-confirm-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 22px;
}

.custom-alert-title,
.custom-confirm-title {
    font-size: 17px;
    line-height: 1.35;
    letter-spacing: 0;
}

.custom-alert-message,
.custom-confirm-message {
    margin-top: 5px;
    color: #475569;
    font-size: 14px;
    line-height: 1.55;
    word-break: keep-all;
}

.custom-alert-sub,
.custom-confirm-sub {
    margin: 0 20px 14px 72px;
    padding: 10px 12px;
    border-radius: 6px;
}

.custom-alert-box.has-character,
.custom-confirm-box.has-character {
    width: min(440px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: minmax(0, 1fr) 82px;
}

.custom-alert-box.has-character .custom-alert-head,
.custom-confirm-box.has-character .custom-confirm-head {
    grid-column: 1;
    grid-row: 1;
    padding-right: 6px;
}

.custom-alert-character,
.custom-confirm-character {
    position: static;
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    width: 72px;
    margin: 14px 10px 0 0;
    filter: none;
}

.custom-alert-character img,
.custom-confirm-character img {
    width: 100%;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(15, 23, 42, .14));
}

.custom-alert-box.has-character .custom-alert-content,
.custom-confirm-box.has-character .custom-confirm-title-wrap {
    padding-right: 0;
}

.custom-alert-box.has-character .custom-alert-sub,
.custom-confirm-box.has-character .custom-confirm-sub {
    grid-column: 1 / -1;
    margin-right: 20px;
}

.custom-alert-actions,
.custom-confirm-actions {
    grid-column: 1 / -1;
    gap: 8px;
    padding: 2px 20px 20px;
}

.custom-alert-btn,
.custom-confirm-btn {
    min-width: 76px;
    height: 36px;
    padding: 0 15px;
    border-radius: 6px;
    box-shadow: none !important;
}

.custom-alert-btn:focus-visible,
.custom-confirm-btn:focus-visible {
    outline: 3px solid rgba(249, 115, 22, .20);
    outline-offset: 2px;
}

@media (max-width: 520px) {
    .custom-alert-backdrop,
    .custom-confirm-backdrop {
        align-items: center;
        padding: 16px;
    }

    .custom-alert-box,
    .custom-confirm-box {
        width: 100%;
        border-radius: 8px;
    }

    .custom-alert-box.has-character,
    .custom-confirm-box.has-character {
        width: 100%;
        grid-template-columns: minmax(0, 1fr) 68px;
    }

    .custom-alert-character,
    .custom-confirm-character {
        width: 60px;
        margin: 12px 8px 0 0;
    }

    .custom-alert-character img,
    .custom-confirm-character img {
        height: 60px;
    }

    .custom-alert-head,
    .custom-confirm-head {
        padding: 18px 18px 12px;
    }

    .custom-alert-sub,
    .custom-confirm-sub {
        margin: 0 18px 12px 70px;
    }

    .custom-alert-actions,
    .custom-confirm-actions {
        display: flex;
        padding: 2px 18px 18px;
    }

    .custom-alert-btn,
    .custom-confirm-btn {
        width: auto;
    }

    .custom-confirm-btn {
        flex: 1 1 0;
    }
}

.custom-confirm-close {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #334155;
  font: 600 21px/1 system-ui, sans-serif;
  cursor: pointer;
}

.custom-confirm-close:hover {
  background: #eef2f7;
}

.custom-confirm-close:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.custom-confirm-head {
  padding-inline-end: 46px;
}
