@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
    /* ========== 브랜드(포인트) ========== */
    /* 버튼·활성 메뉴·강조 링크 등 메인 액센트 */
    --color-primary: #3f7af0;
    /* primary보다 밝은 보조 톤 (그라디언트·하이라이트) */
    --color-secondary: #74a8f5;

    /* ========== 텍스트 ========== */
    /* 본문·제목 기본 글자색 */
    --color-text: #222222;
    /* 설명·보조 문구·플레이스홀더 */
    --color-text-muted: #777777;

    /* ========== 면·선 ========== */
    /* 페이지/카드 기본 배경 */
    --color-background: #ffffff;
    /* 구분선·입력 테두리·카드 아웃라인 */
    --color-border: #e5e5e5;

    /* ========== 파생 토큰 ========== */
    /* primary의 RGB — rgba() 그림자·오버레이에 사용 (hex 바꾸면 여기도 맞출 것) */
    --color-primary-rgb: 63, 122, 240;
    /* primary 호버/눌림 등 더 진한 상태 */
    --color-primary-hover: color-mix(in srgb, var(--color-primary) 82%, #000000);
    /* 연한 배경 하이라이트 (선택·호버 배경) */
    --color-primary-soft: color-mix(in srgb, var(--color-primary) 10%, #ffffff);
    /* soft보다 조금 진한 틴트 배경 */
    --color-primary-tint: color-mix(in srgb, var(--color-primary) 16%, #ffffff);
    /* primary 계열 테두리 */
    --color-primary-border: color-mix(in srgb, var(--color-primary) 32%, #ffffff);
    /* 본문 영역 등 살짝 어두운 면 */
    --color-surface: #f9fafb;
    /* 칩·비활성 버튼 등 더 어두운 면 */
    --color-surface-muted: #f3f4f6;

    /* ========== 레이아웃 ========== */
    /* 본문 컨테이너 최대 너비 — 목록·검색·폼 페이지 공통 */
    --content-max: 1200px;

    /* ========== 스크롤바 ========== */
    --scrollbar-size: 8px;
    --scrollbar-track: transparent;
    --scrollbar-thumb: color-mix(in srgb, var(--color-primary) 28%, #d1d5db);
    --scrollbar-thumb-hover: color-mix(in srgb, var(--color-primary) 55%, #9ca3af);
}

* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    min-width: 1180px;
    height: 100%;
    overflow: hidden;
    font-family: Pretendard, 'Noto Sans KR', sans-serif;
    color: var(--color-text);
    background: var(--color-background);
}
button,
input,
textarea {
    font: inherit;
}
button {
    border: 0;
    cursor: pointer;
}
.top {
    height: 70px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-background);
    display: flex;
    align-items: center;
    position: fixed;
    inset: 0 0 auto;
    z-index: 10;
}
.brand {
    width: 250px;
    text-align: center;
}
.brand img {
    width: 119px;
    height: 35px;
}
.notice {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    color: var(--color-text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 15px;
    white-space: nowrap;
}
.notice a {
    color: var(--color-primary);
    text-decoration: underline;
}
.notice .close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 5px;
    background: transparent;
    overflow: hidden;
}
.notice img {
    display: block;
    width: 14px;
    height: 14px;
    max-width: 14px;
    max-height: 14px;
    object-fit: contain;
    flex: none;
}
.account {
    margin-left: auto;
    margin-right: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 15px;
    white-space: nowrap;
}
.divider {
    color: #d5d5d5;
}
.welcome strong {
    color: var(--color-primary);
}
.logout {
    background: var(--color-primary);
    color: var(--color-background);
    border-radius: 90px;
    padding: 6px 10px;
    font-size: 13px;
    margin-left: 13px;
}
.sidebar {
    position: fixed;
    z-index: 9;
    left: 0;
    top: 70px;
    bottom: 0;
    width: 90px;
    border-right: 1px solid var(--color-border);
    background: var(--color-background);
    padding: 15px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    font-size: 10px;
    text-align: center;
    background: none;
    padding: 0;
    width: 100%;
}
.menu .ico {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.menu .ico img {
    display: block;
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    object-fit: contain;
    flex: none;
}
.menu.active {
    color: var(--color-primary);
    font-weight: 600;
}
.menu.active .ico {
    background: var(--color-primary-soft);
}
.spacer {
    flex: 1;
}
main {
    margin-left: 90px;
    padding: 40px;
    min-height: 100vh;
    background: var(--color-surface);
    padding-top: 110px;
}
.wrap {
    width: min(1200px, calc(100vw - 170px));
    margin: auto;
}
.heading h1 {
    font-size: 28px;
    line-height: 1.2;
    margin: 0 0 8px;
}
.heading p {
    font-size: 15px;
    color: var(--color-text-muted);
    margin: 0;
}
.app-search {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 6px 0 16px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-background);
}
.app-search:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
}
.app-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-size: 14px;
    outline: 0;
}
.app-search input::placeholder {
    color: var(--color-text-muted);
}
.app-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    cursor: pointer;
}
.app-search-btn:hover,
.app-search-btn:focus-visible {
    color: var(--color-primary);
    outline: 0;
}
.grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 32px;
}
.panel {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
}
.chat {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
}
.badge {
    font-size: 13px;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    border-radius: 8px;
    padding: 6px 12px;
}
.composer {
    position: relative;
    isolation: isolate;
    margin: 0;
    min-height: 120px;
    height: auto;
    border: 0;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    overflow: hidden;
    background: var(--color-background);
    transition: min-height 0.18s ease;
}
.composer::before {
    content: '';
    position: absolute;
    z-index: 0;
    width: 220%;
    aspect-ratio: 1;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    pointer-events: none;
    background: conic-gradient(
        from 0deg,
        #e8f1ff 0%,
        var(--color-primary-border) 12%,
        var(--color-secondary) 24%,
        var(--color-primary) 38%,
        var(--color-secondary) 52%,
        var(--color-primary) 66%,
        var(--color-secondary) 80%,
        var(--color-primary-border) 90%,
        #e8f1ff 100%
    );
    transform-origin: center center;
    animation: composer-border-spin 3s linear infinite !important;
    will-change: transform;
}
.composer::after {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 2px;
    border-radius: 18px;
    pointer-events: none;
    background: var(--color-background);
}
.composer > * {
    position: relative;
    z-index: 2;
}
.composer textarea {
    display: block;
    width: 100%;
    min-height: 29px;
    height: 29px;
    padding: 0;
    border: 0;
    outline: 0;
    resize: none;
    overflow: hidden;
    background: transparent;
    color: var(--color-text);
    font-size: 19px;
    line-height: 1.5;
}
.composer textarea::placeholder {
    color: var(--color-text-muted);
}
.composer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 0;
    width: 24px;
    height: 24px;
    overflow: hidden;
}
.icon-btn img {
    display: block;
    width: 16px;
    height: 16px;
    max-width: 16px;
    max-height: 16px;
    object-fit: contain;
    flex: none;
}
.model {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--color-primary);
    font-size: 19px;
}
.model-select {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    line-height: 1;
}
.model-select img {
    display: block;
    object-fit: contain;
    flex: none;
}
.model-select .model-icon {
    width: 16px;
    height: 16px;
    max-width: 16px;
    max-height: 16px;
}
.model-select .model-name {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    font-size: 14px;
    color: var(--color-text);
    padding-bottom: 3px;
    text-transform: capitalize;
}
.model-select .model-chevron {
    width: 14px;
    height: 8px;
    max-width: 14px;
    max-height: 8px;
    transition: transform 0.2s ease;
}
.mic {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 7px;
    border-radius: 50%;
    background: #f3f4f6;
    border: 1px solid var(--color-border);
    overflow: hidden;
    cursor: pointer;
}
.mic::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 1.5px;
    border-radius: 99px;
    background: #9ca3af;
    transform: rotate(45deg);
    pointer-events: none;
}
.mic:hover {
    background: #e9ebef;
    border-color: #d1d5db;
}
.mic.is-active,
.mic.is-active:hover {
    border-color: var(--color-primary);
    background: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.mic.is-active img {
    filter: brightness(0) invert(1);
    opacity: 1;
}
.mic.is-active::after {
    display: none;
}
.mic img {
    display: block;
    width: 16px;
    height: 16px;
    max-width: 16px;
    max-height: 16px;
    object-fit: contain;
    flex: none;
    opacity: 0.55;
}
.send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    padding: 7px;
    overflow: hidden;
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease,
        filter 0.15s ease,
        transform 0.15s ease;
}
.send.is-active {
    background: linear-gradient(
        135deg,
        var(--color-primary-hover) 0%,
        var(--color-primary) 45%,
        var(--color-secondary) 100%
    );
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.28);
    cursor: pointer;
}
.send.is-inactive {
    background: var(--color-surface-muted);
    box-shadow: none;
    cursor: default;
}
.send.is-active:hover,
.send.is-active:focus-visible {
    filter: brightness(1.05);
    box-shadow: 0 6px 16px rgba(var(--color-primary-rgb), 0.34);
}
.send.is-active:active {
    transform: scale(0.96);
    filter: brightness(0.98);
}
.send.is-inactive:hover,
.send.is-inactive:focus-visible,
.send.is-inactive:active {
    filter: none;
    transform: none;
    box-shadow: none;
}
.send img {
    display: block;
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    object-fit: contain;
    flex: none;
}
@keyframes composer-border-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
.lower {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
}
.store,
.recent {
    padding: 20px;
}
.store-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}
.store-card {
    min-width: 0;
    height: 106px;
    padding: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-surface-muted);
    border-radius: 12px;
    display: flex;
    gap: 16px;
}
.thumb {
    width: 80px;
    height: 80px;
    flex: none;
    object-fit: cover;
    border-radius: 8px;
}
.store-info {
    height: 80px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.store-info h3 {
    font-size: 16px;
    margin: 0 0 4px;
}
.store-info p {
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-btn {
    align-self: flex-start;
    padding: 6px 10px;
    background: var(--color-primary);
    color: var(--color-background);
    border-radius: 8px;
    font-size: 12px;
}
.recent {
    height: 422px;
}
.view-all {
    color: var(--color-primary);
    font-size: 14px;
    text-decoration: none;
}
.recent-list {
    height: 350px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
}
.recent-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 8px;
}
.recent-item:hover {
    background: var(--color-surface);
}
.recent-item span {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 210px;
}
.recent-item button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    background: transparent;
    padding: 0;
    overflow: hidden;
}
.recent-item img {
    display: block;
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    object-fit: contain;
}
.toast {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    background: var(--color-text);
    color: var(--color-background);
    border-radius: 9px;
    padding: 11px 18px;
    font-size: 14px;
    z-index: 20;
}
@media (max-width: 1350px) {
    .notice {
        display: none;
    }
    .store-list {
        grid-template-columns: 1fr;
    }
    .store-card {
        height: 106px;
    }
    .lower {
        grid-template-columns: minmax(0, 1fr) 300px;
    }
    .recent {
        height: 666px;
    }
    .recent-list {
        height: 590px;
    }
}
.top .brand {
    position: relative;
    width: 410px;
    flex: 0 0 410px;
    transition:
        width 0.25s ease,
        flex-basis 0.25s ease;
}
.sidebar-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-background);
    color: var(--color-text-muted);
    font-size: 25px;
    line-height: 1;
}
.sidebar {
    width: 410px;
    align-items: stretch;
    padding: 24px;
    gap: 0;
    overflow: hidden;
    transition:
        width 0.25s ease,
        padding 0.25s ease;
}
.sidebar-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
}
.sidebar-main::-webkit-scrollbar {
    display: none;
}
.sidebar .menu {
    height: 64px;
    min-height: 64px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 16px;
    padding: 0 24px;
    border-radius: 18px;
    color: var(--color-text);
    font-size: 18px;
    text-align: left;
    white-space: nowrap;
}
.sidebar .menu .ico {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 0;
    background: transparent;
}
.sidebar .menu .ico img {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
}
.sidebar .menu.active {
    color: var(--color-primary);
    background: var(--color-primary-soft);
}
.sidebar .menu.active .ico {
    background: transparent;
}
.side-group,
.sidebar-recent {
    margin-top: 20px;
}
.side-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 38px;
    padding: 0 24px;
    background: transparent;
    color: var(--color-text);
    font-size: 16px;
    font-weight: 700;
    text-align: left;
}
.side-group-title span {
    color: var(--color-text-muted);
    font-size: 19px;
    transition: transform 0.2s ease;
}
.side-group.is-closed .side-group-title span,
.sidebar-recent.is-closed .side-group-title span {
    transform: rotate(-90deg);
}
.side-group.is-closed .side-group-body,
.sidebar-recent.is-closed .sidebar-recent-list {
    display: none;
}
.sidebar-recent-list {
    padding: 6px 24px 12px;
}
.sidebar-chat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 50px;
    border-radius: 10px;
    background: transparent;
    color: var(--color-text);
    font-size: 16px;
    text-align: left;
}
.sidebar-chat:hover {
    background: var(--color-surface);
}
.sidebar-chat .chat-name {
    max-width: 245px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-chat img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}
.sidebar-account {
    margin-top: auto;
    padding: 18px 24px 0;
    border-top: 1px solid var(--color-border);
    font-size: 14px;
    line-height: 1.5;
}
.sidebar-account strong {
    color: var(--color-primary);
}
.sidebar-account small {
    display: block;
    color: var(--color-text-muted);
    margin: 3px 0 10px;
}
.sidebar-account .logout {
    margin: 0;
}
.sidebar ~ main,
main {
    margin-left: 410px;
    transition: margin-left 0.25s ease;
}
body.sidebar-collapsed .top .brand {
    width: 90px;
    flex-basis: 90px;
}
body.sidebar-collapsed .brand > img,
body.sidebar-collapsed .brand > a {
    display: none;
}
body.sidebar-collapsed .sidebar-toggle {
    right: 30px;
    transform: translateY(-50%) rotate(180deg);
}
body.sidebar-collapsed .sidebar {
    width: 90px;
    padding: 15px 12px;
    align-items: center;
}
body.sidebar-collapsed .sidebar-main {
    width: 100%;
    gap: 12px;
    overflow: visible;
}
body.sidebar-collapsed .sidebar .menu {
    width: 100%;
    height: auto;
    min-height: 0;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 0;
    border-radius: 0;
    font-size: 10px;
    text-align: center;
}
body.sidebar-collapsed .sidebar .menu .ico {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 12px;
    background: var(--color-surface);
}
body.sidebar-collapsed .sidebar .menu .ico img {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
}
body.sidebar-collapsed .sidebar .menu.active {
    background: transparent;
}
body.sidebar-collapsed .sidebar .menu.active .ico {
    background: var(--color-primary-soft);
}
body.sidebar-collapsed .side-group {
    margin-top: auto;
}
body.sidebar-collapsed .side-group-body {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
}
body.sidebar-collapsed main {
    margin-left: 90px;
}
.sidebar-main {
    flex: 1;
}

/* 서비스형 접이식 내비게이션 다듬기 */
.top .brand {
    width: 288px;
    flex: 0 0 288px;
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    text-align: left;
}
.brand img {
    display: block;
    width: 119px;
    height: 35px;
    object-fit: contain;
    transition:
        width 0.25s ease,
        height 0.25s ease;
}
.sidebar-toggle {
    right: 14px;
    width: 28px;
    height: 28px;
    border-color: var(--color-border);
    border-radius: 7px;
    color: var(--color-text-muted);
    font-size: 22px;
    transition:
        transform 0.25s ease,
        background 0.2s ease;
}
.sidebar-toggle:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
}
.sidebar {
    width: 288px;
    padding: 16px 12px 14px;
    background: var(--color-background);
}
.sidebar-main {
    gap: 3px;
}
.sidebar .menu {
    height: 48px;
    min-height: 48px;
    gap: 13px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
}
.sidebar .menu .ico {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
}
.sidebar .menu .ico img {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
}
.sidebar .menu.active {
    font-weight: 600;
    background: var(--color-primary-soft);
}
.menu-label {
    overflow: hidden;
    text-overflow: ellipsis;
}
.menu-label--external {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.menu-external-icon {
    width: 15px;
    height: 15px;
    flex: none;
    opacity: 0.85;
}
.side-group,
.sidebar-recent {
    margin-top: 16px;
}
.side-group-title {
    height: 34px;
    padding: 0 14px;
    gap: 7px;
    font-size: 13px;
    color: var(--color-text-muted);
}
.side-group-title span {
    font-size: 15px;
}
.side-group-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.sidebar-recent-list {
    padding: 3px 8px 8px;
}
.sidebar-chat {
    height: 40px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 14px;
}
.sidebar-chat .chat-name {
    max-width: 205px;
}
.sidebar-account {
    padding: 14px 14px 0;
    font-size: 13px;
}
.sidebar-account small {
    margin: 2px 0 8px;
}
.sidebar-account .logout {
    padding: 5px 9px;
    font-size: 12px;
}
.sidebar ~ main,
main {
    margin-left: 288px;
}
.wrap {
    width: min(1200px, calc(100vw - 368px));
}
body.sidebar-collapsed .top .brand {
    width: 76px;
    flex-basis: 76px;
    padding: 0 8px;
    justify-content: center;
}
body.sidebar-collapsed .brand > img,
body.sidebar-collapsed .brand > a {
    display: none;
}
body.sidebar-collapsed .sidebar-toggle {
    right: -14px;
    z-index: 12;
    background: var(--color-background);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transform: translateY(-50%) rotate(180deg);
}
body.sidebar-collapsed .sidebar {
    width: 76px;
    padding: 14px 10px;
}
body.sidebar-collapsed .sidebar-main {
    gap: 7px;
}
body.sidebar-collapsed .sidebar .menu {
    height: 44px;
    min-height: 44px;
    width: 44px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: row;
    border-radius: 10px;
}
body.sidebar-collapsed .sidebar .menu .ico {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 10px;
}
body.sidebar-collapsed .sidebar .menu .ico img {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
}
body.sidebar-collapsed .sidebar .menu-label {
    display: none;
}
body.sidebar-collapsed .side-group {
    width: 100%;
    margin-top: auto;
}
body.sidebar-collapsed .side-group-body {
    gap: 7px;
}
body.sidebar-collapsed main {
    margin-left: 76px;
}
body.sidebar-collapsed .wrap {
    width: min(1200px, calc(100vw - 156px));
}
@media (max-width: 1350px) {
    .wrap {
        width: calc(100vw - 368px);
    }
    body.sidebar-collapsed .wrap {
        width: calc(100vw - 156px);
    }
}
.sidebar-rail {
    position: fixed;
    z-index: 20;
    left: 282px;
    top: 70px;
    bottom: 0;
    width: 12px;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: ew-resize;
    transition: left 0.25s ease;
}
.sidebar-rail::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: transparent;
    transition:
        background 0.18s ease,
        box-shadow 0.18s ease;
}
.sidebar-rail::after {
    content: '';
    position: absolute;
    left: 1px;
    top: 50%;
    width: 10px;
    height: 42px;
    border-radius: 8px;
    transform: translateY(-50%) scaleY(0.6);
    background: transparent;
    transition:
        background 0.18s ease,
        transform 0.18s ease;
}
.sidebar-rail:hover::before,
.sidebar-rail:focus-visible::before {
    background: var(--color-secondary);
    box-shadow: 0 0 0 1px rgba(var(--color-primary-rgb), 0.08);
}
.sidebar-rail:hover::after,
.sidebar-rail:focus-visible::after {
    background: rgba(var(--color-primary-rgb), 0.18);
    transform: translateY(-50%) scaleY(1);
}
.sidebar-rail:focus-visible {
    outline: 0;
}
body.sidebar-collapsed .sidebar-rail {
    left: 70px;
}
body.sidebar-collapsed .sidebar {
    overflow: visible;
}
body.sidebar-collapsed .sidebar .menu {
    position: relative;
}
body.sidebar-collapsed .sidebar .menu:hover .menu-label,
body.sidebar-collapsed .sidebar .menu:focus-visible .menu-label {
    display: block;
    position: absolute;
    z-index: 30;
    left: 54px;
    top: 50%;
    width: max-content;
    max-width: 220px;
    padding: 7px 10px;
    border-radius: 7px;
    background: var(--color-text);
    color: var(--color-background);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transform: translateY(-50%);
    pointer-events: none;
}
body.sidebar-collapsed .sidebar .menu:hover .menu-label::before,
body.sidebar-collapsed .sidebar .menu:focus-visible .menu-label::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    margin-top: -4px;
    border-width: 4px;
    border-style: solid;
    border-color: transparent var(--color-text) transparent transparent;
}
.sidebar-menu-tooltip {
    position: fixed;
    z-index: 1000;
    display: none;
    width: max-content;
    max-width: 220px;
    padding: 7px 10px;
    border-radius: 7px;
    background: var(--color-text);
    color: var(--color-background);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transform: translateY(-50%);
    pointer-events: none;
}
.sidebar-menu-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    margin-top: -4px;
    border-width: 4px;
    border-style: solid;
    border-color: transparent var(--color-text) transparent transparent;
}
.sidebar-menu-tooltip.is-visible {
    display: block;
}
.top .brand,
body.sidebar-collapsed .top .brand {
    width: 288px;
    flex: 0 0 288px;
    height: 70px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}
.brand > img,
.brand > a > img {
    display: block;
    width: 119px;
    height: 35px;
    object-fit: contain;
    flex: none;
}
.sidebar-account {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.account-row .logout {
    margin: 0;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--color-primary-tint);
    color: var(--color-secondary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    transition:
        background-color 0.18s ease,
        color 0.18s ease;
}
.account-row .logout:hover,
.account-row .logout:focus-visible {
    background: var(--color-primary);
    color: var(--color-background);
    outline: 0;
}
.credit-card {
    padding: 12px;
    border: 1px solid #d0ebe6;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--color-primary-soft), var(--color-primary-soft));
    box-shadow: 0 3px 10px rgba(var(--color-primary-rgb), 0.06);
}
.credit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
    color: var(--color-text-muted);
    font-size: 12px;
}
.credit-head strong {
    color: var(--color-primary);
    font-size: 12px;
}
.credit-value {
    margin-bottom: 9px;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1px;
}
.credit-value span {
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 500;
}
.credit-track {
    position: relative;
    height: 7px;
    overflow: hidden;
    border-radius: 99px;
    background: #d0ebe6;
}
.credit-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 59.7%;
    overflow: hidden;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-primary), var(--color-secondary));
    transform-origin: left;
    animation: credit-grow 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.credit-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    width: 45%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.75),
        transparent
    );
    transform: translateX(-120%);
    animation: credit-shine 2.4s ease-in-out 1s infinite;
}
@keyframes credit-grow {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}
@keyframes credit-shine {
    0%,
    35% {
        transform: translateX(-120%);
    }
    75%,
    100% {
        transform: translateX(260%);
    }
}
.sidebar-chat img {
    display: block;
    width: 18px;
    height: 18px;
    min-width: 18px;
    max-width: 18px;
    min-height: 18px;
    max-height: 18px;
    flex: 0 0 18px;
    object-fit: contain;
}
.sidebar-chat .chat-name {
    min-width: 0;
    margin-right: 12px;
}
.side-group-title {
    justify-content: space-between;
}
.side-group-title .group-label {
    color: inherit;
    font-size: inherit;
    transform: none !important;
}
.side-group-title .group-arrow {
    display: block;
    width: 14px;
    height: 8px;
    min-width: 14px;
    max-width: 14px;
    object-fit: contain;
    transition: transform 0.2s ease;
}
.side-group.is-closed .group-arrow,
.sidebar-recent.is-closed .group-arrow {
    transform: rotate(-90deg);
}
.sidebar-backdrop,
.mobile-menu-button {
    display: none;
}
/* 태블릿·모바일 */
@media (max-width: 1199px) {
    html,
    body {
        min-width: 0;
    }
    .notice {
        display: none;
    }
    .wrap,
    body.sidebar-collapsed .wrap {
        width: calc(100vw - 136px);
        max-width: 100%;
    }
    .lower {
        grid-template-columns: 1fr;
    }
    .recent {
        width: 100%;
        height: auto;
    }
    .recent-list {
        height: auto;
    }
    .recent-item {
        min-height: 52px;
    }
    .recent-item span {
        width: calc(100% - 34px);
    }
    .store-list {
        grid-template-columns: 1fr 1fr;
    }
    .sidebar:not(:hover) {
    }
    .top {
        right: 0;
    }
}
@media (min-width: 768px) and (max-width: 1199px) {
    body:not(.sidebar-collapsed) .sidebar {
        box-shadow: 10px 0 24px rgba(17, 24, 39, 0.08);
    }
    main {
        padding: 100px 30px 30px;
    }
    .heading h1 {
        font-size: 25px;
    }
    .grid {
        margin-top: 26px;
    }
    .chat {
        padding: 20px;
    }
    .composer {
        padding: 18px;
    }
}
@media (max-width: 767px) {
    html,
    body {
        min-width: 320px;
    }
    .top {
        height: 60px;
    }
    .top .brand,
    body.sidebar-collapsed .top .brand {
        width: 180px;
        flex: 0 0 180px;
        height: 60px;
        padding: 0 16px;
        justify-content: flex-start;
    }
    .brand img,
    body.sidebar-collapsed .brand img {
        width: 108px;
        height: 32px;
    }
    .sidebar,
    body.sidebar-collapsed .sidebar {
        z-index: 19;
        top: 60px;
        bottom: 0;
        width: 268px;
        padding: 14px 12px;
        background: var(--color-background);
        align-items: stretch;
        overflow: hidden;
        box-shadow: 12px 0 30px rgba(17, 24, 39, 0.14);
        transform: translateX(0);
        transition: transform 0.25s ease;
    }
    .sidebar-main,
    body.sidebar-collapsed .sidebar-main {
        width: 100%;
        min-height: 0;
        flex: 1 1 auto;
        gap: 3px;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar .menu,
    body.sidebar-collapsed .sidebar .menu {
        display: flex;
        width: 100%;
        height: 46px;
        min-height: 46px;
        margin: 0;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 0 13px;
        border-radius: 10px;
        font-size: 15px;
        text-align: left;
    }
    .sidebar .menu .ico,
    body.sidebar-collapsed .sidebar .menu .ico {
        width: 22px;
        height: 22px;
        flex: 0 0 22px;
        border-radius: 0;
        background: transparent;
    }
    .sidebar .menu .ico img,
    body.sidebar-collapsed .sidebar .menu .ico img {
        width: 20px;
        height: 20px;
        max-width: 20px;
        max-height: 20px;
    }
    .sidebar .menu.active,
    body.sidebar-collapsed .sidebar .menu.active {
        background: var(--color-primary-soft);
    }
    .sidebar .menu.active .ico,
    body.sidebar-collapsed .sidebar .menu.active .ico {
        background: transparent;
    }
    .sidebar .menu-label,
    body.sidebar-collapsed .sidebar .menu-label {
        display: block;
        position: static;
        padding: 0;
        background: transparent;
        color: inherit;
        font-size: inherit;
        box-shadow: none;
        transform: none;
    }
    .side-group,
    body.sidebar-collapsed .side-group {
        width: auto;
        margin-top: 14px;
    }
    .side-group-title,
    body.sidebar-collapsed .side-group-title {
        display: flex;
    }
    .side-group-body,
    body.sidebar-collapsed .side-group-body {
        gap: 3px;
    }
    .sidebar-recent,
    body.sidebar-collapsed .sidebar-recent {
        display: block;
    }
    .sidebar-account,
    body.sidebar-collapsed .sidebar-account {
        display: flex;
    }
    .sidebar-chat .chat-name {
        max-width: 190px;
    }
    body.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .sidebar-rail,
    body.sidebar-collapsed .sidebar-rail {
        top: 60px;
        left: 260px;
        width: 16px;
    }
    .sidebar-rail::before {
        left: 7px;
    }
    body.sidebar-collapsed .sidebar-rail {
        left: 0;
    }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        z-index: 18;
        inset: 60px 0 0;
        border: 0;
        background: rgba(17, 24, 39, 0.3);
        opacity: 1;
        transition: opacity 0.2s ease;
    }
    body.sidebar-collapsed .sidebar-backdrop {
        opacity: 0;
        pointer-events: none;
    }
    .sidebar ~ main,
    main,
    body.sidebar-collapsed main {
        margin-left: 0;
        padding: 84px 16px 28px;
    }
    .wrap,
    body.sidebar-collapsed .wrap {
        width: 100%;
        max-width: none;
    }
    .heading h1 {
        font-size: 23px;
    }
    .heading p {
        font-size: 14px;
        white-space: normal;
    }
    .grid {
        gap: 16px;
        margin-top: 22px;
    }
    .chat {
        padding: 16px;
        gap: 14px;
        border-radius: 14px;
    }
    .panel-title {
        font-size: 17px;
    }
    .composer {
        min-height: 112px;
        padding: 16px;
        border-radius: 16px;
    }
    .composer::after {
        border-radius: 14px;
    }
    .composer textarea {
        font-size: 16px;
        line-height: 1.5;
    }
    .model {
        gap: 10px;
        font-size: 14px;
    }
    .model-select {
        gap: 6px;
    }
    .lower {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .store,
    .recent {
        padding: 16px;
        border-radius: 14px;
    }
    .store-list {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 14px;
    }
    .store-card {
        height: 98px;
        padding: 10px;
        gap: 12px;
    }
    .thumb {
        width: 76px;
        height: 76px;
    }
    .store-info {
        height: 76px;
    }
    .store-info h3 {
        font-size: 14px;
    }
    .store-info p {
        font-size: 12px;
    }
    .recent-item {
        padding: 10px 8px;
    }
    .recent-item span {
        font-size: 14px;
    }
    .toast {
        max-width: calc(100vw - 32px);
        text-align: center;
    }
}
@media (max-width: 390px) {
    .badge {
        display: none;
    }
    .composer {
        padding: 14px;
    }
    .model-select {
        font-size: 13px;
    }
    .store-card {
        gap: 10px;
    }
    .thumb {
        width: 70px;
        height: 70px;
    }
    .store-info {
        height: 70px;
    }
    .chat-btn {
        padding: 5px 8px;
    }
}
@media (max-width: 767px) {
    .mobile-menu-button {
        display: flex;
        order: 2;
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        padding: 9px;
        border-radius: 9px;
        background: transparent;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }
    .mobile-menu-button:hover {
        background: var(--color-surface-muted);
    }
    .mobile-menu-button span {
        display: block;
        width: 19px;
        height: 2px;
        border-radius: 2px;
        background: var(--color-text-muted);
        transition:
            transform 0.2s ease,
            opacity 0.2s ease;
    }
    .top .brand,
    body.sidebar-collapsed .top .brand {
        width: 100%;
        flex-basis: 100%;
        gap: 8px;
        padding: 0 12px 0 16px;
        justify-content: space-between;
    }
    .brand img,
    body.sidebar-collapsed .brand img {
        order: 1;
        width: 108px;
        height: 32px;
    }
    .sidebar,
    body.sidebar-collapsed .sidebar {
        left: auto;
        right: 0;
        transform: translateX(0);
        box-shadow: -12px 0 30px rgba(17, 24, 39, 0.14);
    }
    body.sidebar-collapsed .sidebar {
        transform: translateX(100%);
        box-shadow: none;
    }
    .sidebar-rail,
    body.sidebar-collapsed .sidebar-rail {
        display: none;
    }
    body.sidebar-open .mobile-menu-button span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }
    body.sidebar-open .mobile-menu-button span:nth-child(2) {
        opacity: 0;
    }
    body.sidebar-open .mobile-menu-button span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }
}
@media (min-width: 768px) {
    .lower {
        align-items: stretch;
    }
    .lower > .panel {
        height: auto;
        align-self: stretch;
    }
    .recent {
        height: auto;
    }
    .recent-list {
        height: auto;
        flex: 1;
    }
    .recent {
        display: flex;
        flex-direction: column;
    }
    .recent-item {
        min-height: 0;
    }
}
.recent {
    overflow: hidden;
}
.recent-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}
.recent-list::-webkit-scrollbar {
    width: 5px;
}
.recent-list::-webkit-scrollbar-track {
    background: transparent;
}
.recent-list::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: var(--color-border);
}
.recent-list::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}
.recent-list .recent-item {
    padding-left: 0;
    padding-right: 0;
}
.store-card {
    cursor: pointer;
    overflow: hidden;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}
.store-card:hover,
.store-card:focus-within {
    transform: translateY(-3px);
    border-color: var(--color-primary-border);
    background: var(--color-background);
    box-shadow: 0 9px 20px rgba(var(--color-primary-rgb), 0.11);
}
.store-card .thumb {
    transition: transform 0.25s ease;
}
.store-card:hover .thumb,
.store-card:focus-within .thumb {
    transform: scale(1.04);
}
.store-card .chat-btn {
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}
.store-card:hover .chat-btn,
.store-card:focus-within .chat-btn {
    background: var(--color-primary-hover);
}
.store-card .chat-btn:active {
    transform: scale(0.96);
}
.more-menu {
    display: none;
    position: fixed;
    z-index: 100;
    width: 124px;
    padding: 5px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: var(--color-background);
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.14);
}
.more-menu.is-open {
    display: block;
    animation: more-menu-in 0.14s ease both;
}
.more-menu button {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    background: transparent;
    color: #dc2626;
    font-size: 13px;
    text-align: left;
}
.more-menu button:hover,
.more-menu button:focus-visible {
    outline: 0;
    background: #fef2f2;
}
@keyframes more-menu-in {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.icon-btn.attach img {
    transition: transform 0.16s ease;
}
.icon-btn.attach.is-open img {
    transform: rotate(45deg);
}
.attach-menu {
    display: none;
    position: fixed;
    z-index: 120;
    min-width: 148px;
    padding: 6px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-background);
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.14);
}
.attach-menu.is-open {
    display: block;
    animation: more-menu-in 0.14s ease both;
}
.attach-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.2px;
    text-align: left;
}
.attach-menu-item:hover,
.attach-menu-item:focus-visible {
    outline: 0;
    color: var(--color-primary);
    background: var(--color-primary-soft);
}
.attach-menu-item svg {
    flex: none;
}
.attach-menu-item > span {
    flex: 1;
}
.attach-menu-check {
    visibility: hidden;
    margin-left: auto;
    color: var(--color-primary);
}
.attach-menu-item.is-selected {
    color: var(--color-primary);
    background: var(--color-primary-soft);
}
.attach-menu-item.is-selected .attach-menu-check {
    visibility: visible;
}
.composer-attachments {
    display: none;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 0 0 2px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
    -webkit-overflow-scrolling: touch;
}
.composer-attachments.is-visible {
    display: flex;
}
.composer-attachments::-webkit-scrollbar {
    height: 6px;
}
.composer-attachments::-webkit-scrollbar-track {
    background: transparent;
}
.composer-attachments::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
}
.composer-file {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 220px;
    max-width: 220px;
    padding: 7px 8px 7px 10px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-background);
}
.composer-file.is-uploading {
    border-color: color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
    background: color-mix(in srgb, var(--color-primary-soft) 55%, var(--color-background));
}
.composer-file-icon {
    flex: none;
    font-size: 15px;
}
.composer-file-info {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}
.composer-file-info strong {
    overflow: hidden;
    color: var(--color-text);
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.composer-file-info small {
    color: var(--color-text-muted);
    font-size: 10px;
}
.composer-file.is-uploading .composer-file-info small {
    color: var(--color-primary);
}
.composer-file-loading {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}
.composer-file-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid color-mix(in srgb, var(--color-primary) 25%, transparent);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: composer-file-spin 0.7s linear infinite;
}
@keyframes composer-file-spin {
    to {
        transform: rotate(360deg);
    }
}
.composer-file button {
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 17px;
    line-height: 1;
}
.composer-file button:hover,
.composer-file button:focus-visible {
    outline: 0;
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
.recent-item > button,
.sidebar-chat img {
    cursor: pointer;
}
.recent-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    height: 100%;
    color: var(--color-text-muted);
    font-size: 14px;
    text-align: center;
}
.recent-empty::before {
    content: '';
    width: 34px;
    height: 34px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--color-primary-soft), var(--color-primary-tint));
    box-shadow: inset 0 0 0 1px #d0ebe6;
}
.sidebar-recent-list .recent-empty {
    min-height: 92px;
    font-size: 12px;
}
.sidebar-recent-list .recent-empty::before {
    width: 26px;
    height: 26px;
    margin-bottom: 7px;
}
@media (min-width: 768px) {
    .store,
    .recent {
        height: 428px !important;
    }
    .recent-list {
        height: auto;
        min-height: 0;
        flex: 1;
    }
}
.recent-list .recent-item {
    height: 52px;
    min-height: 52px;
    max-height: 52px;
    flex: 0 0 52px;
}
.recent-list,
.sidebar-recent-list {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
.recent-list:hover,
.sidebar-recent-list:hover {
    scrollbar-color: var(--color-border) transparent;
}
.recent-list::-webkit-scrollbar,
.sidebar-recent-list::-webkit-scrollbar {
    width: 5px;
}
.recent-list::-webkit-scrollbar-track,
.sidebar-recent-list::-webkit-scrollbar-track {
    background: transparent;
}
.recent-list::-webkit-scrollbar-thumb,
.sidebar-recent-list::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: transparent;
}
.recent-list:hover::-webkit-scrollbar-thumb,
.sidebar-recent-list:hover::-webkit-scrollbar-thumb {
    background: var(--color-border);
}
.recent-list:hover::-webkit-scrollbar-thumb:hover,
.sidebar-recent-list:hover::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}
.sidebar-recent-list {
    height: 211px;
    max-height: 211px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.chat {
    position: relative;
}
.model-select {
    display: inline-flex;
    align-items: center;
    padding: 4px 2px;
    background: transparent;
    color: var(--color-primary);
    border-radius: 7px;
    line-height: 1;
}
.model-select:hover {
    background: var(--color-primary-soft);
}
.model-select[aria-expanded='true'] .model-chevron {
    transform: rotate(180deg);
}
.model-picker {
    display: none;
    position: absolute;
    z-index: 50;
    right: 24px;
    bottom: 76px;
    width: min(760px, calc(100% - 48px));
    max-height: 520px;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-background);
    box-shadow: 0 18px 50px rgba(17, 24, 39, 0.18);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}
.model-picker.is-open {
    display: block;
    animation: model-picker-in 0.16s ease both;
}
@keyframes model-picker-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.model-group + .model-group {
    margin-top: 18px;
}
.model-provider {
    margin: 0 0 8px;
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: lowercase;
}
.model-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 8px;
}
.model-option {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 42px;
    padding: 0 10px;
    border-radius: 9px;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
}
.model-option:hover,
.model-option:focus-visible {
    outline: 0;
    background: #f3f6fa;
}
.model-option.is-selected {
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    font-weight: 600;
}
.model-option img {
    display: block;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin-right: 10px;
    object-fit: contain;
}
.model-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.model-option .model-option-text,
.model-option .model-option-desc {
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
}
.model-option .model-option-name {
    overflow: hidden;
}
@media (max-width: 767px) {
    .model-picker {
        position: fixed;
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
        max-height: 70vh;
        padding: 15px;
        border-radius: 14px;
    }
    .model-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 3px;
    }
    .model-option {
        height: 42px;
        padding: 0 8px;
        font-size: 13px;
    }
    .model-option img {
        width: 18px;
        height: 18px;
        flex-basis: 18px;
        margin-right: 8px;
    }
    .model-provider {
        font-size: 12px;
    }
    .model-group + .model-group {
        margin-top: 15px;
    }
}
@media (max-width: 390px) {
    .model-options {
        grid-template-columns: 1fr;
    }
}
.model-backdrop {
    display: none;
    position: fixed;
    z-index: 90;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(2px);
}
.model-backdrop.is-open {
    display: block;
    animation: model-backdrop-in 0.18s ease both;
}
.model-picker,
.model-picker.is-open {
    position: fixed;
    z-index: 91;
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    width: min(760px, calc(100vw - 40px));
    max-height: min(680px, calc(100vh - 40px));
    transform: translate(-50%, -50%);
}
.model-picker.is-open {
    animation: model-modal-in 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes model-backdrop-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes model-modal-in {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 12px)) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}
@media (max-width: 767px) {
    .model-picker,
    .model-picker.is-open {
        left: 50%;
        top: 50%;
        right: auto;
        bottom: auto;
        width: calc(100vw - 28px);
        max-height: calc(100vh - 36px);
        transform: translate(-50%, -50%);
    }
}
.model-picker,
.model-picker.is-open {
    overflow: hidden;
    max-height: none;
}
@media (max-width: 767px) {
    .model-picker,
    .model-picker.is-open {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        padding: 12px;
    }
    .model-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2px 4px;
    }
    .model-option {
        height: 34px;
        padding: 0 6px;
        font-size: 11px;
    }
    .model-option img {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
        margin-right: 6px;
    }
    .model-provider {
        margin-bottom: 4px;
        font-size: 11px;
    }
    .model-group + .model-group {
        margin-top: 8px;
    }
}
@media (max-width: 390px) {
    .model-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .model-option {
        font-size: 10px;
    }
}
.sidebar-toggle {
    position: fixed;
    z-index: 21;
    left: 244px;
    right: auto;
    top: 35px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text-muted);
    box-shadow: none;
    transform: translateY(-50%);
    transition:
        left 0.25s ease,
        background 0.18s ease,
        color 0.18s ease;
}
.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
    background: var(--color-surface-muted);
    color: var(--color-text);
}
.sidebar-toggle:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 1px;
}
.sidebar-toggle img,
body.sidebar-collapsed .sidebar-toggle img {
    display: block;
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    object-fit: contain;
}
.sidebar-toggle::after {
    content: attr(aria-label);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    width: max-content;
    padding: 6px 9px;
    border-radius: 6px;
    background: var(--color-text);
    color: var(--color-background);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    opacity: 0;
    transform: translateY(-50%) translateX(-3px);
    pointer-events: none;
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}
.sidebar-toggle:hover::after,
.sidebar-toggle:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
body.sidebar-collapsed .top .brand {
    width: 76px;
    flex-basis: 76px;
    padding: 0 8px;
}
body.sidebar-collapsed .brand > img {
    display: none;
}
body.sidebar-collapsed .sidebar-toggle {
    left: 22px;
    right: auto;
    transform: translateY(-50%);
}
@media (max-width: 767px) {
    .sidebar-toggle {
        display: none;
    }
    .mobile-menu-button {
        position: absolute;
        right: 12px;
        top: 11px;
    }
    body.sidebar-collapsed .top .brand {
        width: 100%;
        flex-basis: 100%;
        padding: 0 12px 0 16px;
    }
    body.sidebar-collapsed .brand > img {
        display: block;
        width: 108px;
        height: 32px;
    }
}

/* 메인 대화 랜딩 */
main {
    background: var(--color-surface);
    padding-top: 122px;
}
.wrap {
    max-width: var(--content-max);
}
.heading {
    text-align: center;
}
.heading h1 {
    margin: 0 0 14px;
    color: var(--color-text);
    font-size: 32px;
    line-height: 1.25;
    letter-spacing: -0.8px;
}
.heading p {
    color: var(--color-text-muted);
    font-size: 16px;
    line-height: 1.5;
}
.grid {
    gap: 0;
    margin-top: 42px;
}
.chat {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.chat .panel-title {
    display: none;
}
.composer {
    min-height: 126px;
    padding: 21px 22px;
    border-radius: 20px;
}
.composer::after {
    border-radius: 18px;
}
.composer textarea {
    font-size: 17px;
}
.composer-bar {
    align-items: center;
}
.icon-btn {
    width: 28px;
    height: 28px;
}
.icon-btn img {
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
}
.model {
    gap: 14px;
    font-size: 16px;
}
.mic,
.send {
    width: 36px;
    height: 36px;
    padding: 8px;
}
.mic img {
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
}
.send img {
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
}
.lower {
    display: block;
    margin-top: 68px;
}
.store {
    height: auto !important;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.store > .panel-title {
    font-size: 20px;
}
.store-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.store-card {
    height: 320px;
    padding: 16px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.thumb {
    width: 100%;
    height: 164px;
    border-radius: 0;
}
.store-info {
    width: 100%;
    height: auto;
    min-height: 110px;
    flex: 1;
}
.store-info h3 {
    margin: 0 0 6px;
    font-size: 17px;
}
.store-info p {
    font-size: 13px;
}
.chat-btn {
    width: 100%;
    padding: 9px 12px;
    background: var(--color-primary);
    color: var(--color-background);
    border-radius: 8px;
    font-size: 13px;
}
@media (max-width: 1199px) {
    main {
        padding-top: 112px;
    }
    .heading h1 {
        font-size: 29px;
    }
    .heading p {
        font-size: 15px;
    }
    .grid {
        margin-top: 36px;
    }
    .lower {
        margin-top: 58px;
    }
    .store-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }
    .store-card {
        height: 306px;
        padding: 14px;
    }
    .thumb {
        height: 156px;
    }
}
@media (max-width: 900px) {
    .store-list {
        grid-template-columns: 1fr 1fr;
    }
    .store-card {
        height: 312px;
    }
}
@media (max-width: 767px) {
    main,
    body.sidebar-collapsed main {
        padding: 92px 16px 32px;
    }
    .heading h1 {
        margin-bottom: 10px;
        font-size: 25px;
        letter-spacing: -0.5px;
    }
    .heading p {
        font-size: 14px;
    }
    .grid {
        margin-top: 28px;
    }
    .composer {
        min-height: 112px;
        padding: 16px;
        border-radius: 16px;
    }
    .composer::after {
        border-radius: 14px;
    }
    .composer textarea {
        font-size: 15px;
    }
    .model {
        font-size: 14px;
    }
    .mic,
    .send {
        width: 32px;
        height: 32px;
    }
    .lower {
        margin-top: 44px;
    }
    .store > .panel-title {
        font-size: 18px;
    }
    .store-list {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 16px;
    }
    .store-card {
        height: auto;
        min-height: 306px;
        padding: 14px;
    }
    .thumb {
        height: auto;
        aspect-ratio: 1.8;
    }
    .store-info {
        min-height: 100px;
    }
    .store-info h3 {
        font-size: 16px;
    }
    .store-info p {
        font-size: 13px;
    }
}
.sidebar-recent-list {
    height: auto;
    max-height: none;
    overflow: visible;
}

/* 새 상호작용 없이 장식적 깊이감 */
main {
    position: relative;
    overflow: hidden;
}
main::before {
    content: '';
    position: fixed;
    z-index: 0;
    top: 78px;
    left: 50%;
    width: 720px;
    height: 310px;
    border-radius: 50%;
    background: radial-gradient(
        ellipse at center,
        rgba(var(--color-primary-rgb), 0.12) 0%,
        rgba(59, 130, 246, 0.07) 38%,
        rgba(249, 250, 251, 0) 72%
    );
    transform: translateX(-50%);
    pointer-events: none;
}
main::after {
    content: '';
    position: fixed;
    z-index: 0;
    top: 92px;
    left: 50%;
    width: 560px;
    height: 220px;
    background-image: radial-gradient(rgba(var(--color-primary-rgb), 0.2) 1px, transparent 1px);
    background-size: 18px 18px;
    opacity: 0.3;
    transform: translateX(-50%);
    mask-image: radial-gradient(ellipse at center, #000 0%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 72%);
    pointer-events: none;
}
.wrap {
    position: relative;
    z-index: 1;
}
.heading::before {
    content: '';
    display: block;
    width: 38px;
    height: 4px;
    margin: 0 auto 15px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-primary), var(--color-secondary));
}
.heading h1 {
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
.composer {
    box-shadow:
        0 14px 40px rgba(var(--color-primary-rgb), 0.1),
        0 2px 8px rgba(17, 24, 39, 0.05);
    transition:
        min-height 0.18s ease,
        box-shadow 0.22s ease,
        transform 0.22s ease;
}
.composer:focus-within {
    box-shadow:
        0 18px 46px rgba(var(--color-primary-rgb), 0.16),
        0 3px 10px rgba(17, 24, 39, 0.07);
    transform: translateY(-2px);
}
.store > .panel-title {
    position: relative;
    width: max-content;
    padding-left: 0;
}
.store > .panel-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 4px;
    border-radius: 99px;
    background: linear-gradient(var(--color-secondary), var(--color-primary), var(--color-secondary));
}
.store-card {
    position: relative;
    isolation: isolate;
    background: linear-gradient(160deg, var(--color-background) 58%, var(--color-primary-soft) 100%);
    box-shadow: 0 5px 18px rgba(17, 24, 39, 0.045);
}
.store-card::before {
    position: absolute;
    z-index: 2;
    top: 27px;
    left: 27px;
    padding: 5px 9px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.22);
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 7px rgba(17, 24, 39, 0.08);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    backdrop-filter: blur(5px);
}
.store-card:nth-child(1)::before {
    content: '가이드';
}
.store-card:nth-child(2)::before {
    content: '고객지원';
}
.store-card:nth-child(3)::before {
    content: '문서작성';
}
.store-card .thumb {
    filter: saturate(0.92);
    transition:
        transform 0.3s ease,
        filter 0.3s ease;
}
.store-card:hover,
.store-card:focus-within {
    transform: translateY(-5px);
    border-color: var(--color-primary-border);
    box-shadow: 0 15px 32px rgba(var(--color-primary-rgb), 0.13);
}
.store-card:hover .thumb,
.store-card:focus-within .thumb {
    transform: scale(1.025);
    filter: saturate(1.04);
}
@media (max-width: 767px) {
    main::before {
        top: 62px;
        width: 460px;
        height: 230px;
    }
    main::after {
        top: 73px;
        width: 340px;
        height: 170px;
        background-size: 16px 16px;
    }
    .heading::before {
        width: 32px;
        height: 3px;
        margin-bottom: 12px;
    }
    .composer:focus-within {
        transform: none;
    }
    .store-card::before {
        top: 24px;
        left: 24px;
    }
}

/* 시각적 구성 보강 */
.heading {
    animation: content-rise 0.48s ease-out both;
}
.chat {
    position: relative;
    animation: content-rise 0.52s 0.08s ease-out both;
}
.chat::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: -28px 5%;
    border-radius: 42px;
    background: radial-gradient(
        ellipse at center,
        rgba(var(--color-primary-rgb), 0.18),
        rgba(59, 130, 246, 0.1) 38%,
        transparent 72%
    );
    filter: blur(20px);
    opacity: 0.55;
    transform: scale(0.98);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
    pointer-events: none;
}
.chat:focus-within::before {
    opacity: 0.9;
    transform: scale(1.03);
}
.lower {
    position: relative;
    padding: 24px;
    border: 1px solid rgba(191, 219, 254, 0.6);
    border-radius: 22px;
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.78),
        rgba(239, 246, 255, 0.72)
    );
    box-shadow: 0 12px 32px rgba(var(--color-primary-rgb), 0.055);
    animation: content-rise 0.55s 0.16s ease-out both;
}
.lower::before {
    content: '';
    position: absolute;
    top: 0;
    right: 7%;
    width: 220px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-secondary), transparent);
}
.store-list {
    align-items: stretch;
}
.store-card {
    padding: 0;
    gap: 0;
    overflow: hidden;
    animation: card-rise 0.46s ease-out backwards;
}
.store-card:nth-child(1) {
    animation-delay: 0.22s;
}
.store-card:nth-child(2) {
    animation-delay: 0.29s;
}
.store-card:nth-child(3) {
    animation-delay: 0.36s;
}
.store-card::before {
    top: 12px;
    left: 12px;
}
.store-card .thumb {
    height: 174px;
    border-radius: 0;
}
.store-info {
    min-height: 130px;
    padding: 14px 16px 16px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.96),
        rgba(248, 251, 255, 0.98)
    );
}
.store-info h3 {
    margin-bottom: 5px;
}
.chat-btn {
    margin-top: 12px;
}
@keyframes content-rise {
    from {
        opacity: 0;
        transform: translateY(9px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes card-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@media (max-width: 1199px) {
    .lower {
        padding: 20px;
    }
    .store-card .thumb {
        height: 164px;
    }
    .store-info {
        min-height: 126px;
        padding: 13px 14px 14px;
    }
}
@media (max-width: 767px) {
    .chat::before {
        inset: -18px 2%;
        filter: blur(16px);
    }
    .lower {
        padding: 16px;
        border-radius: 18px;
    }
    .store-card::before {
        top: 11px;
        left: 11px;
    }
    .store-card .thumb {
        height: auto;
        aspect-ratio: 1.8;
    }
    .store-info {
        min-height: 112px;
        padding: 13px 14px 14px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .heading,
    .chat,
    .lower,
    .store-card {
        animation: none;
    }
    .chat::before,
    .composer,
    .store-card,
    .store-card .thumb {
        transition: none;
    }
}

/* 절제된 기관(대학) 톤 스타일 */
main::before {
    top: 84px;
    width: 620px;
    height: 230px;
    background: radial-gradient(
        ellipse at center,
        rgba(var(--color-primary-rgb), 0.065),
        rgba(249, 250, 251, 0) 70%
    );
}
main::after {
    display: none;
}
.heading::before {
    width: 30px;
    height: 3px;
    background: var(--color-primary);
}
.heading h1 {
    text-shadow: none;
}
.chat::before {
    inset: -14px 8%;
    background: rgba(var(--color-primary-rgb), 0.045);
    filter: blur(22px);
    opacity: 1;
    transform: none;
}
.chat:focus-within::before {
    opacity: 1;
    transform: none;
}
.composer {
    box-shadow:
        0 8px 24px rgba(17, 24, 39, 0.07),
        0 1px 3px rgba(17, 24, 39, 0.04);
}
.composer:focus-within {
    box-shadow:
        0 10px 28px rgba(var(--color-primary-rgb), 0.11),
        0 1px 3px rgba(17, 24, 39, 0.05);
}
.lower {
    border-color: var(--color-border);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.045);
}
.lower::before {
    display: none;
}
.store > .panel-title::before {
    background: var(--color-primary);
}
.store-card {
    background: var(--color-background);
    box-shadow: 0 3px 12px rgba(17, 24, 39, 0.04);
}
.store-card::before {
    border-color: #d0ebe6;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 1px 4px rgba(17, 24, 39, 0.06);
}
.store-info {
    background: var(--color-background);
}
.store-card .thumb {
    filter: none;
}
.store-card:hover,
.store-card:focus-within {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.08);
}
.store-card:hover .thumb,
.store-card:focus-within .thumb {
    transform: scale(1.015);
    filter: none;
}
.heading,
.chat,
.lower {
    animation-duration: 0.38s;
}
.store-card {
    animation: none;
}

/* 균일하지 않은 레이아웃을 위한 편집형 디테일 */
.heading {
    position: relative;
    isolation: isolate;
    padding: 24px 90px 26px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 6px 20px rgba(17, 24, 39, 0.035);
}
.heading::before {
    content: 'D-GPT';
    position: relative;
    z-index: 1;
    width: auto;
    height: auto;
    margin: 0 auto 10px;
    padding: 5px 10px;
    display: table;
    border: 1px solid #d0ebe6;
    border-radius: 99px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.7px;
}
.heading::after {
    content: '';
    position: absolute;
    z-index: -1;
    right: -42px;
    top: -58px;
    width: 190px;
    height: 190px;
    border: 28px solid var(--color-primary-soft);
    border-radius: 42px;
    transform: rotate(28deg);
}
.heading h1,
.heading p {
    position: relative;
    z-index: 1;
}
.grid {
    margin-top: 30px;
}
.lower {
    margin-top: 54px;
}
.store > .panel-title {
    display: flex;
    width: max-content;
    max-width: 100%;
    padding-left: 0;
}
.store-card {
    box-shadow:
        inset 0 3px 0 var(--color-secondary),
        0 3px 12px rgba(17, 24, 39, 0.04);
}
.store-card:nth-child(2) {
    box-shadow:
        inset 0 3px 0 var(--color-primary),
        0 3px 12px rgba(17, 24, 39, 0.04);
}
.store-card:nth-child(3) {
    box-shadow:
        inset 0 3px 0 var(--color-secondary),
        0 3px 12px rgba(17, 24, 39, 0.04);
}
.store-card::after {
    position: absolute;
    z-index: 2;
    top: 13px;
    right: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(17, 24, 39, 0.3);
}
.store-card:nth-child(1)::after {
    content: '01';
}
.store-card:nth-child(2)::after {
    content: '02';
}
.store-card:nth-child(3)::after {
    content: '03';
}
.chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.chat-btn::after {
    content: '→';
    font-size: 14px;
    line-height: 1;
    transition: transform 0.18s ease;
}
.store-card:hover .chat-btn::after,
.store-card:focus-within .chat-btn::after {
    transform: translateX(3px);
}
@media (max-width: 767px) {
    .heading {
        padding: 20px 28px 22px;
    }
    .heading::after {
        right: -72px;
        top: -82px;
    }
    .grid {
        margin-top: 24px;
    }
    .lower {
        margin-top: 40px;
    }
}

/* 느린 주변 그라데이션 움직임 */
main::before {
    display: block;
    position: fixed;
    top: 90px;
    right: -120px;
    left: auto;
    width: 560px;
    height: 560px;
    border: 0;
    border-radius: 50%;
    background: radial-gradient(
            circle at 30% 34%,
            rgba(var(--color-primary-rgb), 0.13) 0%,
            transparent 36%
        ),
        radial-gradient(circle at 68% 30%, rgba(96, 165, 250, 0.13) 0%, transparent 38%),
        radial-gradient(
            circle at 44% 68%,
            rgba(59, 130, 246, 0.17) 0%,
            rgba(var(--color-primary-rgb), 0.06) 38%,
            transparent 68%
        );
    filter: blur(18px);
    transform: translate3d(0, 0, 0) scale(1);
    animation: ambient-gradient-one 16s ease-in-out infinite alternate;
}
main::after {
    display: block;
    position: fixed;
    top: auto;
    right: auto;
    bottom: -100px;
    left: -150px;
    width: 580px;
    height: 580px;
    border: 0;
    border-radius: 50%;
    background: radial-gradient(
            circle at 34% 42%,
            rgba(96, 165, 250, 0.1) 0%,
            transparent 34%
        ),
        radial-gradient(circle at 70% 38%, rgba(59, 130, 246, 0.1) 0%, transparent 38%),
        radial-gradient(
            circle at 56% 70%,
            rgba(147, 197, 253, 0.15) 0%,
            rgba(219, 234, 254, 0.07) 40%,
            transparent 70%
        );
    background-image: radial-gradient(
            circle at 34% 42%,
            rgba(96, 165, 250, 0.1) 0%,
            transparent 34%
        ),
        radial-gradient(circle at 70% 38%, rgba(59, 130, 246, 0.1) 0%, transparent 38%),
        radial-gradient(
            circle at 56% 70%,
            rgba(147, 197, 253, 0.15) 0%,
            rgba(219, 234, 254, 0.07) 40%,
            transparent 70%
        );
    filter: blur(22px);
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    mask-image: none;
    -webkit-mask-image: none;
    animation: ambient-gradient-two 20s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes ambient-gradient-one {
    0% {
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    }
    50% {
        transform: translate3d(-36px, 24px, 0) scale(1.07) rotate(5deg);
    }
    100% {
        transform: translate3d(-12px, 58px, 0) scale(0.96) rotate(-3deg);
    }
}
@keyframes ambient-gradient-two {
    0% {
        transform: translate3d(0, 0, 0) scale(0.98) rotate(0deg);
    }
    50% {
        transform: translate3d(42px, -26px, 0) scale(1.06) rotate(-5deg);
    }
    100% {
        transform: translate3d(18px, -62px, 0) scale(1) rotate(4deg);
    }
}
@media (max-width: 767px) {
    main::before {
        top: 100px;
        right: -280px;
        width: 480px;
        height: 480px;
        filter: blur(20px);
    }
    main::after {
        bottom: -80px;
        left: -290px;
        width: 470px;
        height: 470px;
    }
}
@media (prefers-reduced-motion: reduce) {
    main::before,
    main::after {
        animation: none;
    }
}
.heading {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}
.heading::after {
    display: none;
}
@media (max-width: 767px) {
    .heading {
        padding: 0;
    }
}
.heading::before {
    display: none !important;
    content: none !important;
}

/* 밝은 사이드바 */
.sidebar {
    background: var(--color-background);
    border-right-color: var(--color-border);
    color: var(--color-text);
}
.sidebar .menu {
    color: var(--color-text-muted);
}
.sidebar .menu:hover {
    background: var(--color-primary-tint);
    color: var(--color-text);
}
.sidebar .menu.active {
    color: var(--color-background);
    background: var(--color-primary);
}
.sidebar .menu .ico img,
.sidebar .side-group-title .group-arrow,
.sidebar-chat img {
    filter: none;
    opacity: 0.9;
}
.sidebar .menu.active .ico img {
    filter: brightness(0) invert(1);
    opacity: 1;
}
.side-group-title {
    color: var(--color-text-muted);
}
.sidebar-chat {
    color: var(--color-text-muted);
}
.sidebar-chat:hover {
    background: var(--color-primary-tint);
}
.sidebar-account {
    border-top-color: var(--color-primary-tint);
    color: var(--color-text-muted);
}
.sidebar-account strong {
    color: var(--color-primary);
}
.account-row .logout {
    background: var(--color-primary-tint);
    color: var(--color-secondary);
    opacity: 1;
}
.account-row .logout:hover,
.account-row .logout:focus-visible {
    background: var(--color-primary);
    color: var(--color-background);
    opacity: 1;
}
.credit-card {
    border-color: #d0ebe6;
    background: linear-gradient(145deg, var(--color-primary-soft), var(--color-primary-soft));
    box-shadow: none;
}
.credit-head {
    color: var(--color-text-muted);
}
.credit-head strong {
    color: var(--color-primary);
}
.credit-value {
    color: var(--color-text);
}
.credit-value span {
    color: var(--color-text-muted);
}
.credit-track {
    background: var(--color-primary-soft);
}
.sidebar-recent-list .recent-empty {
    color: var(--color-text-muted);
}
.sidebar-recent-list .recent-empty::before {
    background: linear-gradient(145deg, var(--color-primary-soft), var(--color-primary-tint));
    box-shadow: inset 0 0 0 1px #d0ebe6;
}
.sidebar-recent-list:hover {
    scrollbar-color: var(--color-border) transparent;
}
.sidebar-recent-list:hover::-webkit-scrollbar-thumb {
    background: var(--color-border);
}
.sidebar-recent-list:hover::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}
body.sidebar-collapsed .sidebar .menu .ico {
    background: var(--color-primary-tint);
}
body.sidebar-collapsed .sidebar .menu.active {
    background: transparent;
}
body.sidebar-collapsed .sidebar .menu.active .ico {
    background: var(--color-primary);
}
@media (max-width: 767px) {
    .sidebar,
    body.sidebar-collapsed .sidebar {
        background: var(--color-surface);
    }
    .sidebar .menu.active,
    body.sidebar-collapsed .sidebar .menu.active {
        background: var(--color-primary);
    }
    .sidebar .menu .ico,
    body.sidebar-collapsed .sidebar .menu .ico {
        background: transparent;
    }
    .sidebar .menu.active .ico img,
    body.sidebar-collapsed .sidebar .menu.active .ico img {
        filter: brightness(0) invert(1);
    }
}

/* 사이드바 정보 구조: 새 대화, 그룹 메뉴, 슬림 푸터 */
.sidebar-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.new-chat {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 42px;
    min-height: 42px;
    margin-bottom: 8px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #5b6b64;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
}
.new-chat .ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
}
.new-chat .ico img {
    display: block;
    width: 16px;
    height: 16px;
    filter: none;
    opacity: 0.7;
}
.new-chat:hover,
.new-chat:focus-visible {
    background: var(--color-primary-tint);
    color: var(--color-text-muted);
    outline: 0;
}
.new-chat[aria-expanded='true'] {
    background: var(--color-primary-tint);
    box-shadow: none;
}
.side-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.side-section-label {
    margin: 2px 0 4px;
    padding: 0 14px;
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.sidebar .menu {
    height: 42px;
    min-height: 42px;
}
.sidebar-recent {
    margin-top: 12px;
}
.sidebar-recent .side-group-title,
.side-support .side-group-title {
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: none;
}
.sidebar-recent-head {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 34px;
    padding: 0 8px 0 14px;
}
.sidebar-recent-head > .group-label {
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    transform: none;
}
.sidebar-recent-head .recent-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex: none;
}
.sidebar-recent-head .recent-search-btn img {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}
.sidebar-recent-head .recent-search-btn:hover,
.sidebar-recent-head .recent-search-btn:focus-visible {
    background: var(--color-primary-soft);
    outline: 0;
}
.sidebar-recent-head .recent-search-btn:hover img,
.sidebar-recent-head .recent-search-btn:focus-visible img,
.sidebar-recent-head .recent-search-btn.is-active img {
    opacity: 1;
    filter: invert(42%) sepia(72%) saturate(1400%) hue-rotate(198deg) brightness(98%) contrast(92%);
}
.sidebar-recent-head .recent-search-btn.is-active {
    background: var(--color-primary-soft);
}
.sidebar-recent-head .side-group-title {
    width: auto;
    height: 28px;
    margin-left: auto;
    padding: 0 6px;
    flex: none;
}
.sidebar-chat {
    height: 36px;
    padding: 0 10px;
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 400;
}
.sidebar-chat .chat-name {
    max-width: 188px;
}
.sidebar-recent:not(.is-expanded) .sidebar-chat:nth-child(n + 6) {
    display: none;
}
.recent-more {
    display: none;
    width: 100%;
    height: 32px;
    margin-top: 2px;
    padding: 0 14px;
    border-radius: 8px;
    background: transparent;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
}
.sidebar-recent.has-more .recent-more {
    display: block;
}
.sidebar-recent.is-closed .recent-more {
    display: none !important;
}
.recent-more:hover,
.recent-more:focus-visible {
    background: var(--color-primary-tint);
    color: var(--color-primary-hover);
    outline: 0;
}
.side-support {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--color-primary-tint);
}
.side-support .menu {
    height: 40px;
    min-height: 40px;
    font-size: 14px;
}
.side-support .menu[href*='/user/guide'] {
    color: var(--color-primary);
    background: var(--color-primary-soft);
    font-weight: 600;
}
.side-support .menu[href*='/user/guide'] .ico img,
.side-support .menu[href*='/user/guide'] .menu-external-icon {
    opacity: 0.85;
    filter: none;
}
.side-support .menu[href*='/user/guide']:hover,
.side-support .menu[href*='/user/guide']:focus-visible {
    color: var(--color-primary);
    background: var(--color-primary-tint);
    outline: 0;
}
.sidebar-account {
    gap: 8px;
    padding-top: 12px;
}
.account-row {
    gap: 8px;
}
.account-row strong {
    color: var(--color-primary);
    font-size: 13px;
}
.credit-slim {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 2px 2px 0;
}
.credit-slim .credit-head {
    margin: 0;
    font-size: 11px;
}
.credit-slim .credit-head strong {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-text-muted);
}
.credit-slim .credit-pct {
    color: var(--color-primary);
    font-weight: 700;
}
.credit-slim .credit-track {
    height: 5px;
    background: var(--color-primary-soft);
}
.credit-card,
.credit-value {
    display: none;
}
body.sidebar-collapsed .new-chat {
    width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0 auto 4px;
    padding: 0;
    justify-content: center;
    gap: 0;
}
body.sidebar-collapsed .new-chat .ico {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
}
body.sidebar-collapsed .new-chat .menu-label {
    display: none;
}
body.sidebar-collapsed .side-section {
    width: 100%;
    gap: 7px;
}
@media (min-width: 768px) {
    body.sidebar-collapsed .sidebar .menu:hover .menu-label,
    body.sidebar-collapsed .sidebar .menu:focus-visible .menu-label,
    body.sidebar-collapsed .new-chat:hover .menu-label,
    body.sidebar-collapsed .new-chat:focus-visible .menu-label {
        display: block;
        position: absolute;
        z-index: 30;
        left: 54px;
        top: 50%;
        width: max-content;
        max-width: 220px;
        padding: 7px 10px;
        border-radius: 7px;
        background: var(--color-text);
        color: var(--color-background);
        font-size: 13px;
        font-weight: 500;
        line-height: 1.2;
        white-space: nowrap;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
        transform: translateY(-50%);
        pointer-events: none;
    }
    body.sidebar-collapsed .new-chat {
        position: relative;
    }
    body.sidebar-collapsed .new-chat:hover .menu-label::before,
    body.sidebar-collapsed .new-chat:focus-visible .menu-label::before {
        content: '';
        position: absolute;
        right: 100%;
        top: 50%;
        margin-top: -4px;
        border-width: 4px;
        border-style: solid;
        border-color: transparent var(--color-text) transparent transparent;
    }
}
@media (max-width: 767px) {
    .new-chat,
    body.sidebar-collapsed .new-chat {
        width: 100%;
        height: 44px;
        min-height: 44px;
        margin: 0 0 8px;
        padding: 0 13px;
        justify-content: flex-start;
        gap: 12px;
    }
    .new-chat .ico,
    body.sidebar-collapsed .new-chat .ico {
        width: 22px;
        height: 22px;
        flex: 0 0 22px;
    }
    .new-chat .menu-label,
    body.sidebar-collapsed .new-chat .menu-label {
        display: block;
        position: static;
        padding: 0;
        background: transparent;
        color: inherit;
        font-size: inherit;
        box-shadow: none;
        transform: none;
    }
    .new-chat .menu-label::before,
    body.sidebar-collapsed .new-chat .menu-label::before {
        display: none;
    }
    .side-section-label,
    .sidebar-recent,
    .side-support,
    body.sidebar-collapsed .side-section-label,
    body.sidebar-collapsed .sidebar-recent,
    body.sidebar-collapsed .side-support {
        display: block !important;
    }
    .side-group-title,
    body.sidebar-collapsed .side-group-title {
        display: flex !important;
    }
    .sidebar-account,
    body.sidebar-collapsed .sidebar-account {
        display: flex !important;
    }
    .sidebar .menu-label,
    body.sidebar-collapsed .sidebar .menu-label,
    body.sidebar-collapsed .sidebar .menu:hover .menu-label,
    body.sidebar-collapsed .sidebar .menu:focus-visible .menu-label,
    body.sidebar-collapsed .new-chat:hover .menu-label,
    body.sidebar-collapsed .new-chat:focus-visible .menu-label {
        display: block !important;
        position: static;
        width: auto;
        max-width: none;
        padding: 0;
        background: transparent;
        color: inherit;
        font-size: inherit;
        font-weight: inherit;
        line-height: inherit;
        box-shadow: none;
        transform: none;
        pointer-events: auto;
        white-space: nowrap;
    }
    .sidebar .menu-label::before,
    body.sidebar-collapsed .sidebar .menu-label::before,
    body.sidebar-collapsed .sidebar .menu:hover .menu-label::before,
    body.sidebar-collapsed .sidebar .menu:focus-visible .menu-label::before {
        display: none;
        content: none;
    }
    .recent-more,
    body.sidebar-collapsed .recent-more {
        display: none;
    }
    .sidebar-recent.has-more .recent-more,
    body.sidebar-collapsed .sidebar-recent.has-more .recent-more {
        display: block !important;
    }
    .side-support,
    body.sidebar-collapsed .side-support {
        margin-top: auto;
        padding-top: 10px;
        border-top: 1px solid var(--color-primary-tint);
    }
    .side-section-label,
    body.sidebar-collapsed .side-section-label {
        display: block !important;
        margin: 2px 0 4px;
        padding: 0 14px;
    }
}

/* 좁은 사이드바 */
.sidebar {
    width: 260px;
}
.top .brand {
    width: 260px;
    flex: 0 0 260px;
}
.sidebar ~ main,
main {
    margin-left: 260px;
}
.wrap {
    width: min(var(--content-max), calc(100vw - 340px));
    max-width: var(--content-max);
}
.sidebar-rail {
    left: 254px;
}
.sidebar-toggle {
    left: 216px;
}
.sidebar-chat .chat-name {
    max-width: 172px;
}
@media (max-width: 1350px) {
    .wrap {
        width: calc(100vw - 340px);
    }
}
@media (max-width: 767px) {
    .sidebar,
    body.sidebar-collapsed .sidebar {
        width: 260px;
    }
    .sidebar-chat .chat-name {
        max-width: 170px;
    }
}
body.sidebar-collapsed .top .brand {
    width: 76px;
    flex-basis: 76px;
}
body.sidebar-collapsed main {
    margin-left: 76px;
}
body.sidebar-collapsed .wrap {
    width: min(1200px, calc(100vw - 156px));
}
@media (max-width: 767px) {
    .top .brand,
    body.sidebar-collapsed .top .brand {
        width: 100%;
        flex-basis: 100%;
    }
    body.sidebar-collapsed main,
    main {
        margin-left: 0;
    }
    body.sidebar-collapsed .wrap,
    .wrap {
        width: 100%;
    }
}

/* 밝은 사이드바·버튼 그라데이션 */
.sidebar,
body.sidebar-collapsed .sidebar {
    background: var(--color-background);
    border-right-color: var(--color-border);
}
/* 하단 계정·크레딧 영역에 기존 그라데이션 적용 */
.sidebar-account {
    margin: 8px 4px 4px;
    padding: 12px 12px 10px;
    border-top: 0;
    border-radius: 10px;
    background: radial-gradient(
            120% 70% at 0% -8%,
            rgba(59, 130, 246, 0.16),
            transparent 52%
        ),
        radial-gradient(90% 55% at 110% 108%, rgba(96, 165, 250, 0.1), transparent 48%),
        linear-gradient(180deg, #fcfdff 0%, #f1f6fc 48%, var(--color-primary-tint) 100%);
}
.new-chat {
    background: transparent;
    box-shadow: none;
}
.new-chat:hover,
.new-chat:focus-visible {
    background: var(--color-primary-tint);
    box-shadow: none;
}
.sidebar .menu:hover {
    background: linear-gradient(90deg, var(--color-primary-tint), var(--color-primary-soft));
}
.sidebar .menu.active,
.sidebar .menu.active:hover {
    color: var(--color-background);
    background: linear-gradient(
        135deg,
        var(--color-primary-hover) 0%,
        var(--color-primary) 38%,
        var(--color-secondary) 72%,
        var(--color-secondary) 100%
    );
    box-shadow: 0 4px 14px rgba(var(--color-primary-rgb), 0.28);
}
.sidebar-chat:hover {
    background: linear-gradient(90deg, var(--color-primary-soft), var(--color-primary-tint));
}
.recent-more:hover,
.recent-more:focus-visible {
    background: linear-gradient(90deg, var(--color-primary-tint), var(--color-primary-soft));
}
body.sidebar-collapsed .sidebar .menu.active {
    background: transparent;
    box-shadow: none;
}
body.sidebar-collapsed .sidebar .menu.active .ico {
    background: linear-gradient(
        135deg,
        var(--color-primary-hover) 0%,
        var(--color-primary) 40%,
        var(--color-secondary) 100%
    );
}
body.sidebar-collapsed .new-chat,
body.sidebar-collapsed .new-chat:hover {
    background: transparent;
    border: 0;
    box-shadow: none;
}
@media (max-width: 767px) {
    .sidebar,
    body.sidebar-collapsed .sidebar {
        background: var(--color-background);
    }
    .sidebar .menu.active,
    body.sidebar-collapsed .sidebar .menu.active {
        color: var(--color-background);
        background: linear-gradient(
            135deg,
            var(--color-primary-hover) 0%,
            var(--color-primary) 38%,
            var(--color-secondary) 72%,
            var(--color-secondary) 100%
        );
    }
    body.sidebar-collapsed .new-chat,
    body.sidebar-collapsed .new-chat:hover {
        background: transparent;
        color: #5b6b64;
    }
}

/* 템플릿스토어 목록 + 최근 대화 패널 레이아웃 */
.lower {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: stretch;
    margin-top: 54px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}
.lower > .panel {
    height: auto;
    align-self: stretch;
}
.lower .store,
.lower .solutions {
    display: flex;
    flex-direction: column;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: none;
    overflow: hidden;
}
.store {
    height: 456px !important;
    max-height: 456px;
    padding: 20px;
}
.store > .panel-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: max-content;
    max-width: 100%;
    flex: none;
    margin: 0;
    padding-left: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
}
.store > .panel-title::before {
    display: none !important;
    content: none !important;
}
.lower .panel-title-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: none;
}
.lower .panel-title-ico img {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
    opacity: 0.85;
}
.lower .panel-title > span:last-child {
    flex: none;
}
.store .store-page-chips {
    flex: none;
    flex-wrap: nowrap;
    margin: 10px 0 0;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}
.store .store-page-chips::-webkit-scrollbar {
    display: none;
}
.store .store-page-chip {
    height: 28px;
    padding: 0 11px;
    font-size: 12px;
    flex: none;
}
.store-home-empty {
    grid-column: 1 / -1;
    padding: 28px 12px;
    color: var(--color-text-muted);
    font-size: 13px;
    text-align: center;
}
.store-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
    grid-auto-rows: calc((100% - 20px) / 3);
    align-content: start;
    align-items: stretch;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    padding-right: 2px;
}
.store-list::-webkit-scrollbar {
    width: var(--scrollbar-size);
}
.store-list::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}
.store-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(
        180deg,
        var(--color-secondary),
        var(--scrollbar-thumb)
    );
}
.store-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        var(--color-primary),
        var(--scrollbar-thumb-hover)
    );
}
.store-card,
.store-card:nth-child(n),
.store-card:nth-child(3n),
.store-card:nth-child(3n + 1),
.store-card:nth-child(3n + 2),
.store-card:nth-child(2),
.store-card:nth-child(3) {
    height: 100%;
    min-height: 0;
    padding: 10px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: none;
    animation: none;
}
.store-card::before,
.store-card::after {
    display: none !important;
    content: none !important;
}
.store-card:hover,
.store-card:focus-within {
    transform: none;
    border-color: var(--color-border);
    background: var(--color-surface);
    box-shadow: none;
}
.store-card .thumb,
.store-card:hover .thumb,
.store-card:focus-within .thumb {
    width: auto;
    height: 100%;
    max-width: 94px;
    aspect-ratio: 1;
    flex: none;
    border-radius: 8px;
    object-fit: cover;
    transform: none;
    filter: none;
}
.store-info {
    width: auto;
    height: auto;
    min-height: 0;
    min-width: 0;
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: transparent;
}
.store-info h3 {
    margin: 0 0 4px;
    font-size: 15px;
    color: var(--color-text);
    font-weight: 600;
}
.store-info p {
    margin: 0;
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.store .chat-btn,
.chat-btn {
    align-self: flex-start;
    width: auto;
    margin-top: 0;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 500;
    background: var(--color-background);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}
.store .chat-btn::after,
.chat-btn::after {
    display: none;
    content: none;
}
.store-card:hover .chat-btn,
.store-card:focus-within .chat-btn,
.store .chat-btn:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
    border-color: var(--color-border);
}
.recent {
    display: flex;
    flex-direction: column;
    height: 428px !important;
    max-height: 428px;
    padding: 20px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: none;
    overflow: hidden;
}
.recent > .panel-title {
    margin: 0;
    font-size: 18px;
}
.recent-list {
    height: auto;
    min-height: 0;
    flex: 1;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.recent-list .recent-item {
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    flex: 0 0 48px;
    padding: 0 4px;
}
.recent-list .recent-item span {
    width: calc(100% - 34px);
}
.solutions {
    display: flex;
    flex-direction: column;
    height: 456px !important;
    max-height: 456px;
    padding: 20px;
}
.solutions > .panel-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: max-content;
    max-width: 100%;
    margin: 0;
    flex: none;
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
}
.solutions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.solution-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 0;
    height: 118px;
    min-height: 118px;
    max-height: 118px;
    padding: 10px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
}
.solution-card:hover,
.solution-card:focus-within {
    border-color: var(--color-border);
    background: var(--color-surface);
}
.solution-card .thumb,
.solution-thumb {
    width: 64px;
    flex: 0 0 64px;
    align-self: stretch;
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-surface-muted);
}
.solution-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.solution-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}
.solution-info > div {
    min-width: 0;
}
.solution-info h3 {
    margin: 0 0 2px;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.solution-info p {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--color-text-muted);
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.solution-card .chat-btn {
    align-self: flex-start;
    flex: none;
    width: auto;
    margin-top: auto;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 500;
    background: var(--color-background);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}
.solution-card:hover .chat-btn,
.solution-card:focus-within .chat-btn,
.solution-card .chat-btn:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
    border-color: var(--color-border);
}
@media (max-width: 1199px) {
    .lower {
        grid-template-columns: minmax(0, 1fr) 280px;
        gap: 16px;
        margin-top: 44px;
    }
    .store,
    .recent,
    .solutions {
        height: 440px !important;
        max-height: 440px;
    }
    .store-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .store-info h3 {
        font-size: 13px;
    }
    .solution-card {
        height: 112px;
        min-height: 112px;
        max-height: 112px;
    }
    .solution-thumb {
        width: 58px;
        flex: 0 0 58px;
    }
}
@media (max-width: 900px) {
    .lower {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .store,
    .recent,
    .solutions {
        height: 440px !important;
        max-height: 440px;
    }
    .store-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .solutions-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 767px) {
    .lower {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 36px;
    }
    .store,
    .recent,
    .solutions {
        height: 420px !important;
        max-height: 420px;
        padding: 16px;
        border-radius: 14px;
    }
    .store-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .store-card,
    .store-card:nth-child(n) {
        padding: 8px;
        gap: 10px;
    }
    .solutions-list {
        grid-template-columns: 1fr;
    }
    .solutions {
        height: auto !important;
        max-height: none;
    }
    .solution-thumb {
        width: 72px;
        flex: 0 0 72px;
    }
}

/* 태블릿: 펼침/접힘 유지(자동 축소 없음). 펼침 시에만 오버레이 */
@media (max-width: 1199px) and (min-width: 768px) {
    body:not(.page-login) main {
        margin-left: 260px !important;
        transition: none;
    }
    body.sidebar-collapsed main {
        margin-left: 76px !important;
    }
    .wrap {
        width: min(1200px, calc(100vw - 320px)) !important;
        max-width: 100%;
    }
    body.sidebar-collapsed .wrap {
        width: min(1200px, calc(100vw - 156px)) !important;
    }
    .top .brand {
        width: 260px !important;
        flex: 0 0 260px !important;
        padding: 0 20px;
        justify-content: flex-start;
    }
    body.sidebar-collapsed .top .brand {
        width: 76px !important;
        flex: 0 0 76px !important;
        padding: 0 8px;
        justify-content: center;
    }
    .brand > img {
        display: block;
    }
    body.sidebar-collapsed .brand > img {
        display: none;
    }
    .sidebar-toggle {
        left: 216px !important;
        display: flex;
    }
    body.sidebar-collapsed .sidebar-toggle {
        left: 22px !important;
    }
    .sidebar {
        position: fixed;
        z-index: 40;
        width: 260px;
    }
    body.sidebar-collapsed .sidebar {
        width: 76px;
    }
    .sidebar-backdrop {
        display: none;
    }
}
@media (max-width: 767px) {
    main,
    body.sidebar-collapsed main {
        margin-left: 0 !important;
        padding: 92px 16px 32px;
    }
    .wrap,
    body.sidebar-collapsed .wrap {
        width: 100% !important;
        max-width: none;
    }
    .top .brand,
    body.sidebar-collapsed .top .brand {
        width: 100% !important;
        flex: 0 0 100% !important;
        height: 60px;
        padding: 0 12px 0 16px;
        justify-content: space-between;
    }
    .brand > img,
    .brand > a > img,
    body.sidebar-collapsed .brand > img,
    body.sidebar-collapsed .brand > a > img {
        display: block;
        order: 1;
        width: 108px;
        height: 32px;
    }
    body.sidebar-collapsed .brand > a {
        display: block !important;
    }
    .sidebar-toggle {
        display: none !important;
    }
    /* 모바일 기본 닫힘. 열림은 .sidebar-open 일 때만 */
    .sidebar,
    body.sidebar-collapsed .sidebar,
    body:not(.sidebar-collapsed) .sidebar {
        position: fixed;
        z-index: 40;
        top: 60px;
        bottom: 0;
        left: auto;
        right: 0;
        width: min(260px, 86vw) !important;
        transform: translateX(100%) !important;
        transition: transform 0.25s ease;
        box-shadow: none !important;
    }
    body.sidebar-open .sidebar {
        transform: translateX(0) !important;
        box-shadow: -12px 0 30px rgba(17, 24, 39, 0.16) !important;
    }
    .sidebar-backdrop {
        display: block;
        inset: 60px 0 0;
        z-index: 35;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    body.sidebar-open .sidebar-backdrop {
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    body.sidebar-open {
        overflow: hidden;
        touch-action: none;
    }
}

/* 뷰포트 동기화: 사이드바 애니메이션 없음 */
body.sidebar-no-anim .sidebar,
body.sidebar-no-anim .sidebar-backdrop {
    transition: none !important;
}

/* 헤더 계정 영역(우측) */
.top .account {
    margin-left: auto;
    margin-right: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--color-text-muted);
    font-size: 14px;
    white-space: nowrap;
}
.top .credit-remain strong {
    color: var(--color-primary);
    font-weight: 700;
}
.top .welcome strong {
    color: var(--color-primary);
}
.top .divider {
    color: var(--color-border);
}
.top .logout {
    margin-left: 2px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--color-primary);
    color: var(--color-background);
    font-size: 13px;
    font-weight: 600;
}
.top .logout:hover,
.top .logout:focus-visible {
    background: var(--color-primary-hover);
    outline: 0;
}
@media (max-width: 767px) {
    .top .account {
        margin-right: 12px;
        gap: 8px;
        font-size: 13px;
    }
    .top .credit-remain,
    .top .divider {
        display: none;
    }
    .top .welcome {
        display: none;
    }
    .top .logout {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* 입력창 포커스: 테두리 형태 안정 (속도 변경 시 애니메이션이 재시작되므로 투명도만 조정) */
.composer {
    box-shadow: none;
    transition: min-height 0.18s ease;
}
.composer::before {
    opacity: 0.92;
    transition: opacity 0.25s ease;
}
.composer::after {
    inset: 2px;
    border-radius: 18px;
    box-shadow: none;
    transition: none;
}
.composer:focus-within {
    transform: none;
    box-shadow: none;
}
.composer:focus-within::before {
    opacity: 1;
}
.composer:focus-within::after {
    inset: 2px;
    box-shadow: none;
}
.composer textarea {
    caret-color: var(--color-primary);
}
.composer textarea:focus {
    outline: none;
}
.composer textarea:focus::placeholder {
    color: #b0b8c1;
}
.chat:focus-within::before {
    opacity: 1;
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    .composer:focus-within::before {
        opacity: 1;
    }
}
@media (max-width: 767px) {
    .composer:focus-within {
        transform: none;
        box-shadow: none;
    }
}

/* 모델 선택 팝업: 좌측 탭 + 모델 목록 */
.model-backdrop {
    background: transparent;
    backdrop-filter: none;
}
.model-picker,
.model-picker.is-open {
    position: fixed;
    z-index: 91;
    left: auto;
    top: auto;
    right: auto;
    bottom: auto;
    display: none;
    flex-direction: column;
    width: 520px;
    max-width: calc(100vw - 16px);
    height: min(560px, calc(100vh - 24px));
    max-height: min(560px, calc(100vh - 24px));
    min-height: min(560px, calc(100vh - 24px));
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    transform: none;
    overflow: hidden;
    background: var(--color-background);
    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.12),
        0 2px 8px rgba(15, 23, 42, 0.04);
}
.model-picker.is-open {
    display: flex;
    animation: model-popover-in 0.16s ease both;
}
.model-picker-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex: none;
    padding: 14px 16px 12px;
    background: var(--color-background);
    border-bottom: 1px solid var(--color-border);
}
.model-picker-title {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.model-picker-body {
    display: flex;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}
.model-tabs {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 0 0 148px;
    width: 148px;
    padding: 10px 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
}
.model-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}
.model-tab-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 7px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
}
.model-tab-ico img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}
.model-tab-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.model-tab:hover,
.model-tab:focus-visible {
    outline: 0;
    background: var(--color-background);
    border-color: var(--color-border);
    color: var(--color-text);
}
.model-tab.is-active {
    background: var(--color-primary-soft);
    border-color: var(--color-primary-border);
    color: var(--color-primary-hover);
}
.model-tab.is-active .model-tab-ico {
    border-color: var(--color-primary-border);
}
.model-panels {
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px;
    background: linear-gradient(180deg, var(--color-background) 0%, var(--color-surface) 100%);
}
.model-picker.from-sidebar.is-open {
    animation-name: model-popover-in-right;
}
.model-picker.from-composer.is-open {
    animation-name: model-popover-in-down;
}
@keyframes model-popover-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes model-popover-in-right {
    from {
        opacity: 0;
        transform: translateX(-6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@keyframes model-popover-in-up {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@keyframes model-popover-in-down {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
.model-group {
    display: none;
    padding: 0;
}
.model-group.is-active {
    display: block;
}
.model-group + .model-group {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}
.model-all-section + .model-all-section {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}
.model-provider {
    display: none;
    align-items: center;
    gap: 8px;
    margin: 0 6px 8px;
    padding: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--color-text-muted);
    background: transparent;
    border: 0;
}
.model-provider::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.12);
    flex: none;
}
.model-group.is-all .model-provider {
    display: flex;
}
.model-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
}
.model-option {
    display: flex;
    align-items: flex-start;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 10px 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    font-size: 13px;
    gap: 10px;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}
.model-option-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.model-option-ico img,
.model-option img {
    width: 18px;
    height: 18px;
    flex: none;
    margin: 0;
    object-fit: contain;
}
.model-option-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
    padding-top: 1px;
}
.model-option-name {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.model-option-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: capitalize;
}
.model-option-state {
    display: inline-flex;
    flex: none;
    align-items: center;
    padding: 2px 6px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}
.model-option-desc {
    display: block;
    color: var(--color-text-muted);
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
}
.model-option:hover,
.model-option:focus-visible {
    outline: 0;
    background: var(--color-background);
    border-color: var(--color-border);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}
.model-option.is-disabled,
.model-option.is-disabled:hover,
.model-option.is-disabled:focus-visible {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    opacity: 0.48;
    cursor: not-allowed;
}
.model-option.is-disabled .model-option-ico img {
    filter: grayscale(1);
}
.model-option.is-selected {
    background: var(--color-primary-soft);
    border-color: var(--color-primary-border);
    box-shadow: 0 0 0 1px rgba(var(--color-primary-rgb), 0.08);
    color: inherit;
}
.model-option.is-selected .model-option-ico {
    border-color: var(--color-primary-border);
    background: var(--color-background);
}
.model-option.is-selected .model-option-name {
    color: var(--color-primary-hover);
}
.model-option.is-selected .model-option-desc {
    color: var(--color-text-muted);
}
@media (max-width: 767px) {
    .model-picker,
    .model-picker.is-open {
        width: min(520px, calc(100vw - 24px));
        height: min(560px, 75vh, calc(100vh - 24px));
        max-height: min(560px, 75vh, calc(100vh - 24px));
        min-height: min(560px, 75vh, calc(100vh - 24px));
        padding: 0;
    }
    .model-tabs {
        flex-basis: 112px;
        width: 112px;
        padding: 8px 6px;
    }
    .model-tab {
        padding: 8px;
        font-size: 11px;
    }
    .model-tab-label {
        display: none;
    }
    .model-tab {
        justify-content: center;
    }
    .model-panels {
        padding: 8px;
    }
    .model-options {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 0;
    }
    .model-option {
        height: auto;
        min-height: 0;
        font-size: 13px;
    }
}

/* 모델 선택(새 대화): 메뉴 호버와 동일 */
.new-chat {
    color: var(--color-text-muted);
}
.new-chat .ico img {
    opacity: 0.9;
}
.new-chat:hover,
.new-chat:focus-visible,
.new-chat[aria-expanded='true'] {
    background: linear-gradient(90deg, var(--color-primary-tint), var(--color-primary-soft));
    color: var(--color-text);
    box-shadow: none;
}
.new-chat:hover .ico img,
.new-chat:focus-visible .ico img,
.new-chat[aria-expanded='true'] .ico img {
    opacity: 1;
}
body.sidebar-collapsed .new-chat:hover .ico,
body.sidebar-collapsed .new-chat:focus-visible .ico,
body.sidebar-collapsed .new-chat[aria-expanded='true'] .ico {
    background: linear-gradient(90deg, var(--color-primary-tint), var(--color-primary-soft));
    border-radius: 10px;
}

/* 앵커 메뉴 */
a.menu,
a.new-chat {
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

/* 이미지 영역 로딩 애니메이션 */
@keyframes image-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}
.image-shimmer {
    position: relative;
    overflow: hidden;
    background: var(--color-surface-muted);
}
.image-shimmer.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    background: linear-gradient(
        90deg,
        var(--color-surface-muted) 0%,
        var(--color-border) 30%,
        var(--color-text-muted) 60%,
        var(--color-text-muted) 100%
    );
    transform: translateX(-100%);
    animation: image-shimmer 1s linear infinite;
}
.image-shimmer.is-loading img {
    opacity: 0;
}
.image-shimmer.is-loaded img {
    opacity: 1;
    transition: opacity 0.22s ease;
}
.store-card .image-shimmer {
    width: auto;
    height: 100%;
    max-width: 94px;
    aspect-ratio: 1;
    flex: none;
    border-radius: 8px;
}
.store-card .image-shimmer .thumb {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}
@media (max-width: 1199px) {
    .store-card .image-shimmer {
        max-width: 88px;
    }
}
@media (max-width: 767px) {
    .store-card .image-shimmer {
        max-width: 90px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .image-shimmer.is-loading::after {
        animation: none;
        opacity: 0.35;
    }
}

/* 데스크톱·태블릿: 사이드바 접힘 시 로고 숨김(모바일은 유지) */
@media (min-width: 768px) {
    body.sidebar-collapsed .brand > img,
    body.sidebar-collapsed .brand > a {
        display: none !important;
    }
}
@media (max-width: 767px) {
    body.sidebar-collapsed .brand > img,
    body.sidebar-collapsed .brand > a {
        display: block !important;
    }
}

/* ==========================================================================
   공지사항 페이지 (notice.html)
   ========================================================================== */

.page-notice .wrap.notice-wrap {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding-bottom: 48px;
}
body.sidebar-collapsed.page-notice .wrap.notice-wrap {
    width: 100%;
    max-width: var(--content-max);
}

.notice-hero {
    margin: 0 0 28px;
    text-align: left;
}
.notice-hero h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.6px;
    color: var(--color-text);
}
.notice-hero p {
    margin: 0;
    font-size: 15px;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.notice-panel {
    padding: 24px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-background);
}

.notice-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 14px;
    margin-bottom: 20px;
}
.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.filter-field label {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
}
.date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}
.date-range input,
.filter-category select {
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-background);
    color: var(--color-text);
    font-size: 14px;
}
.date-range input {
    width: 148px;
}
.filter-category select {
    min-width: 128px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}
.filter-keyword {
    flex: 1;
    min-width: 220px;
}
.filter-keyword .app-search {
    width: 100%;
}
.range-sep {
    color: var(--color-text-muted);
    font-size: 13px;
}
.notice-search-btn {
    height: 40px;
    padding: 0 18px;
    border-radius: 8px;
    background: var(--color-primary);
    color: var(--color-background);
    font-size: 14px;
    font-weight: 600;
}
.notice-search-btn:hover,
.notice-search-btn:focus-visible {
    background: var(--color-primary-hover);
    outline: 0;
}

.notice-table-wrap {
    overflow: visible;
    border: 1px solid var(--color-border);
    border-radius: 10px;
}
.notice-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.notice-table thead th {
    padding: 13px 16px;
    background: linear-gradient(
        180deg,
        #f5f5f6 0%,
        var(--color-surface-muted) 100%
    );
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.2px;
    text-align: center;
    white-space: nowrap;
    border: 0;
    border-bottom: 1px solid var(--color-border);
}
.notice-table thead th.col-title {
    text-align: left;
    width: auto;
}
.notice-table .col-author {
    width: 120px;
}
.notice-table .col-date {
    width: 140px;
}
.notice-table .col-file {
    width: 110px;
}
.notice-table .col-action {
    width: 100px;
}
.notice-table tbody td {
    padding: 15px 16px;
    border-top: 1px solid #eceff3;
    color: var(--color-text-muted);
    font-size: 14px;
    text-align: center;
    vertical-align: middle;
    background: var(--color-background);
}
.notice-table tbody tr:first-child td {
    border-top: 0;
}
.notice-table tbody tr:hover {
    position: relative;
    z-index: 2;
}
.notice-table tbody tr:hover td {
    background: #f8fafb;
}
.notice-table td.col-title {
    position: relative;
    overflow: visible;
    text-align: left;
    font-weight: 500;
    color: var(--color-text);
}
.notice-file {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
}
.notice-file img {
    width: 18px;
    height: 18px;
    opacity: 0.35;
}
.notice-file.is-empty {
    visibility: hidden;
}
.notice-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-background);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.notice-view-btn:hover,
.notice-view-btn:focus-visible {
    background: var(--color-surface);
    border-color: var(--color-primary);
    color: var(--color-primary);
    outline: 0;
}
.notice-title-link {
    display: block;
    position: relative;
    overflow: visible;
    color: inherit;
    text-decoration: none;
}
.notice-title-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.notice-title-link:hover,
.notice-title-link:focus-visible {
    color: var(--color-primary);
    text-decoration: underline;
    outline: 0;
}
.notice-title-link[data-tooltip]:hover::after,
.notice-title-link[data-tooltip]:focus-visible::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 16px;
    bottom: calc(100% - 6px);
    z-index: 8;
    max-width: min(520px, calc(100% - 32px));
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--color-text);
    color: var(--color-background);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: -0.2px;
    white-space: normal;
    word-break: keep-all;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    pointer-events: none;
}

.notice-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
}
.page-btn {
    min-width: 40px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-background);
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 500;
}
.page-btn:hover,
.page-btn:focus-visible {
    border-color: var(--color-primary-border);
    background: var(--color-surface);
    color: var(--color-primary);
    outline: 0;
}
.page-btn.is-current {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-weight: 700;
}
.page-btn--edge {
    min-width: 64px;
}
.page-btn:disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.page-notice a.menu,
.page-notice a.new-chat {
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.page-notice main {
    padding-left: 28px;
    padding-right: 28px;
}

@media (max-width: 1199px) {
    .page-notice .wrap.notice-wrap,
    body.sidebar-collapsed.page-notice .wrap.notice-wrap {
        width: 100%;
        max-width: var(--content-max);
    }
}
@media (max-width: 900px) {
    .notice-filter {
        flex-direction: column;
        align-items: stretch;
    }
    .date-range input {
        flex: 1;
        width: auto;
    }
    .filter-category select,
    .filter-keyword,
    .filter-keyword .app-search {
        width: 100%;
    }
    .notice-table .col-author,
    .notice-table .col-file {
        display: none;
    }
}
@media (max-width: 767px) {
    .page-notice .wrap.notice-wrap,
    body.sidebar-collapsed.page-notice .wrap.notice-wrap {
        width: 100%;
    }
    .page-notice main {
        padding-left: 16px;
        padding-right: 16px;
    }
    .notice-hero h1 {
        font-size: 24px;
    }
    .notice-panel {
        padding: 16px;
        border-radius: 14px;
    }
    .notice-table thead th,
    .notice-table tbody td {
        padding: 12px 10px;
        font-size: 13px;
    }
    .notice-table .col-date {
        width: 96px;
    }
    .notice-table .col-action {
        width: 72px;
    }
}

/* ==========================================================================
   공지사항 상세 (notice-detail.html)
   ========================================================================== */
.page-notice-detail .notice-detail-wrap {
    max-width: var(--content-max);
}
.page-notice-detail .notice-hero {
    margin-bottom: 16px;
}
.notice-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--color-text-muted);
}
.notice-breadcrumb a {
    color: var(--color-text-muted);
    text-decoration: none;
}
.notice-breadcrumb a:hover {
    color: var(--color-primary);
}
.crumb-sep {
    opacity: 0.5;
}
.crumb-current {
    color: var(--color-text);
    font-weight: 600;
}
.notice-detail-panel {
    padding: 28px 32px 24px;
}
.notice-detail-head {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}
.notice-detail-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.notice-cat {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    font-size: 12px;
    font-weight: 700;
}
.notice-cat[data-cat='update'] {
    background: #eff6ff;
    color: #1d4ed8;
}
.notice-cat[data-cat='event'] {
    background: #fef3c7;
    color: #b45309;
}
.notice-detail-date {
    color: var(--color-text-muted);
    font-size: 13px;
}
.notice-detail-title {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.4px;
    line-height: 1.35;
    color: var(--color-text);
    word-break: keep-all;
}
.notice-detail-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    font-size: 13px;
}
.notice-detail-sub strong {
    color: var(--color-text);
    font-weight: 600;
}
.notice-detail-sub .dot {
    opacity: 0.5;
}
.notice-detail-body {
    padding: 28px 0 8px;
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.75;
    word-break: keep-all;
}
.notice-detail-body p {
    margin: 0 0 6px;
}
.notice-detail-body p.blank {
    margin: 0 0 10px;
}
.notice-attach {
    margin-top: 8px;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
}
.notice-attach h2 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
}
.notice-attach-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.notice-attach-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-background);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}
.notice-attach-item:hover,
.notice-attach-item:focus-visible {
    border-color: var(--color-primary-border);
    background: var(--color-primary-soft);
    outline: 0;
}
.notice-attach-item img {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}
.notice-detail-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}
.notice-nav-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-background);
    text-decoration: none;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}
.notice-nav-item:hover:not(.is-disabled) {
    background: var(--color-primary-soft);
    border-color: var(--color-primary-border);
}
.notice-nav-item.is-next {
    text-align: right;
    align-items: flex-end;
}
.notice-nav-item .nav-label {
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
}
.notice-nav-item .nav-title {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.notice-nav-item.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}
.notice-detail-actions {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}
.notice-list-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    height: 42px;
    padding: 0 20px;
    border-radius: 10px;
    background: linear-gradient(
        135deg,
        var(--color-primary-hover) 0%,
        var(--color-primary) 50%,
        var(--color-secondary) 100%
    );
    color: var(--color-background);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.22);
}
.notice-list-btn:hover,
.notice-list-btn:focus-visible {
    filter: brightness(1.04);
    outline: 0;
}
@media (max-width: 767px) {
    .notice-detail-panel {
        padding: 20px 16px 18px;
    }
    .notice-detail-title {
        font-size: 20px;
    }
    .notice-detail-nav {
        grid-template-columns: 1fr;
    }
    .notice-nav-item.is-next {
        text-align: left;
        align-items: flex-start;
    }
}

/* ==========================================================================
   템플릿그룹설정 / 등록·수정
   ========================================================================== */

/* 공통 버튼 (그라데이션 없음) */
.tg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
}
.tg-btn--sm {
    height: 32px;
    min-width: 72px;
    padding: 0 12px;
    font-size: 13px;
}
.tg-btn--muted {
    background: #6b7280;
    color: #fff;
}
.tg-btn--muted:hover,
.tg-btn--muted:focus-visible {
    background: #4b5563;
    outline: 0;
}
.tg-btn--primary {
    background: var(--color-primary);
    color: var(--color-background);
}
.tg-btn--primary:hover,
.tg-btn--primary:focus-visible {
    background: var(--color-primary-hover);
    outline: 0;
}
.tg-btn--ghost {
    background: var(--color-background);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.tg-btn--ghost:hover,
.tg-btn--ghost:focus-visible {
    background: var(--color-surface);
    outline: 0;
}
.tg-btn--ghost-danger {
    background: transparent;
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.28);
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
}
.tg-btn--ghost-danger:hover,
.tg-btn--ghost-danger:focus-visible {
    background: rgba(220, 38, 38, 0.06);
    outline: 0;
}

/* --- 목록: 공지사항 레이아웃 재사용 --- */
.page-tg-list .tg-list-table .col-check {
    width: 52px;
}
.page-tg-list .tg-list-table .col-name {
    width: auto;
    text-align: left;
}
.page-tg-list .tg-list-table .col-count {
    width: 100px;
}
.page-tg-list .tg-list-table .col-author {
    width: 120px;
}
.page-tg-list .tg-list-table .col-datetime {
    width: 180px;
}
.page-tg-list .tg-list-table .col-action {
    width: 110px;
}
.page-tg-list .tg-list-table thead th.col-name {
    text-align: left;
    color: var(--color-text);
}
.page-tg-list .tg-list-table tbody td.col-name {
    text-align: left;
    font-weight: 500;
    color: var(--color-text);
}
.page-tg-list .tg-empty {
    padding: 40px !important;
    text-align: center;
    color: var(--color-text-muted);
}
.page-tg-list .tg-list-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 24px;
}
.page-tg-list .tg-list-hero-text {
    min-width: 0;
}
.page-tg-list .tg-list-actions {
    display: flex;
    flex-shrink: 0;
    gap: 10px;
    margin-top: 4px;
}
@media (max-width: 767px) {
    .page-tg-list .tg-list-table .col-author,
    .page-tg-list .tg-list-table .col-datetime {
        display: none;
    }
    .page-tg-list .tg-list-hero {
        flex-direction: column;
        align-items: stretch;
    }
    .page-tg-list .tg-list-actions {
        margin-top: 0;
        flex-wrap: wrap;
    }
    .page-tg-list .tg-list-actions .tg-btn {
        flex: 1;
    }
}

/* --- 등록/수정: 회원정보 구성 참고 --- */
.page-tg-form .wrap.tg-wrap {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding-bottom: 48px;
}
body.sidebar-collapsed.page-tg-form .wrap.tg-wrap {
    width: 100%;
    max-width: var(--content-max);
}
.page-tg-form main {
    padding-left: 28px;
    padding-right: 28px;
}
.page-tg-form .tg-hero {
    margin: 0 0 28px;
    text-align: left;
}
.page-tg-form .tg-hero h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.6px;
    color: var(--color-text);
}
.page-tg-form .tg-hero p {
    margin: 0;
    font-size: 15px;
    color: var(--color-text-muted);
    line-height: 1.5;
}
.page-tg-form .tg-panel {
    padding: 28px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-background);
}
.page-tg-form .tg-section + .tg-section {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--color-surface-muted);
}
.page-tg-form .tg-section-title {
    margin: 0 0 18px;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.2px;
}
.page-tg-form .tg-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.page-tg-form .tg-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.page-tg-form .tg-field--full {
    grid-column: 1 / -1;
}
.page-tg-form .tg-field label {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
}
.page-tg-form .tg-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-background);
    color: var(--color-text);
    font-size: 14px;
    box-sizing: border-box;
}
.page-tg-form .tg-textarea {
    height: auto;
    min-height: 88px;
    padding: 10px 12px;
    resize: vertical;
    line-height: 1.5;
}
.page-tg-form .tg-input:focus {
    outline: 2px solid rgba(var(--color-primary-rgb), 0.35);
    border-color: var(--color-primary);
}
.page-tg-form .tg-member-tools {
    display: block;
    margin-bottom: 14px;
}
.page-tg-form .tg-member-tools .app-search {
    width: 100%;
}
.page-tg-form .tg-member-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}
.page-tg-form .tg-member-pane {
    display: flex;
    flex-direction: column;
    min-height: 320px;
    max-height: 420px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    overflow: hidden;
}
.page-tg-form .tg-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-background);
}
.page-tg-form .tg-pane-head strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
}
.page-tg-form .tg-pane-meta {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 600;
}
.page-tg-form .tg-tree,
.page-tg-form .tg-member-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 8px;
}
.page-tg-form .tg-tree-root {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
}
.page-tg-form .tg-tree-root::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.18);
}
.page-tg-form .tg-tree-item,
.page-tg-form .tg-member-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--color-text);
    font-size: 13px;
    cursor: pointer;
}
.page-tg-form .tg-tree-item:hover,
.page-tg-form .tg-member-item:hover {
    background: rgba(var(--color-primary-rgb), 0.06);
}
.page-tg-form .tg-tree-item.is-open {
    background: rgba(var(--color-primary-rgb), 0.08);
}
.page-tg-form .tg-tree-children {
    display: none;
    padding: 2px 0 6px 28px;
}
.page-tg-form .tg-tree-item.is-open + .tg-tree-children {
    display: block;
}
.page-tg-form .tg-tree-child {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--color-text-muted);
    cursor: pointer;
}
.page-tg-form .tg-tree-child:hover {
    background: rgba(var(--color-primary-rgb), 0.06);
    color: var(--color-text);
}
.page-tg-form .tg-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: none;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-background);
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}
.page-tg-form .tg-tree-toggle:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.page-tg-form .tg-member-transfer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.page-tg-form .tg-transfer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-background);
    cursor: pointer;
}
.page-tg-form .tg-transfer-btn:hover,
.page-tg-form .tg-transfer-btn:focus-visible {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.06);
    outline: 0;
}
.page-tg-form .tg-transfer-ico {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}
.page-tg-form .tg-transfer-ico--right {
    transform: rotate(-90deg);
}
.page-tg-form .tg-transfer-ico--left {
    transform: rotate(90deg);
}
.page-tg-form .tg-member-actions {
    display: flex;
    justify-content: flex-end;
    padding: 10px 12px;
    border-top: 1px solid var(--color-border);
    background: var(--color-background);
}
.page-tg-form .tg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--color-surface-muted);
}
.page-tg-form a.menu,
.page-tg-form a.new-chat {
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}
@media (max-width: 900px) {
    .page-tg-form .tg-member-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .page-tg-form .tg-member-transfer {
        flex-direction: row;
        padding: 4px 0;
    }
    .page-tg-form .tg-transfer-ico--right {
        transform: rotate(0deg);
    }
    .page-tg-form .tg-transfer-ico--left {
        transform: rotate(180deg);
    }
    .page-tg-form .tg-member-pane {
        min-height: 260px;
        max-height: 340px;
    }
}
@media (max-width: 767px) {
    .page-tg-form main {
        padding-left: 16px;
        padding-right: 16px;
    }
    .page-tg-form .wrap.tg-wrap,
    body.sidebar-collapsed.page-tg-form .wrap.tg-wrap {
        max-width: none;
    }
    .page-tg-form .tg-hero h1 {
        font-size: 24px;
    }
    .page-tg-form .tg-panel {
        padding: 16px;
        border-radius: 14px;
    }
    .page-tg-form .tg-actions {
        flex-wrap: wrap;
    }
    .page-tg-form .tg-actions .tg-btn {
        flex: 1;
    }
}

/* ==========================================================================
   MY템플릿 목록 (template.html)
   ========================================================================== */
.page-tpl .wrap.tpl-wrap {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding-bottom: 48px;
}
body.sidebar-collapsed.page-tpl .wrap.tpl-wrap {
    width: 100%;
    max-width: var(--content-max);
}
.page-tpl main {
    padding-left: 28px;
    padding-right: 28px;
}
.page-tpl a.menu,
.page-tpl a.new-chat {
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.tpl-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.tpl-top-title h1 {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.6px;
    color: var(--color-text);
}
.tpl-top-title p {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.45;
}
.tpl-search {
    min-width: 0;
}
.tpl-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}
.tpl-create-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--color-primary);
    color: var(--color-background);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
}
.tpl-create-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}
.tpl-create-btn:hover,
.tpl-create-btn:focus-visible {
    background: var(--color-primary-hover);
    outline: 0;
}

.tpl-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}
.tpl-tab {
    position: relative;
    height: 42px;
    padding: 0 16px;
    border: 0;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.tpl-tab.is-active {
    color: var(--color-primary);
}
.tpl-tab.is-active::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--color-primary);
}

.tpl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}
.tpl-chip {
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.tpl-chip.is-active {
    background: var(--color-primary);
    color: var(--color-background);
}
.tpl-chip:not(.is-active):hover {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.tpl-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.tpl-grid.is-list {
    grid-template-columns: 1fr;
    gap: 10px;
}
.tpl-grid.is-list .tpl-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
}
.tpl-grid.is-list .tpl-card-media {
    height: 100%;
    min-height: 132px;
    aspect-ratio: auto;
}
.tpl-grid.is-list .tpl-card-body {
    justify-content: center;
    padding-right: 58px;
}
.tpl-empty {
    grid-column: 1 / -1;
    padding: 64px 20px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
    border: 1px dashed var(--color-border);
    border-radius: 16px;
    background: var(--color-surface);
}
.tpl-card {
    display: flex;
    position: relative;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-background);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tpl-card:hover {
    border-color: var(--color-primary-border);
    box-shadow: 0 8px 24px rgba(var(--color-primary-rgb), 0.08);
}
.tpl-like-btn {
    display: inline-flex;
    position: absolute;
    z-index: 4;
    top: 10px;
    right: 10px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #8a949e;
    box-shadow: 0 3px 10px rgba(17, 24, 39, 0.14);
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition:
        color 0.16s ease,
        background-color 0.16s ease,
        transform 0.16s ease;
}
.tpl-like-btn svg {
    fill: transparent;
    stroke: currentColor;
    stroke-width: 1.8;
    transition: fill 0.16s ease;
}
.tpl-like-btn:hover,
.tpl-like-btn:focus-visible {
    outline: 0;
    color: #f59e0b;
    transform: scale(1.08);
}
.tpl-like-btn.is-active {
    color: #fbbf24;
    background: #fffbeb;
}
.tpl-like-btn.is-active svg {
    fill: currentColor;
}
.tpl-like-btn:active {
    transform: scale(0.94);
}
.tpl-card-media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-surface-muted);
}
.tpl-card-media.image-shimmer {
    width: 100%;
    border-radius: 0;
}
.tpl-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tpl-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 14px 16px;
    flex: 1;
}
.tpl-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.tpl-card-meta-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.tpl-cat {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
}
.tpl-chat-btn {
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--color-primary);
    border-radius: 999px;
    background: var(--color-background);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.tpl-chat-btn:hover,
.tpl-chat-btn:focus-visible {
    background: var(--color-primary-soft);
    outline: 0;
}
.tpl-vis-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 8px 0 6px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-background);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.tpl-vis-toggle-track {
    position: relative;
    width: 28px;
    height: 16px;
    border-radius: 999px;
    background: #d1d5db;
    flex: none;
    transition: background 0.16s ease;
}
.tpl-vis-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    transition: transform 0.16s ease;
}
.tpl-vis-toggle.is-public {
    border-color: var(--color-primary-border);
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
.tpl-vis-toggle.is-public .tpl-vis-toggle-track {
    background: var(--color-primary);
}
.tpl-vis-toggle.is-public .tpl-vis-toggle-thumb {
    transform: translateX(12px);
}
.tpl-vis-toggle:hover,
.tpl-vis-toggle:focus-visible {
    border-color: var(--color-primary-border);
    outline: 0;
}

.tpl-share-modal[hidden] {
    display: none !important;
}
.tpl-share-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tpl-share-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
}
.tpl-share-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    border-radius: 16px;
    background: var(--color-background);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}
.tpl-share-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--color-border);
}
.tpl-share-modal-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.tpl-share-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}
.tpl-share-modal-close:hover {
    background: var(--color-surface-muted);
}
.tpl-share-modal-close img {
    width: 14px;
    height: 14px;
    display: block;
}
.tpl-share-modal-body {
    padding: 18px;
}
.tpl-share-modal-desc {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}
.tpl-share-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
    margin: 0 0 18px;
    padding: 4px;
}
.tpl-share-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 12px 12px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-background);
    cursor: pointer;
}
.tpl-share-item:hover {
    border-color: var(--color-primary-border);
    background: var(--color-primary-soft);
}
.tpl-share-item.is-checked {
    border-color: var(--color-primary-border);
    background: var(--color-primary-soft);
}
.tpl-share-item input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--color-primary);
    flex: none;
}
.tpl-share-item-text {
    min-width: 0;
    flex: 1;
}
.tpl-share-item-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
}
.tpl-share-item-meta {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--color-text-muted);
}
.tpl-share-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
body.tpl-share-modal-open {
    overflow: hidden;
}
.tpl-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--color-text);
    line-height: 1.35;
}
.tpl-card-desc {
    margin: 0;
    flex: 1;
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tpl-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
}
.tpl-mini-btn {
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-background);
    color: var(--color-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.tpl-mini-btn:hover,
.tpl-mini-btn:focus-visible {
    border-color: var(--color-primary);
    color: var(--color-primary);
    outline: 0;
}

@media (max-width: 1100px) {
    .tpl-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 900px) {
    .tpl-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 767px) {
    .page-tpl main {
        padding-left: 16px;
        padding-right: 16px;
    }
    .page-tpl .wrap.tpl-wrap,
    body.sidebar-collapsed.page-tpl .wrap.tpl-wrap {
        max-width: none;
    }
    .tpl-top-title h1 {
        font-size: 24px;
    }
    .tpl-toolbar {
        grid-template-columns: 1fr;
    }
    .tpl-create-btn {
        width: 100%;
    }
    .tpl-grid {
        grid-template-columns: 1fr;
    }
    .tpl-grid.is-list .tpl-card {
        grid-template-columns: 120px minmax(0, 1fr);
    }
    .tpl-grid.is-list .tpl-card-media {
        min-height: 142px;
    }
}

/* ==========================================================================
   대화창 페이지 (chat.html)
   ========================================================================== */
.page-chat a.menu,
.page-chat a.new-chat {
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}
.page-chat main,
body.sidebar-collapsed.page-chat main {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;

    /*2026-10-19 추가 : gpt-main 에 스크롤 생기도록 수정*/
    overflow-x: hidden;
    overflow-y: auto;
}
.page-chat .chat-room {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 18px 0 14px;
    box-sizing: border-box;
}
.page-chat .chat-room-top {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 4;
    display: flex;
    justify-content: flex-end;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
}
.page-chat .chat-popout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--color-background) 90%, transparent);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}
.page-chat .chat-popout img {
    display: block;
    width: 18px;
    height: 18px;
    opacity: 0.72;
}
.page-chat .chat-popout:hover {
    border-color: var(--color-primary-border);
    background: var(--color-primary-soft);
}
.page-chat .chat-popout:hover img {
    opacity: 1;
}
.page-chat .chat-popout:focus-visible {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.16);
}
.page-chat .chat-model-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--color-primary-border);
    background: rgba(255, 255, 255, 0.88);
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.2px;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    text-transform: capitalize;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}
.page-chat .chat-model-badge:hover {
    background: var(--color-primary-soft);
    border-color: color-mix(in srgb, var(--color-primary) 48%, #ffffff);
}
.page-chat .chat-model-badge img {
    width: 14px;
    height: 14px;
    display: block;
}
.page-chat .chat-room-scroll {
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 4px 0 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
.page-chat .chat-room-thread {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 4px;
    box-sizing: border-box;
}
.page-chat [data-role='chatBox'] {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}
.page-chat .chat-bubble {
    max-width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.65;
    letter-spacing: -0.2px;
    color: var(--color-text);
}
.page-chat .chat-bubble p {
    margin: 0;
}
.page-chat .chat-bubble--assistant {
    align-self: stretch;
    padding: 4px 2px;
    border-radius: 0;
    background: transparent;
    border: 0;
    color: var(--color-text);
}
.page-chat .chat-bubble--user {
    align-self: flex-end;
    max-width: 86%;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.page-chat .chat-bubble--user.chat-bubble--files {
    max-width: min(86%, 560px);
    padding: 10px 12px;
}
.page-chat .chat-bubble-files {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
.page-chat .chat-bubble-files::-webkit-scrollbar {
    height: 6px;
}
.page-chat .chat-bubble-files::-webkit-scrollbar-track {
    background: transparent;
}
.page-chat .chat-bubble-files::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
}
.page-chat .chat-file-card {
    position: relative;
    flex: none;
    width: 108px;
    height: 108px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface-muted);
    overflow: hidden;
}
.page-chat .chat-file-card--preview {
    background: #eef2f6;
}
.page-chat .chat-file-card-preview {
    height: 100%;
    padding: 10px 10px 28px;
    box-sizing: border-box;
}
.page-chat .chat-file-card-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.page-chat .chat-file-card--name {
    display: flex;
    align-items: flex-start;
    padding: 10px 10px 28px;
    box-sizing: border-box;
}
.page-chat .chat-file-card-name {
    overflow: hidden;
    color: var(--color-text);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.2px;
    word-break: break-all;
}
.page-chat .chat-file-card-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.3;
}
.page-chat .chat-md,
.page-chat .chat-bubble--assistant {
    color: #1f2937;
}
.page-chat .chat-md > *:first-child,
.page-chat .chat-bubble--assistant > *:first-child {
    margin-top: 0;
}
.page-chat .chat-md > *:last-child,
.page-chat .chat-bubble--assistant > *:last-child {
    margin-bottom: 0;
}
.page-chat .chat-md h2,
.page-chat .chat-md h3,
.page-chat .chat-bubble--assistant > h1,
.page-chat .chat-bubble--assistant > h2,
.page-chat .chat-bubble--assistant > h3 {
    margin: 18px 0 10px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.4;
}
.page-chat .chat-md h2:first-child,
.page-chat .chat-md h3:first-child,
.page-chat .chat-bubble--assistant > h1:first-child,
.page-chat .chat-bubble--assistant > h2:first-child,
.page-chat .chat-bubble--assistant > h3:first-child {
    margin-top: 0;
}
.page-chat .chat-md h4,
.page-chat .chat-bubble--assistant > h4 {
    margin: 18px 0 8px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
    line-height: 1.4;
}
.page-chat .chat-md p,
.page-chat .chat-bubble--assistant > p {
    margin: 0 0 12px;
    line-height: 1.7;
}
.page-chat .chat-md ul,
.page-chat .chat-md ol,
.page-chat .chat-bubble--assistant > ul,
.page-chat .chat-bubble--assistant > ol {
    margin: 0 0 12px;
    padding-left: 1.15em;
}
.page-chat .chat-md li,
.page-chat .chat-bubble--assistant li {
    margin: 0 0 8px;
    line-height: 1.65;
}
.page-chat .chat-md li:last-child,
.page-chat .chat-bubble--assistant li:last-child {
    margin-bottom: 0;
}
.page-chat .chat-table-wrap {
    width: 100%;
    margin: 4px 0 14px;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-background);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
/* 래퍼/클래스 없이 넣은 table도 동일하게 보이도록 */
.page-chat .chat-bubble--assistant > table {
    width: 100%;
    min-width: 0;
    margin: 4px 0 14px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-background);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow-x: auto;
}
.page-chat .chat-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
}
.page-chat .chat-bubble--assistant table:not(.chat-table) {
    width: 100%;
}
.page-chat .chat-table th,
.page-chat .chat-table td,
.page-chat .chat-bubble--assistant table th,
.page-chat .chat-bubble--assistant table td {
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.5;
    letter-spacing: -0.2px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--color-border);
}
.page-chat .chat-bubble--assistant > table thead th:first-child {
    border-top-left-radius: 11px;
}
.page-chat .chat-bubble--assistant > table thead th:last-child {
    border-top-right-radius: 11px;
}
.page-chat .chat-bubble--assistant > table tbody tr:last-child th:first-child,
.page-chat .chat-bubble--assistant > table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 11px;
}
.page-chat .chat-bubble--assistant > table tbody tr:last-child th:last-child,
.page-chat .chat-bubble--assistant > table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 11px;
}
.page-chat .chat-table thead th,
.page-chat .chat-bubble--assistant table thead th {
    background: var(--color-surface-muted);
    color: var(--color-text);
    font-weight: 700;
    white-space: nowrap;
}
.page-chat .chat-table caption,
.page-chat .chat-bubble--assistant table caption {
    padding: 12px 14px 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--color-text);
    text-align: left;
}
.page-chat .chat-table tbody th,
.page-chat .chat-table tbody td,
.page-chat .chat-bubble--assistant table tbody th,
.page-chat .chat-bubble--assistant table tbody td {
    color: var(--color-text);
    background: var(--color-background);
}
.page-chat .chat-table tbody th,
.page-chat .chat-bubble--assistant table tbody th {
    width: 108px;
    font-weight: 600;
    white-space: nowrap;
}
.page-chat .chat-table tbody tr:last-child th,
.page-chat .chat-table tbody tr:last-child td,
.page-chat .chat-bubble--assistant table tbody tr:last-child th,
.page-chat .chat-bubble--assistant table tbody tr:last-child td {
    border-bottom: 0;
}
.page-chat .chat-table tbody tr:nth-child(even) th,
.page-chat .chat-table tbody tr:nth-child(even) td,
.page-chat .chat-bubble--assistant table tbody tr:nth-child(even) th,
.page-chat .chat-bubble--assistant table tbody tr:nth-child(even) td {
    background: var(--color-surface);
}
/* chat-table-wrap 안 table은 바깥 테두리를 래퍼가 담당 */
.page-chat .chat-table-wrap > table {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    border-collapse: collapse;
    min-width: 420px;
}
.page-chat .chat-bubble--assistant.chat-bubble--loading {
    padding: 10px 4px;
}
.page-chat .chat-loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 24px;
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 1.4;
    letter-spacing: -0.2px;
}
.page-chat .chat-loading-spinner {
    flex: none;
    width: 16px;
    height: 16px;
    border: 2px solid color-mix(in srgb, var(--color-primary) 25%, transparent);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: composer-file-spin 0.7s linear infinite;
}
.page-chat .chat-doc-card {
    width: 100%;
    max-width: 520px;
    padding: 16px 18px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-background);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    box-sizing: border-box;
}
.page-chat .chat-doc-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.page-chat .chat-doc-card-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--color-text);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.3;
}
.page-chat .chat-doc-card-icon {
    flex: none;
    width: 18px;
    height: 18px;
    opacity: 0.72;
}
.page-chat .chat-doc-card-badge {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.2px;
    line-height: 1.2;
    white-space: nowrap;
}
.page-chat .chat-doc-card-badge--processing {
    border: 1px solid color-mix(in srgb, var(--color-primary) 45%, var(--color-border));
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
.page-chat .chat-doc-card-badge--done {
    border: 1px solid color-mix(in srgb, #16a34a 45%, var(--color-border));
    background: color-mix(in srgb, #16a34a 8%, #ffffff);
    color: #15803d;
}
.page-chat .chat-doc-card--failed {
    border-color: color-mix(in srgb, #dc2626 28%, var(--color-border));
}
.page-chat .chat-doc-card-badge--failed {
    border: 1px solid color-mix(in srgb, #dc2626 42%, var(--color-border));
    background: color-mix(in srgb, #dc2626 7%, #ffffff);
    color: #b91c1c;
}
.page-chat .chat-doc-card-badge-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid color-mix(in srgb, var(--color-primary) 25%, transparent);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: composer-file-spin 0.7s linear infinite;
}
.page-chat .chat-doc-card-progress {
    height: 3px;
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--color-surface-muted);
}
.page-chat .chat-doc-card-progress-bar {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        var(--color-primary) 0%,
        var(--color-secondary) 100%
    );
    animation: chat-doc-progress 1.8s ease-in-out infinite;
}
@keyframes chat-doc-progress {
    0% {
        width: 18%;
        margin-left: 0;
    }
    50% {
        width: 42%;
        margin-left: 34%;
    }
    100% {
        width: 18%;
        margin-left: 82%;
    }
}
.page-chat .chat-doc-card-status {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: -0.2px;
}
.page-chat .chat-doc-card-status-dots {
    margin-right: 4px;
    color: var(--color-primary);
    letter-spacing: 1px;
}
.page-chat .chat-doc-card-body {
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
}
.page-chat .chat-doc-card-file {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-bottom: 8px;
}
.page-chat .chat-doc-card-file-badge {
    flex: none;
    padding: 3px 7px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--color-primary) 14%, #ffffff);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.2;
}
.page-chat .chat-doc-card-file-name {
    overflow: hidden;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.2px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.page-chat .chat-doc-card-meta {
    margin: 0 0 14px;
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 1.45;
    letter-spacing: -0.1px;
}
.page-chat .chat-doc-card-error {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 13px;
    line-height: 1.55;
    letter-spacing: -0.2px;
}
.page-chat .chat-doc-card-download,
.page-chat .chat-doc-card-regenerate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    min-width: 108px;
    padding: 9px 14px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(
        135deg,
        var(--color-primary-hover) 0%,
        var(--color-primary) 45%,
        var(--color-secondary) 100%
    );
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.22);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.2px;
    line-height: 1.2;
    cursor: pointer;
    transition:
        filter 0.15s ease,
        transform 0.15s ease;
}
.page-chat .chat-doc-card-download:hover,
.page-chat .chat-doc-card-download:focus-visible,
.page-chat .chat-doc-card-regenerate:hover,
.page-chat .chat-doc-card-regenerate:focus-visible {
    outline: 0;
    filter: brightness(1.05);
}
.page-chat .chat-doc-card-download:active,
.page-chat .chat-doc-card-regenerate:active {
    transform: scale(0.98);
}
.page-chat .chat-msg-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
}
.page-chat .chat-msg-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    transition:
        color 0.15s ease,
        background 0.15s ease,
        border-color 0.15s ease;
}
.page-chat .chat-msg-action:hover {
    color: var(--color-primary);
    background: var(--color-primary-soft);
    border-color: var(--color-primary-border);
}
.page-chat .chat-msg-action.is-active {
    color: var(--color-primary);
    background: var(--color-primary-soft);
}
.page-chat .chat-inline-link {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
    cursor: pointer;
}
.page-chat .chat-inline-link:hover {
    color: var(--color-primary-hover);
}
.page-chat .chat-room-bottom {
    flex: none;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 8px 4px 0;
    box-sizing: border-box;
}
.page-chat .composer {
    width: 100%;
    min-height: 120px;
}
.page-chat .composer textarea {
    max-height: 160px;
    overflow-y: auto;
    font-size: 16px;
}
.page-chat .chat-disclaimer {
    margin: 12px 0 4px;
    text-align: center;
    font-size: 12px;
    line-height: 1.45;
    color: #94a3b8;
}
@media (max-width: 767px) {
    .page-chat main,
    body.sidebar-collapsed.page-chat main {
        padding-top: 0 !important;
    }
    .page-chat .chat-room {
        padding: 56px 0 10px;
    }
    .page-chat .chat-room-thread,
    .page-chat .chat-room-bottom {
        max-width: 100%;
        padding-left: 14px;
        padding-right: 14px;
    }
    .page-chat .chat-disclaimer {
        font-size: 11px;
        padding: 0 4px;
    }
    .page-chat .chat-room-top {
        top: 12px;
        right: 60px;
    }
}

html:has(body.page-chat-window) {
    min-width: 0;
}
body.page-chat-window {
    min-width: 0;
}
body.page-chat-window main,
body.sidebar-collapsed.page-chat-window main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0 !important;
    width: 100%;
    height: 100%;
    padding: 0 !important;
}
body.page-chat-window .chat-room {
    flex: 1;
    min-width: 0;
    padding: 12px 0 10px;
}
.chat-q-panel {
    display: flex;
    flex-direction: column;
    flex: none;
    width: 100%;
    min-height: 0;
    border-bottom: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-background) 86%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.chat-q-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: none;
    padding: 8px 12px 4px 16px;
}
.chat-q-toolbar-title {
    color: var(--color-text);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -0.2px;
}
.chat-q-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-background);
    cursor: pointer;
}
.chat-q-toggle img {
    display: block;
    width: 16px;
    height: 16px;
    transition: transform 0.18s ease;
}
.chat-q-panel.is-collapsed .chat-q-toggle img {
    transform: rotate(-90deg);
}
.chat-q-toggle:hover {
    border-color: var(--color-primary-border);
    background: var(--color-primary-soft);
}
.chat-q-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.16);
}
.chat-q-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.chat-q-panel.is-collapsed .chat-q-body {
    display: none;
}
.chat-q-section {
    min-width: 0;
}
.chat-q-head,
.chat-faq-head {
    margin: 0;
    padding: 4px 16px 6px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.2px;
}
.chat-q-head {
    color: var(--color-text);
}
.chat-faq-head {
    color: var(--color-primary);
}
.chat-q-list,
.chat-faq-list {
    display: flex;
    flex-direction: row;
    flex: none;
    gap: 8px;
    min-height: 0;
    padding: 0 12px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
.chat-q-empty {
    margin: 8px 6px;
    color: var(--color-text-muted);
    font-size: 13px;
    line-height: 1.45;
}
.chat-q-item,
.chat-faq-item {
    display: block;
    flex: none;
    width: auto;
    max-width: 220px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.2px;
    text-align: left;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.chat-q-item {
    border: 1px solid var(--color-border);
    background: var(--color-background);
    color: var(--color-text-muted);
}
.chat-q-item:hover {
    background: var(--color-surface);
    color: var(--color-text);
}
.chat-q-item.is-active {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-color: var(--color-primary-border);
}
.chat-faq-section {
    margin: 0 10px 10px;
    padding: 6px 4px 2px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-primary) 7%, transparent);
}
.chat-faq-list {
    padding-bottom: 10px;
}
.chat-faq-item {
    border: 0;
    background: color-mix(in srgb, var(--color-background) 82%, transparent);
    color: var(--color-primary);
}
.chat-faq-item:hover {
    background: var(--color-background);
}
.chat-q-item:focus-visible,
.chat-faq-item:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.16);
}
@media (min-width: 1200px) {
    body.page-chat-window main,
    body.sidebar-collapsed.page-chat-window main {
        flex-direction: row;
    }
    body.page-chat-window .chat-room {
        padding: 18px 0 14px;
    }
    .chat-q-panel {
        width: 240px;
        border-right: 1px solid var(--color-border);
        border-bottom: 0;
    }
    .chat-q-panel.is-collapsed {
        width: 52px;
    }
    .chat-q-panel.is-collapsed .chat-q-toolbar {
        flex-direction: column;
        justify-content: flex-start;
        padding: 12px 8px;
    }
    .chat-q-panel.is-collapsed .chat-q-toolbar-title {
        display: none;
    }
    .chat-q-panel.is-collapsed .chat-q-toggle img {
        transform: rotate(90deg);
    }
    .chat-q-toolbar {
        padding: 12px 10px 4px 12px;
    }
    .chat-q-body {
        flex: 1;
        min-height: 0;
    }
    .chat-q-section {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }
    .chat-q-head,
    .chat-faq-head {
        padding: 8px 14px 8px;
    }
    .chat-q-list,
    .chat-faq-list {
        flex-direction: column;
        gap: 4px;
        padding: 0 10px 12px;
        overflow-x: hidden;
        overflow-y: auto;
    }
    .chat-q-list {
        flex: 1;
    }
    .chat-q-item,
    .chat-faq-item {
        width: 100%;
        max-width: none;
    }
    .chat-q-item {
        padding: 10px 12px;
        border: 0;
        background: transparent;
    }
    .chat-q-item.is-active {
        border-color: transparent;
        background: var(--color-primary-soft);
    }
    .chat-faq-section {
        flex: none;
        margin: 0 8px 12px;
        padding: 4px 0 8px;
        border-top: 1px dashed color-mix(in srgb, var(--color-primary) 28%, var(--color-border));
        border-radius: 0 0 12px 12px;
        background: color-mix(in srgb, var(--color-primary) 6%, transparent);
        max-height: 42%;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .chat-faq-list {
        flex: 1;
        min-height: 0;
    }
}

/* ==========================================================================
   템플릿스토어 페이지 (store.html)
   ========================================================================== */
.page-store .wrap.store-page-wrap {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding-bottom: 48px;
}
body.sidebar-collapsed.page-store .wrap.store-page-wrap {
    width: 100%;
    max-width: var(--content-max);
}
.page-store main {
    padding-left: 28px;
    padding-right: 28px;
}
.page-store a.menu,
.page-store a.new-chat {
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.store-page-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 8px 0 28px;
    text-align: center;
}
.store-page-hero h1 {
    margin: 0 0 10px;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: var(--color-text);
}
.store-page-hero p {
    margin: 0;
    font-size: 15px;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.store-page-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}
.store-page-search {
    min-width: 0;
}
.store-page-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}
.store-page-view {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-background);
}
.store-page-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
}
.store-page-view-btn img {
    display: block;
    width: 16px;
    height: 16px;
    opacity: 0.65;
}
.store-page-view-btn:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
}
.store-page-view-btn.is-active {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
.store-page-view-btn.is-active img {
    opacity: 1;
    filter: invert(39%) sepia(78%) saturate(1200%) hue-rotate(199deg) brightness(96%) contrast(92%);
}
.store-page-sort-select {
    height: 42px;
    min-width: 110px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-background);
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}

.store-page-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.store-page-chip {
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.store-page-chip.is-active {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
.store-page-chip:not(.is-active):hover {
    background: rgba(var(--color-primary-rgb), 0.08);
    color: var(--color-primary);
}

.store-page-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.store-page-grid.is-list {
    grid-template-columns: 1fr;
    gap: 10px;
}
.store-page-grid.is-list .store-page-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
}
.store-page-grid.is-list .store-page-media {
    height: 100%;
    min-height: 132px;
    aspect-ratio: auto;
}
.store-page-grid.is-list .store-page-body {
    justify-content: center;
}
.store-page-empty {
    grid-column: 1 / -1;
    padding: 64px 20px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
    border: 1px dashed var(--color-border);
    border-radius: 16px;
    background: var(--color-surface);
}
.store-page-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-background);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.store-page-card:hover {
    border-color: var(--color-primary-border);
    box-shadow: 0 8px 24px rgba(var(--color-primary-rgb), 0.08);
}
.store-page-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-surface-muted);
}
.store-page-hot {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 10px;
    display: none;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border: 0;
    border-radius: 6px;
    background: rgba(232, 48, 78, 0.72);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
    text-shadow: none;
    pointer-events: none;
}
.store-page-grid .store-page-card:nth-child(-n + 16) .store-page-hot {
    display: inline-flex;
}
.store-page-media.image-shimmer {
    width: 100%;
}
.store-page-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.store-page-cover-label {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: color-mix(in srgb, var(--color-primary) 42%, #6b7c93);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.4px;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
}
.store-page-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 14px 16px;
    flex: 1;
}
.store-page-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.store-page-cat {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
}
.store-page-chat {
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--color-primary);
    border-radius: 999px;
    background: var(--color-background);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.store-page-chat:hover,
.store-page-chat:focus-visible {
    background: var(--color-primary-soft);
    outline: 0;
}
.store-page-title {
    margin: 0;
    min-width: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--color-text);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.store-page-desc {
    margin: 0;
    flex: 1;
    min-height: 39px;
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.store-page-stats {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 2px;
}
.store-page-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 1100px) {
    .store-page-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .store-page-grid .store-page-card .store-page-hot {
        display: none;
    }
    .store-page-grid .store-page-card:nth-child(-n + 12) .store-page-hot {
        display: inline-flex;
    }
}
@media (max-width: 900px) {
    .store-page-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .store-page-grid .store-page-card .store-page-hot {
        display: none;
    }
    .store-page-grid .store-page-card:nth-child(-n + 8) .store-page-hot {
        display: inline-flex;
    }
}
@media (max-width: 767px) {
    .page-store main {
        padding-left: 16px;
        padding-right: 16px;
    }
    .page-store .wrap.store-page-wrap,
    body.sidebar-collapsed.page-store .wrap.store-page-wrap {
        max-width: none;
    }
    .store-page-hero h1 {
        font-size: 26px;
    }
    .store-page-hero {
        flex-direction: column;
    }
    .store-page-toolbar {
        grid-template-columns: 1fr;
    }
    .store-page-sort {
        justify-content: flex-end;
    }
    .store-page-grid {
        grid-template-columns: 1fr;
    }
    .store-page-grid.is-list .store-page-card {
        grid-template-columns: 120px minmax(0, 1fr);
    }
    .store-page-grid.is-list .store-page-media {
        min-height: 142px;
    }
    .store-page-grid .store-page-card .store-page-hot {
        display: none;
    }
    .store-page-grid .store-page-card:nth-child(-n + 4) .store-page-hot {
        display: inline-flex;
    }
}

/* ==========================================================================
   MY템플릿 등록 / 수정 (template-form.html)
   ========================================================================== */
.page-tpl-form .wrap.tpl-form-wrap {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding-bottom: 48px;
}
body.sidebar-collapsed.page-tpl-form .wrap.tpl-form-wrap {
    width: 100%;
    max-width: var(--content-max);
}
.page-tpl-form main {
    padding-left: 28px;
    padding-right: 28px;
}
.page-tpl-form a.menu,
.page-tpl-form a.new-chat {
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.tpl-form-back {
    display: inline-flex;
    margin: 0 0 12px;
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.tpl-form-back:hover {
    color: var(--color-primary);
}
.tpl-form-hero {
    margin: 0 0 20px;
}
.tpl-form-hero-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}
.tpl-form-hero-text h1 {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.7px;
    color: var(--color-text);
}
.tpl-form-hero-text p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text-muted);
}
.tpl-form-step {
    flex: none;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
}

.tpl-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
}
.tpl-form-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}
.tpl-form-aside {
    position: sticky;
    top: 24px;
}
.tpl-form-card {
    padding: 22px 22px 20px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-background);
}
.tpl-form-card-head {
    margin: 0 0 16px;
}
.tpl-form-card-head h2 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--color-text);
}
.tpl-form-card-head p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--color-text-muted);
}
.tpl-form-field + .tpl-form-field {
    margin-top: 16px;
}
.tpl-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.tpl-form-field label,
.tpl-form-label {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
}
.tpl-form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.tpl-form-count {
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
}
.tpl-req {
    color: var(--color-primary);
    font-weight: 700;
}
.tpl-form-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-background);
    color: var(--color-text);
    font-size: 14px;
    box-sizing: border-box;
}
.tpl-form-textarea {
    height: auto;
    min-height: 84px;
    padding: 10px 12px;
    resize: vertical;
    line-height: 1.55;
}
.tpl-form-textarea--lg {
    min-height: 220px;
}
.tpl-form-input:focus,
.tpl-form-textarea:focus {
    outline: 0;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.16);
}

.tpl-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tpl-chip {
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-background);
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.tpl-chip:hover {
    background: var(--color-surface);
}
.tpl-chip.is-active {
    border-color: var(--color-primary-border);
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
.tpl-segment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
}
.tpl-segment-btn {
    height: 36px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.tpl-segment-btn.is-active {
    background: var(--color-background);
    color: var(--color-text);
    box-shadow: 0 1px 4px rgba(34, 34, 34, 0.08);
}

.tpl-attach-drop {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.tpl-attach-meta {
    color: var(--color-text-muted);
    font-size: 13px;
}
.tpl-attach-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: calc(3 * 44px + 2 * 8px + 16px);
    max-height: calc(3 * 44px + 2 * 8px + 16px);
    margin: 12px 0 0;
    padding: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    -webkit-overflow-scrolling: touch;
}
.tpl-attach-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    min-height: 44px;
    flex: none;
    padding: 8px 10px 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-background);
}
.tpl-attach-ico {
    display: block;
    width: 18px;
    height: 18px;
    flex: none;
    opacity: 0.7;
}
.tpl-attach-name {
    min-width: 0;
    flex: 1;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tpl-attach-name em {
    margin-left: 6px;
    color: var(--color-text-muted);
    font-style: normal;
    font-weight: 500;
}
.tpl-attach-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: none;
    border-radius: 8px;
    background: transparent;
}
.tpl-attach-del img {
    display: block;
    width: 14px;
    height: 14px;
    opacity: 0.45;
}
.tpl-attach-del:hover,
.tpl-attach-del:focus-visible {
    background: var(--color-surface-muted);
    outline: 0;
}
.tpl-attach-del:hover img,
.tpl-attach-del:focus-visible img {
    opacity: 0.8;
}

.tpl-preview-card {
    padding: 18px;
}
.tpl-dropzone {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px dashed var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
    cursor: pointer;
}
.tpl-dropzone.is-dragover,
.tpl-dropzone:hover {
    border-color: var(--color-primary-border);
    background: var(--color-primary-soft);
}
.tpl-thumb-placeholder {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 700;
}
.tpl-thumb-placeholder img {
    width: 18px;
    height: 18px;
    opacity: 0.45;
}
.tpl-dropzone img#tplThumbImg {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tpl-dropzone.has-image .tpl-thumb-placeholder {
    visibility: hidden;
}
.tpl-dropzone.has-image img#tplThumbImg {
    display: block;
}
.tpl-dropzone-clear {
    width: 100%;
    margin-top: 10px;
    height: 34px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-background);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.tpl-dropzone-clear:hover {
    background: var(--color-surface);
    color: var(--color-text);
}
.tpl-preview-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
}
.tpl-preview-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.tpl-preview-body strong {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.35;
    color: var(--color-text);
}
.tpl-preview-body p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tpl-preview-vis {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.tpl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
}
.tpl-btn--primary {
    background: var(--color-primary);
    color: var(--color-background);
}
.tpl-btn--primary:hover,
.tpl-btn--primary:focus-visible {
    background: var(--color-primary-hover);
    outline: 0;
}
.tpl-btn--ghost {
    background: var(--color-background);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.tpl-btn--ghost:hover,
.tpl-btn--ghost:focus-visible {
    background: var(--color-surface);
    outline: 0;
}

.tpl-form-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-background);
}
.tpl-form-actions-right {
    display: flex;
    gap: 8px;
}

@media (max-width: 1100px) {
    .tpl-form-layout {
        grid-template-columns: 1fr;
    }
    .tpl-form-aside {
        position: static;
        order: -1;
    }
}

@media (max-width: 767px) {
    .page-tpl-form main {
        padding-left: 16px;
        padding-right: 16px;
    }
    .page-tpl-form .wrap.tpl-form-wrap,
    body.sidebar-collapsed.page-tpl-form .wrap.tpl-form-wrap {
        max-width: none;
    }
    .tpl-form-hero-text h1 {
        font-size: 24px;
    }
    .tpl-form-hero-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .tpl-form-card {
        padding: 16px;
        border-radius: 14px;
    }
    .tpl-form-actions {
        flex-wrap: wrap;
    }
    .tpl-form-actions .tpl-btn,
    .tpl-form-actions-right {
        width: 100%;
    }
    .tpl-form-actions-right .tpl-btn {
        flex: 1;
    }
}

/* ==========================================================================
   회원정보 페이지 (profile.html)
   ========================================================================== */

.page-profile .wrap.profile-wrap {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding-bottom: 48px;
}
body.sidebar-collapsed.page-profile .wrap.profile-wrap {
    width: 100%;
    max-width: var(--content-max);
}

.page-profile main {
    padding-left: 28px;
    padding-right: 28px;
}

.profile-hero {
    margin: 0 0 28px;
    text-align: left;
}
.profile-hero h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.6px;
    color: var(--color-text);
}
.profile-hero p {
    margin: 0;
    font-size: 15px;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.profile-panel {
    padding: 28px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-background);
}

.profile-section + .profile-section {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--color-surface-muted);
}
.profile-section-title {
    margin: 0 0 18px;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.2px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.profile-grid--details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.profile-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.profile-field--full {
    grid-column: 1 / -1;
}
.profile-field label {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
}

.field-shimmer {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: var(--color-surface-muted);
}
.field-shimmer.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        90deg,
        var(--color-surface-muted) 0%,
        var(--color-border) 30%,
        var(--color-text-muted) 60%,
        var(--color-text-muted) 100%
    );
    transform: translateX(-100%);
    animation: image-shimmer 1s linear infinite;
}
.field-shimmer.is-loading .profile-input,
.field-shimmer.is-loading .profile-select {
    opacity: 0;
}
.field-shimmer.is-loaded .profile-input,
.field-shimmer.is-loaded .profile-select {
    opacity: 1;
    transition: opacity 0.22s ease;
}

.profile-input,
.profile-select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-background);
    color: var(--color-text);
    font-size: 14px;
    box-sizing: border-box;
}
.profile-input::placeholder {
    color: var(--color-text-muted);
}
.profile-input.is-readonly {
    background: var(--color-surface);
    color: var(--color-text-muted);
    cursor: default;
}
.profile-input:focus,
.profile-select:focus {
    outline: 2px solid rgba(var(--color-primary-rgb), 0.35);
    border-color: var(--color-primary);
}

.profile-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.profile-hint {
    margin: 0;
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.profile-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--color-surface-muted);
}
.profile-save-btn {
    height: 40px;
    padding: 0 20px;
    border-radius: 8px;
    background: var(--color-primary);
    color: var(--color-background);
    font-size: 14px;
    font-weight: 600;
}
.profile-save-btn:hover,
.profile-save-btn:focus-visible {
    background: var(--color-primary-hover);
    outline: 0;
}

.page-profile a.menu,
.page-profile a.new-chat {
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .page-profile main {
        padding-left: 16px;
        padding-right: 16px;
    }
    .page-profile .wrap.profile-wrap,
    body.sidebar-collapsed.page-profile .wrap.profile-wrap {
        max-width: none;
    }
    .profile-hero h1 {
        font-size: 24px;
    }
    .profile-panel {
        padding: 16px;
        border-radius: 14px;
    }
    .profile-grid--details {
        grid-template-columns: 1fr;
    }
    .profile-actions {
        justify-content: stretch;
    }
    .profile-save-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .field-shimmer.is-loading::after {
        animation: none;
        opacity: 0.35;
    }
}

/* 상단 헤더 제거: 로고·접기 버튼을 사이드바로 이동 */
.top {
    display: none !important;
}
.sidebar,
body.sidebar-collapsed .sidebar {
    top: 0;
}
.sidebar-rail,
body.sidebar-collapsed .sidebar-rail {
    top: 0;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: none;
    min-height: 48px;
    margin: 0 0 10px;
    padding: 2px 4px 10px;
    border-bottom: 1px solid var(--color-border);
}
.sidebar-logo {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}
.sidebar-logo img {
    display: block;
    width: 112px;
    height: 32px;
    object-fit: contain;
}
.sidebar-brand .sidebar-toggle {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    transform: none;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    z-index: 1;
}
.sidebar-brand .sidebar-toggle::after {
    display: none;
}
.sidebar-brand .sidebar-toggle:hover,
.sidebar-brand .sidebar-toggle:focus-visible {
    background: var(--color-surface-muted);
}
.sidebar-brand .sidebar-toggle img {
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
}
body.sidebar-collapsed .sidebar-brand {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    min-height: 44px;
    margin: 0 0 4px;
    padding: 2px 0 4px;
    border-bottom: 0;
}
body.sidebar-collapsed .sidebar-logo {
    display: none;
}
body.sidebar-collapsed .sidebar-brand .sidebar-toggle,
body.sidebar-collapsed .sidebar-toggle {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
}
body.sidebar-collapsed .sidebar-brand .sidebar-toggle img,
body.sidebar-collapsed .sidebar-toggle img {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
}
@media (min-width: 768px) {
    body.sidebar-collapsed .sidebar-main {
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }
    body.sidebar-collapsed .side-section-label,
    body.sidebar-collapsed .side-group-title,
    body.sidebar-collapsed .sidebar-recent-head > .group-label,
    body.sidebar-collapsed .recent-more {
        display: none !important;
    }
    body.sidebar-collapsed .sidebar-recent,
    body.sidebar-collapsed .side-support {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid var(--color-primary-tint);
    }
    body.sidebar-collapsed .side-support {
        margin-top: auto;
    }
    body.sidebar-collapsed .side-group-body {
        display: flex !important;
        width: 100%;
        gap: 7px;
    }
    body.sidebar-collapsed .sidebar-recent-head {
        display: flex;
        justify-content: center;
        width: 100%;
        min-height: 44px;
        padding: 0;
        margin: 0;
    }
    body.sidebar-collapsed .sidebar-recent-head .recent-search-btn {
        position: relative;
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }
    body.sidebar-collapsed .sidebar-recent-head .recent-search-btn img {
        width: 20px;
        height: 20px;
        opacity: 0.85;
    }
    body.sidebar-collapsed .sidebar-recent-list,
    body.sidebar-collapsed .sidebar-recent.is-closed .sidebar-recent-list,
    body.sidebar-collapsed .sidebar-chat,
    body.sidebar-collapsed .recent-empty {
        display: none !important;
    }
    body.sidebar-collapsed .recent-search-btn::after,
    body.sidebar-collapsed .credit-slim .credit-head {
        display: none;
    }
    body.sidebar-collapsed .recent-search-btn:hover::after,
    body.sidebar-collapsed .recent-search-btn:focus-visible::after,
    body.sidebar-collapsed .credit-slim:hover .credit-head,
    body.sidebar-collapsed .credit-slim:focus-within .credit-head {
        display: flex;
        position: absolute;
        z-index: 30;
        left: 54px;
        top: 50%;
        width: max-content;
        max-width: 220px;
        padding: 7px 10px;
        border-radius: 7px;
        background: var(--color-text);
        color: var(--color-background);
        font-size: 13px;
        font-weight: 500;
        line-height: 1.2;
        white-space: nowrap;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
        transform: translateY(-50%);
        pointer-events: none;
        overflow: visible;
    }
    body.sidebar-collapsed .recent-search-btn::after {
        content: attr(aria-label);
        align-items: center;
    }
    body.sidebar-collapsed .sidebar-account {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin: 6px 0 0;
        padding: 8px 0 2px;
        border-radius: 0;
        background: transparent;
        border-top: 1px solid var(--color-primary-tint);
    }
    body.sidebar-collapsed .account-row {
        display: none;
    }
    body.sidebar-collapsed .credit-slim {
        position: relative;
        width: 44px;
        height: 44px;
        margin: 0 auto;
        padding: 0;
        justify-content: center;
        align-items: center;
    }
    body.sidebar-collapsed .credit-slim .credit-head {
        gap: 8px;
        margin: 0;
        font-size: 13px;
        color: var(--color-background);
    }
    body.sidebar-collapsed .credit-slim .credit-head strong {
        color: var(--color-background);
        font-size: 13px;
    }
    body.sidebar-collapsed .credit-slim .credit-pct {
        color: #93c5fd;
    }
    body.sidebar-collapsed .credit-track {
        width: 36px;
        height: 36px;
        margin: 0 auto;
        border-radius: 50%;
        background: conic-gradient(
            var(--color-primary) 0 59.7%,
            var(--color-primary-soft) 59.7% 100%
        );
        overflow: hidden;
    }
    body.sidebar-collapsed .credit-fill {
        display: none;
    }
    body.sidebar-collapsed .credit-track::after {
        content: '59%';
        position: absolute;
        inset: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: var(--color-background);
        color: var(--color-primary);
        font-size: 9px;
        font-weight: 700;
        letter-spacing: -0.04em;
        animation: none;
        transform: none;
        width: auto;
    }
}
main,
body.sidebar-collapsed main {
    padding-top: 40px;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
}
@media (max-width: 1199px) {
    main {
        padding-top: 36px;
    }
}
@media (max-width: 767px) {
    .mobile-menu-button {
        display: flex;
        position: fixed;
        z-index: 45;
        top: 12px;
        right: 12px;
        left: auto;
        width: 40px;
        height: 40px;
        flex: none;
        padding: 10px;
        border-radius: 10px;
        background: var(--color-background);
        border: 1px solid var(--color-border);
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    }
    body.sidebar-open .mobile-menu-button {
        background: var(--color-surface);
    }
    .sidebar,
    body.sidebar-collapsed .sidebar,
    body:not(.sidebar-collapsed) .sidebar {
        top: 0 !important;
    }
    .sidebar-backdrop {
        inset: 0 !important;
    }
    .sidebar-brand {
        padding: 2px 2px 12px;
        margin-bottom: 8px;
    }
    .sidebar-logo img {
        width: 108px;
        height: 30px;
    }
    body.sidebar-collapsed .sidebar-logo {
        display: flex;
    }
    body.sidebar-collapsed .sidebar-brand {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .sidebar-brand .sidebar-toggle {
        display: none;
    }
    .sidebar,
    body.sidebar-collapsed .sidebar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        overflow: hidden !important;
    }
    .sidebar-main,
    body.sidebar-collapsed .sidebar-main {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }
    .sidebar-account,
    body.sidebar-collapsed .sidebar-account {
        display: flex !important;
        flex: 0 0 auto;
        position: relative;
        z-index: 2;
    }
    main,
    body.sidebar-collapsed main {
        padding-top: 64px !important;
        margin-left: 0 !important;
    }
}

/* ========== 스크롤바 커스텀 ========== */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.store-list::-webkit-scrollbar,
.solutions-list::-webkit-scrollbar,
.model-panels::-webkit-scrollbar,
.model-tabs::-webkit-scrollbar,
.model-picker::-webkit-scrollbar,
.recent-list::-webkit-scrollbar,
.sidebar-recent-list::-webkit-scrollbar,
.notice-table-wrap::-webkit-scrollbar,
.notice-panel::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
}
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.store-list::-webkit-scrollbar-track,
.solutions-list::-webkit-scrollbar-track,
.model-panels::-webkit-scrollbar-track,
.model-tabs::-webkit-scrollbar-track,
.model-picker::-webkit-scrollbar-track,
.recent-list::-webkit-scrollbar-track,
.sidebar-recent-list::-webkit-scrollbar-track,
.notice-table-wrap::-webkit-scrollbar-track,
.notice-panel::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.store-list::-webkit-scrollbar-thumb,
.solutions-list::-webkit-scrollbar-thumb,
.model-panels::-webkit-scrollbar-thumb,
.model-tabs::-webkit-scrollbar-thumb,
.model-picker::-webkit-scrollbar-thumb,
.recent-list::-webkit-scrollbar-thumb,
.sidebar-recent-list::-webkit-scrollbar-thumb,
.notice-table-wrap::-webkit-scrollbar-thumb,
.notice-panel::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(
        180deg,
        var(--color-secondary),
        var(--scrollbar-thumb)
    );
    border: 2px solid transparent;
    background-clip: padding-box;
}
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.store-list::-webkit-scrollbar-thumb:hover,
.solutions-list::-webkit-scrollbar-thumb:hover,
.model-panels::-webkit-scrollbar-thumb:hover,
.model-tabs::-webkit-scrollbar-thumb:hover,
.model-picker::-webkit-scrollbar-thumb:hover,
.recent-list::-webkit-scrollbar-thumb:hover,
.sidebar-recent-list::-webkit-scrollbar-thumb:hover,
.notice-table-wrap::-webkit-scrollbar-thumb:hover,
.notice-panel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        var(--color-primary),
        var(--scrollbar-thumb-hover)
    );
    background-clip: padding-box;
}
html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner,
.store-list::-webkit-scrollbar-corner,
.solutions-list::-webkit-scrollbar-corner,
.model-panels::-webkit-scrollbar-corner,
.model-picker::-webkit-scrollbar-corner {
    background: transparent;
}
.store-list,
.solutions-list,
.model-panels,
.model-tabs,
.model-picker,
.recent-list,
.sidebar-recent-list,
.notice-table-wrap,
.notice-panel {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
/* 사이드바 본문은 기존처럼 스크롤바 숨김 유지 */
.sidebar-main {
    scrollbar-width: none;
}
.sidebar-main::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* ==========================================================================
   API키발급 (api-key.html)
   ========================================================================== */
.page-api-key a.menu,
.page-api-key a.new-chat {
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}
.page-api-key main {
    padding-left: 28px;
    padding-right: 28px;
}
.page-api-key .wrap.api-key-wrap {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding-bottom: 48px;
}
body.sidebar-collapsed.page-api-key .wrap.api-key-wrap {
    width: 100%;
    max-width: var(--content-max);
}

.api-key-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 22px;
}
.api-key-hero-text h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.6px;
    color: var(--color-text);
}
.api-key-hero-text p {
    margin: 0;
    max-width: 520px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text-muted);
}
.page-api-key .api-key-hero .tg-btn {
    flex: none;
}
.api-key-icon-btn {
    gap: 6px;
}
.api-key-icon-btn svg {
    flex: none;
}
.page-api-key .api-key-ops .tg-btn--ghost-danger {
    min-width: 0;
    height: 32px;
    padding: 0 12px;
}
.page-api-key .api-key-ops .notice-view-btn {
    min-width: 0;
}

.api-key-notice {
    margin: 0 0 22px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: var(--color-surface-muted);
    color: #475569;
}
.api-key-notice strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--color-text);
}
.api-key-notice ul {
    margin: 0;
    padding-left: 1.15em;
}
.api-key-notice li {
    margin: 0 0 4px;
    font-size: 13.5px;
    line-height: 1.55;
}
.api-key-notice li:last-child {
    margin-bottom: 0;
}

.api-key-panel {
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-background);
    overflow: hidden;
}
.api-key-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}
.api-key-panel-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
}
.api-key-count {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
}

.api-key-table-wrap {
    overflow-x: auto;
}
.api-key-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 760px;
}
.api-key-table col.col-name {
    width: 18%;
}
.api-key-table col.col-key {
    width: 38%;
}
.api-key-table col.col-created {
    width: 12%;
}
.api-key-table col.col-used {
    width: 12%;
}
.api-key-table col.col-ops {
    width: 20%;
}
.api-key-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-muted);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--color-surface-muted) 88%, #ffffff) 0%,
        var(--color-surface-muted) 100%
    );
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
.api-key-table tbody td {
    padding: 14px 16px;
    font-size: 13.5px;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}
.api-key-table tbody tr:last-child td {
    border-bottom: 0;
}
.api-key-table tbody tr:hover td {
    background: color-mix(in srgb, var(--color-primary) 4%, #ffffff);
}
.api-key-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.api-key-code {
    display: block;
    max-width: 100%;
    box-sizing: border-box;
    padding: 5px 9px;
    border-radius: 6px;
    background: var(--color-surface-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.02em;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.api-key-ops-inner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.api-key-empty td {
    text-align: center;
    color: var(--color-text-muted);
    padding: 36px 16px !important;
}

.api-key-modal[hidden] {
    display: none !important;
}
.api-key-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.api-key-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
}
.api-key-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    border-radius: 16px;
    background: var(--color-background);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}
.api-key-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--color-border);
}
.api-key-modal-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.api-key-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
}
.api-key-modal-close:hover {
    background: var(--color-surface-muted);
}
.api-key-modal-close img {
    width: 14px;
    height: 14px;
    display: block;
}
.api-key-modal-body {
    padding: 18px;
}
.api-key-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.api-key-field label,
.api-key-result > label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
}
.api-key-field input {
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-background);
    color: var(--color-text);
    outline: none;
}
.api-key-field input:focus {
    border-color: var(--color-primary-border);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.api-key-hint {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--color-text-muted);
}
.api-key-hint--warn {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    font-weight: 600;
    line-height: 1.55;
}
.api-key-result {
    margin-bottom: 16px;
}
.api-key-result-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.api-key-result-row code {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--color-surface-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12.5px;
    word-break: break-all;
    color: #1f2937;
}
.api-key-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
body.api-key-modal-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .page-api-key main {
        padding-left: 14px;
        padding-right: 14px;
    }
    .api-key-hero {
        flex-direction: column;
        align-items: stretch;
    }
    .api-key-hero .tg-btn {
        width: 100%;
    }
    .api-key-hero-text h1 {
        font-size: 24px;
    }
}

/* ==========================================================================
   AI기능 / 솔루션스튜디오 (ai-feature.html, ai-solution.html)
   ========================================================================== */
.page-ai-feature a.menu,
.page-ai-feature a.new-chat,
.page-ai-solution a.menu,
.page-ai-solution a.new-chat {
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}
.page-ai-feature main,
.page-ai-solution main {
    padding-left: 28px;
    padding-right: 28px;
}
.page-ai-feature .wrap.ai-hub-wrap,
.page-ai-solution .wrap.ai-hub-wrap {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding-bottom: 48px;
}
.page-ai-feature .wrap.ai-hub-wrap {
    max-width: var(--content-max);
}

/* AI기능: 히어로·보기 전환 */
.ai-feature-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 20px;
}
.ai-feature-hero-text h1 {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.7px;
    color: var(--color-text);
}
.ai-feature-hero-text p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text-muted);
}
.ai-feature-view {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-background);
}
.ai-feature-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text-muted);
}
.ai-feature-view-btn img {
    width: 16px;
    height: 16px;
    display: block;
    opacity: 0.65;
}
.ai-feature-view-btn:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
}
.ai-feature-view-btn.is-active {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
.ai-feature-view-btn.is-active img {
    opacity: 1;
    filter: invert(39%) sepia(78%) saturate(1200%) hue-rotate(199deg) brightness(96%) contrast(92%);
}

.ai-feature-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 22px;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--color-surface-muted) 55%, #ffffff);
}
.page-ai-feature .ai-hub-chips {
    justify-content: flex-start;
    margin: 0;
    flex: 1;
}
.ai-sol-board {
    display: flex;
    flex-direction: column;
    gap: 40px;
}
.ai-sol-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    padding: 10px 12px 10px 10px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background:
        linear-gradient(
            100deg,
            var(--sol-tint, var(--color-primary-soft)) 0%,
            var(--color-background) 42%
        );
    cursor: pointer;
    user-select: none;
}
.ai-sol-head-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 11px;
    background: var(--sol-accent, var(--color-primary));
    color: #ffffff;
    box-shadow: 0 6px 14px color-mix(in srgb, var(--sol-accent, var(--color-primary)) 28%, transparent);
}
.ai-sol-head-ico svg {
    display: block;
}
.ai-sol-head-text {
    min-width: 0;
    flex: 1;
}
.ai-sol-section-title {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--color-text);
    line-height: 1.2;
}
.ai-sol-head-desc {
    margin: 3px 0 0;
    font-size: 12.5px;
    line-height: 1.35;
    color: var(--color-text-muted);
}
.ai-sol-head-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 26px;
    padding: 0 10px;
    flex: none;
    border-radius: 999px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.ai-sol-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: none;
    margin-left: 2px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-background);
    color: var(--color-text-muted);
    cursor: pointer;
}
.ai-sol-toggle svg {
    display: block;
    transition: transform 0.18s ease;
}
.ai-sol-section.is-collapsed .ai-sol-toggle svg {
    transform: rotate(-90deg);
}
.ai-sol-section.is-collapsed .ai-sol-head {
    margin-bottom: 0;
}
.ai-sol-section.is-collapsed .ai-sol-body {
    display: none;
}
.ai-sol-section[data-cat='chat'] {
    --sol-accent: var(--color-primary);
    --sol-tint: var(--color-primary-soft);
}
.ai-sol-section[data-cat='search'] {
    --sol-accent: #0f766e;
    --sol-tint: #e6f4f2;
}
.ai-sol-section[data-cat='image'] {
    --sol-accent: #7c3aed;
    --sol-tint: #f3e8ff;
}
.ai-sol-section[data-cat='code'] {
    --sol-accent: #334155;
    --sol-tint: #eef2f6;
}
.ai-sol-section[data-cat='work'] {
    --sol-accent: #c2410c;
    --sol-tint: #fff1e8;
}
.ai-sol-section[data-cat='media'] {
    --sol-accent: #be123c;
    --sol-tint: #ffe4ea;
}
.ai-feature-count {
    flex: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.ai-hub-icon-img {
    display: block;
    width: 22px;
    height: 22px;
    object-fit: contain;
}
.ai-hub-icon.tone-sky .ai-hub-icon-img,
.ai-hub-icon.tone-indigo .ai-hub-icon-img,
.ai-hub-icon.tone-mint .ai-hub-icon-img,
.ai-hub-icon.tone-teal .ai-hub-icon-img,
.ai-hub-icon.tone-amber .ai-hub-icon-img,
.ai-hub-icon.tone-orange .ai-hub-icon-img,
.ai-hub-icon.tone-violet .ai-hub-icon-img,
.ai-hub-icon.tone-rose .ai-hub-icon-img,
.ai-hub-icon.tone-blue .ai-hub-icon-img {
    opacity: 0.9;
}

/* 앨범(그리드)형 */
.page-ai-feature .ai-feature-grid.is-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.ai-feature-card {
    gap: 0;
    padding: 0;
    overflow: hidden;
}
.ai-feature-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 16px 0;
}
.ai-feature-card .ai-hub-body {
    padding: 14px 16px 16px;
}
.ai-feature-card .ai-hub-desc {
    min-height: 42px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 목록형 */
.page-ai-feature .ai-feature-grid.is-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ai-feature-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-background);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}
.ai-feature-row:hover {
    border-color: var(--color-primary-border);
    box-shadow: 0 8px 22px rgba(var(--color-primary-rgb), 0.08);
}
.ai-feature-row-body {
    min-width: 0;
}
.ai-feature-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.ai-feature-row .ai-hub-title {
    margin: 0;
    font-size: 16px;
}
.ai-feature-row .ai-hub-desc {
    margin: 0;
    min-height: 0;
    font-size: 13px;
}

@media (max-width: 1100px) {
    .page-ai-feature .ai-feature-grid.is-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 767px) {
    .ai-feature-hero {
        flex-direction: column;
    }
    .ai-feature-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .ai-feature-count {
        align-self: flex-end;
    }
    .page-ai-feature .ai-feature-grid.is-grid {
        grid-template-columns: 1fr;
    }
    .ai-feature-row {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .ai-feature-row .ai-hub-action {
        grid-column: 2;
        justify-self: start;
    }
}

.ai-hub-hero {
    margin: 0 0 24px;
    text-align: center;
}
.ai-hub-hero h1 {
    margin: 0 0 10px;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: var(--color-text);
}
.ai-hub-hero p {
    margin: 0;
    font-size: 15px;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.ai-hub-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 28px;
}
.ai-hub-chip {
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-background);
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
}
.ai-hub-chip:hover {
    border-color: var(--color-primary-border);
    color: var(--color-primary);
}
.ai-hub-chip.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.ai-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.ai-hub-grid--solution {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}
.page-ai-solution .wrap.ai-hub-wrap {
    max-width: var(--content-max);
}
.ai-hub-empty {
    grid-column: 1 / -1;
    padding: 48px 16px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
}

.ai-hub-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-background);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}
.ai-hub-card:hover {
    border-color: var(--color-primary-border);
    box-shadow: 0 10px 28px rgba(var(--color-primary-rgb), 0.1);
    transform: translateY(-2px);
}
.ai-hub-card--media {
    padding: 0;
    overflow: hidden;
    gap: 0;
}
.ai-hub-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--color-surface-muted);
}
.ai-hub-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.page-ai-solution .ai-hub-card--media .ai-hub-body {
    padding: 12px 14px 14px;
}
.page-ai-solution .ai-hub-title {
    font-size: 15px;
    margin: 6px 0 4px;
}
.page-ai-solution .ai-hub-desc {
    font-size: 12.5px;
    min-height: 0;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 외부 AI 서비스 카드 */
.ai-svc-card {
    min-height: 100%;
}
.ai-svc-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.ai-hub-card .ai-svc-head {
    height: 56.5px;
}
.ai-svc-logo {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    overflow: hidden;
}
.ai-svc-logo img {
    display: block;
    width: 26px;
    height: 26px;
    object-fit: contain;
}
.ai-svc-logo--badge {
    border: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.ai-svc-logo--badge.tone-blue {
    background: var(--color-primary);
}
.ai-svc-logo--badge.tone-sky {
    background: #0284c7;
}
.ai-svc-logo--badge.tone-violet {
    background: #7c3aed;
}
.ai-svc-logo--badge.tone-rose {
    background: #e11d48;
}
.ai-svc-logo--badge.tone-mint,
.ai-svc-logo--badge.tone-teal {
    background: #0f766e;
}
.ai-svc-logo--badge.tone-amber,
.ai-svc-logo--badge.tone-orange {
    background: #ea580c;
}
.ai-svc-meta {
    min-width: 0;
    flex: 1;
}
.ai-svc-meta .ai-hub-title {
    margin: 4px 0 2px;
    font-size: 15px;
}
.ai-svc-vendor {
    margin: 0;
    font-size: 12px;
    color: var(--color-text-muted);
}
.ai-svc-card .ai-hub-desc {
    margin: 12px 0;
    min-height: 38px;
}
.ai-svc-card .ai-hub-action {
    text-decoration: none;
}

.page-ai-solution .ai-hub-grid--solution.is-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ai-svc-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-background);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}
.ai-svc-row:hover {
    border-color: var(--color-primary-border);
    box-shadow: 0 8px 22px rgba(var(--color-primary-rgb), 0.08);
}
.ai-svc-row-body {
    min-width: 0;
}
.ai-svc-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}
.ai-svc-row .ai-hub-title {
    margin: 0;
    font-size: 16px;
}
.ai-svc-row .ai-svc-vendor {
    margin: 0 0 4px;
}
.ai-svc-row .ai-hub-desc {
    margin: 0;
    min-height: 0;
    font-size: 13px;
}
.ai-svc-row .ai-hub-action {
    flex: none;
    text-decoration: none;
}

.ai-hub-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: var(--color-primary);
    background: var(--color-primary-soft);
}
.ai-hub-icon.tone-sky {
    color: #0284c7;
    background: #e0f2fe;
}
.ai-hub-icon.tone-indigo {
    color: #4f46e5;
    background: #eef2ff;
}
.ai-hub-icon.tone-mint,
.ai-hub-icon.tone-teal {
    color: #0f766e;
    background: #ccfbf1;
}
.ai-hub-icon.tone-amber,
.ai-hub-icon.tone-orange {
    color: #c2410c;
    background: #ffedd5;
}
.ai-hub-icon.tone-violet {
    color: #7c3aed;
    background: #ede9fe;
}
.ai-hub-icon.tone-rose {
    color: #e11d48;
    background: #ffe4e6;
}
.ai-hub-icon.tone-blue {
    color: var(--color-primary);
    background: var(--color-primary-soft);
}
.ai-hub-cat {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: 11.5px;
    font-weight: 700;
}
.ai-hub-title {
    margin: 8px 0 6px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--color-text);
}
.ai-hub-desc {
    margin: 0 0 14px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--color-text-muted);
    min-height: 42px;
}
.ai-hub-action {
    align-self: flex-start;
}

/* 카드 CTA 버튼 hover */
.store-card .chat-btn,
.solution-card .chat-btn,
.page-ai-solution .ai-hub-action {
    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}
.store-card .chat-btn:hover,
.store-card .chat-btn:focus-visible,
.solution-card .chat-btn:hover,
.solution-card .chat-btn:focus-visible,
.page-ai-solution .ai-hub-action:hover,
.page-ai-solution .ai-hub-action:focus-visible {
    outline: 0;
    color: #ffffff;
    border-color: var(--color-primary);
    background: var(--color-primary);
    box-shadow: 0 5px 12px rgba(var(--color-primary-rgb), 0.24);
    transform: translateY(-2px);
}
.store-card .chat-btn:active,
.solution-card .chat-btn:active,
.page-ai-solution .ai-hub-action:active {
    box-shadow: none;
    transform: translateY(0) scale(0.97);
}

@media (max-width: 1600px) {
    .ai-hub-grid--solution.is-grid,
    .ai-hub-grid--solution:not(.is-list) {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
@media (max-width: 1400px) {
    .ai-hub-grid--solution.is-grid,
    .ai-hub-grid--solution:not(.is-list) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (max-width: 1100px) {
    .ai-hub-grid--solution.is-grid,
    .ai-hub-grid--solution:not(.is-list) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 900px) {
    .ai-hub-grid,
    .ai-hub-grid--solution.is-grid,
    .ai-hub-grid--solution:not(.is-list) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 767px) {
    .page-ai-feature main,
    .page-ai-solution main {
        padding-left: 14px;
        padding-right: 14px;
    }
    .ai-hub-hero h1 {
        font-size: 26px;
    }
    .ai-hub-grid,
    .ai-hub-grid--solution.is-grid,
    .ai-hub-grid--solution:not(.is-list) {
        grid-template-columns: 1fr;
    }
    .ai-svc-row {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .ai-svc-row .ai-hub-action {
        grid-column: 2;
        justify-self: start;
    }
}

/* ==========================================================================
   이전 대화 검색 (chat-search.html)
   ========================================================================== */
.page-chat-search a.menu,
.page-chat-search a.new-chat {
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}
.page-chat-search main {
    padding-left: 28px;
    padding-right: 28px;
}
.chat-search-wrap {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 0 64px;
}
.chat-search-hero {
    margin: 0 0 22px;
    text-align: left;
}
.chat-search-hero h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.7px;
    color: var(--color-text);
}
.chat-search-hero p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text-muted);
}
.chat-search-box {
    width: 100%;
}
.chat-search-clear {
    height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.chat-search-clear:hover {
    color: var(--color-text);
    background: var(--color-primary-soft);
}
.chat-search-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    margin: 16px 0 20px;
}
.chat-search-chip {
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-background);
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.chat-search-chip:hover {
    background: var(--color-surface);
}
.chat-search-chip.is-active {
    border-color: var(--color-primary-border);
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
.chat-search-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
}
.chat-search-size {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.chat-search-size .store-page-sort-select {
    height: 36px;
    min-width: 96px;
    font-size: 13px;
}
.chat-search-pager {
    margin-top: 24px;
}
.chat-search-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-search-item {
    display: block;
    padding: 16px 18px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-background);
    text-decoration: none;
    color: inherit;
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}
.chat-search-item:hover {
    border-color: var(--color-primary-border);
    background: color-mix(in srgb, var(--color-primary) 4%, #ffffff);
}
.chat-search-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.chat-search-item-top strong {
    min-width: 0;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.4;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.chat-search-item-top time {
    flex: none;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.chat-search-item p {
    margin: 8px 0 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--color-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.chat-search-item mark {
    background: color-mix(in srgb, var(--color-primary) 18%, #ffffff);
    color: var(--color-text);
    border-radius: 3px;
    padding: 0 1px;
}
.chat-search-model {
    display: inline-flex;
    margin-top: 10px;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.1px;
    text-transform: capitalize;
}
.chat-search-empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
}

@media (max-width: 767px) {
    .page-chat-search main {
        padding-left: 14px;
        padding-right: 14px;
    }
    .chat-search-hero h1 {
        font-size: 24px;
    }
    .chat-search-item-top {
        flex-direction: column;
        gap: 4px;
    }
}

/* ---------- login ---------- */
html:has(body.page-login) {
    min-width: 0;
    overflow: auto;
    background: #ffffff;
}
body.page-login {
    /*
      좌측 배경 이미지 교체: 아래 url만 바꾸면 됩니다.
      파일은 이 CSS와 같은 assets 폴더에 두면 됩니다.
      예) --login-bg-image: url('login-bg.jpg');
    */
    --login-bg-image: url('login-bg.png');
    min-width: 0;
    min-height: 100%;
    height: auto;
    overflow: auto;
    color: var(--color-text);
    background: #ffffff;
}
body.page-login main {
    margin-left: 0 !important;
    padding: 0 !important;
    overflow: visible;
    height: auto;
    max-height: none;
    min-height: 100vh;
    background: transparent;
}
body.page-login main::before,
body.page-login main::after {
    display: none;
}
body.page-login input:focus,
body.page-login input:focus-visible,
body.page-login button:focus,
body.page-login button:focus-visible,
body.page-login a:focus,
body.page-login a:focus-visible {
    outline: none;
}
.login-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: clamp(480px, 34vw, 560px) minmax(0, 1fr);
    min-height: 100dvh;
    padding: 0;
    overflow-x: hidden;
}
.login-showcase {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 0;
    overflow: hidden;
    color: var(--color-text);
    background-color: #f4f5f8;
    background-image:
        radial-gradient(circle at 18% 20%, rgba(86, 142, 237, 0.09), transparent 32%),
        radial-gradient(circle at 84% 76%, rgba(104, 91, 210, 0.08), transparent 34%);
}
.page-login-2 .login-showcase {
    background-color: #f4f5f8;
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.login-showcase-video {
    display: block;
    width: 100%;
    height: 100%;
    min-height: inherit;
    object-fit: cover;
}
.login2-showcase-copy {
    position: absolute;
    z-index: 2;
    top: clamp(52px, 7vh, 88px);
    left: clamp(48px, 5vw, 96px);
    max-width: 560px;
    padding-top: 18px;
    text-align: left;
}
.login2-showcase-copy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 48px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #75a7ff, #326bd2);
    box-shadow: 0 4px 14px rgba(50, 107, 210, 0.25);
}
.login2-showcase-copy p {
    margin: 0 0 10px;
    color: #4774c7;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
}
.login2-showcase-copy h1 {
    margin: 0;
    color: #18243b;
    font-size: clamp(30px, 2.4vw, 44px);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1.16;
}
.login2-showcase-copy h1 strong {
    color: #326bd2;
    font-weight: inherit;
}
.login2-showcase-copy > span {
    display: block;
    margin-top: 14px;
    color: #60708c;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.025em;
    line-height: 1.6;
}
.login-showcase-copy {
    position: absolute;
    z-index: 30;
    top: clamp(44px, 6vh, 72px);
    left: clamp(34px, 3.5vw, 64px);
    max-width: 390px;
    padding-left: 18px;
    color: #18243b;
    text-align: left;
    text-shadow: 0 1px 18px rgba(255, 255, 255, 0.9);
}
.login-showcase-copy::before {
    content: '';
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 0;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #3f7ff2, #7759d9);
    box-shadow: 0 0 18px rgba(70, 112, 229, 0.3);
}
.login-showcase-eyebrow {
    margin: 0 0 10px;
    color: #3f6fc8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
}
.login-showcase-copy h1 {
    margin: 0;
    color: #18243b;
    font-size: clamp(28px, 2.3vw, 42px);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1.15;
}
.login-showcase-copy h1 strong {
    color: #376fd8;
    font-weight: inherit;
}
.login-showcase-description {
    margin: 16px 0 0;
    color: #60708c;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.025em;
    line-height: 1.65;
}
.login-mockup {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 0 0 235%;
    width: 250%;
    height: auto;
    min-height: 0;
    gap: 24px;
    margin: 0;
    transform: translate3d(2%, 10%, 0) rotate(-14deg);
    transform-origin: center;
    transform-style: preserve-3d;
}
.login-frame-row {
    width: 100%;
    overflow: visible;
    padding: 12px 0 28px;
    border: 0;
    background: transparent;
}
.login-frame-track {
    display: flex;
    width: max-content;
    gap: 24px;
    border: 0;
    background: transparent;
    will-change: transform;
}
.login-frame-row--top .login-frame-track {
    animation: login-frame-flow-left 110s linear infinite;
}
.login-frame-row--bottom .login-frame-track {
    animation: login-frame-flow-right 100s linear infinite;
}
.login-frame-card {
    position: relative;
    flex: 0 0 34vw;
    width: 34vw;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow:
        0 28px 64px rgba(35, 49, 80, 0.16),
        0 8px 20px rgba(35, 49, 80, 0.09);
}
.login-frame-card img {
    display: block;
    width: 100%;
    height: auto;
}
.login-frame-card:not(.login-frame-card--1) {
    filter: saturate(0.9) brightness(1.015);
}
.login-frame-card--1 {
    z-index: 2;
    box-shadow:
        0 44px 96px rgba(26, 42, 79, 0.24),
        0 16px 36px rgba(50, 80, 145, 0.14);
}
.login-frame-card--2 {
    z-index: 1;
}
.login-frame-card--3 {
    z-index: 1;
}
.login-frame-card--4 {
    z-index: 1;
}
.login-frame-card--5 {
    z-index: 1;
}
.login-frame-card--6 {
    z-index: 1;
}
.login-frame-card--7 {
    z-index: 1;
}
@keyframes login-frame-flow-left {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(calc(-50% - 12px), 0, 0);
    }
}
@keyframes login-frame-flow-right {
    from {
        transform: translate3d(calc(-50% - 12px), 0, 0);
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}
.login-panel {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 48px 40px;
    background: #ffffff;
}
.login-card {
    width: min(400px, 100%);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.login-head {
    display: grid;
    justify-items: start;
    margin-bottom: 28px;
    text-align: left;
}
.login-logo {
    display: block;
    height: 50px;
    width: auto;
    margin-bottom: 14px;
}
.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 5px 12px 5px 10px;
    border: 1px solid var(--color-primary-border);
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.2px;
    line-height: 1.2;
}
.login-badge strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.login-badge strong::before {
    content: '';
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-primary) 45%, var(--color-border));
}
.login-panel-title {
    margin: 0;
    color: var(--color-text);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.6px;
}
.login-form {
    display: grid;
    gap: 12px;
}
.login-field {
    display: grid;
    gap: 6px;
}
.login-field span {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;
}
.login-field input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-background);
    color: var(--color-text);
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s ease;
}
.login-field input::placeholder {
    color: var(--color-text-muted);
}
.login-field input:hover {
    border-color: color-mix(in srgb, var(--color-primary) 28%, var(--color-border));
}
.login-field input:focus,
.login-field input:focus-visible {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: none;
}
.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus,
.login-field input:-webkit-autofill:focus-visible {
    -webkit-text-fill-color: var(--color-text);
    caret-color: var(--color-text);
    border-color: var(--color-border);
    box-shadow: 0 0 0 1000px var(--color-background) inset;
    transition: background-color 9999s ease-out;
}
.login-field input:-webkit-autofill:focus,
.login-field input:-webkit-autofill:focus-visible {
    border-color: var(--color-primary);
}
.login-btn {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition:
        filter 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}
.login-btn:hover {
    filter: brightness(1.04);
}
.login-btn:active {
    transform: scale(0.99);
}
.login-btn:focus,
.login-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.2);
}
.login-btn--main {
    margin-top: 8px;
    height: 48px;
    background: var(--color-primary);
    box-shadow: none;
}
.login-btn--main:hover {
    background: var(--color-primary-hover);
    filter: none;
}
.login-btn--main:focus,
.login-btn--main:focus-visible {
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.2);
}
.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 2px;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}
.login-social {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.login-social-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 76px;
    padding: 12px 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-background);
    color: var(--color-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.2px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition:
        border-color 0.16s ease,
        background-color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}
.login-social-btn img {
    display: block;
    width: 24px;
    height: 24px;
}
.login-social-btn:hover {
    border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
    background: var(--color-surface);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}
.login-social-btn:active {
    transform: scale(0.98);
}
.login-social-btn:focus,
.login-social-btn:focus-visible {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.16);
}
.login-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 4px 0 0;
    color: var(--color-text-muted);
    font-size: 13px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.login-save input {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    border: 1.5px solid color-mix(in srgb, var(--color-text-muted) 42%, var(--color-border));
    border-radius: 4px;
    background: var(--color-background);
    outline: none;
    cursor: pointer;
    transition:
        border-color 0.16s ease,
        background-color 0.16s ease,
        box-shadow 0.16s ease;
}
.login-save input:hover {
    border-color: var(--color-primary);
}
.login-save input:focus,
.login-save input:focus-visible {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.16);
}
.login-save input:checked {
    border-color: var(--color-primary);
    background-color: var(--color-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.2 6.4 11.1 12.5 4.8' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 11px;
}
.login-links {
    display: flex;
    justify-content: flex-start;
    gap: 16px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}
.login-links a {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
    outline: none;
    border-radius: 4px;
}
.login-links a:hover {
    color: var(--color-primary);
}
.login-links a:focus,
.login-links a:focus-visible {
    outline: none;
    color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.16);
}
.login-modal[hidden] {
    display: none !important;
}
.login-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.login-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 32, 64, 0.36);
    cursor: pointer;
}
.login-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(400px, 100%);
    max-height: min(88vh, 760px);
    overflow: auto;
    padding: 24px 24px 22px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 40, 90, 0.16);
}
.login-modal-dialog[hidden] {
    display: none !important;
}
.login-modal-dialog--signup {
    width: min(440px, 100%);
}
.login-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}
.login-modal-head h2 {
    margin: 0;
    color: var(--color-text);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.6px;
}
.login-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: -6px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: #ffffff;
}
.login-modal-close:hover {
    border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
    background: var(--color-primary-soft);
}
.login-modal-close:focus,
.login-modal-close:focus-visible {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.16);
}
.login-modal-close img {
    display: block;
    width: 14px;
    height: 14px;
}
.login-modal-form {
    display: grid;
    gap: 12px;
}
.login-modal-section {
    display: grid;
    gap: 12px;
    padding: 14px 0 2px;
    border-top: 1px solid var(--color-border);
}
.login-modal-section:first-child {
    padding-top: 0;
    border-top: 0;
}
.login-modal-section-title {
    margin: 0;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.login-field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}
.login-field-hint {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 500;
    line-height: 1.45;
}
.login-terms {
    max-height: 120px;
    overflow: auto;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface-muted, #f7f8fa);
    color: var(--color-text-muted);
    font-size: 12.5px;
    line-height: 1.6;
}
.login-terms p {
    margin: 0 0 10px;
}
.login-terms p:last-child {
    margin-bottom: 0;
}
.login-terms strong {
    color: var(--color-text);
    font-weight: 700;
}
.login-btn--ghost {
    width: auto;
    min-width: 88px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--color-border);
    background: #ffffff;
    color: var(--color-text);
    box-shadow: none;
}
.login-btn--ghost:hover {
    border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
    color: var(--color-primary);
    filter: none;
}
.login-btn--ghost:focus,
.login-btn--ghost:focus-visible {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.16);
}
.login-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}
.login-modal-actions .login-btn {
    width: 100%;
}
.login-modal-actions .login-btn--main {
    margin-top: 0;
    height: 48px;
}
.login-modal-form > .login-btn--main {
    margin-top: 6px;
}
body.page-login .toast {
    z-index: 90;
}
body.page-login.login-modal-open,
html:has(body.page-login.login-modal-open) {
    overflow: hidden;
}
@media (max-width: 1199px) {
    .login-shell {
        grid-template-columns: 1fr;
        grid-template-rows: 148px minmax(0, 1fr);
        min-height: 100dvh;
    }
    .login-showcase {
        grid-column: 1;
        grid-row: 1;
        min-height: 148px;
        height: 148px;
        padding: 0;
        background-position: center 38%;
    }
    .login-showcase-copy {
        top: 50%;
        left: 50%;
        width: calc(100% - 40px);
        max-width: none;
        padding-left: 0;
        text-align: center;
        transform: translate(-50%, -50%);
    }
    .login-showcase-copy::before,
    .login-showcase-eyebrow,
    .login-showcase-description {
        display: none;
    }
    .login-showcase-copy h1 {
        font-size: 24px;
    }
    .login-showcase-copy h1 br {
        display: none;
    }
    .login2-showcase-copy {
        top: 50%;
        left: 24px;
        max-width: calc(100% - 48px);
        padding-top: 0;
        transform: translateY(-50%);
    }
    .login2-showcase-copy::before,
    .login2-showcase-copy p,
    .login2-showcase-copy > span {
        display: none;
    }
    .login2-showcase-copy h1 {
        font-size: 24px;
    }
    .login2-showcase-copy h1 br {
        display: none;
    }
    .login-mockup {
        display: none;
    }
    .login-panel {
        grid-column: 1;
        grid-row: 2;
        min-height: 0;
        align-items: flex-start;
        justify-content: center;
        padding: 32px 24px calc(32px + env(safe-area-inset-bottom, 0px));
    }
    .login-card {
        width: min(400px, 100%);
        margin: 0 auto;
    }
    .login-head {
        margin-bottom: 22px;
        justify-items: center;
        text-align: center;
    }
    .login-logo {
        height: 44px;
        margin: 0 auto;
    }
}
@media (max-width: 560px) {
    .login-shell {
        grid-template-rows: 112px minmax(0, 1fr);
    }
    .login-showcase {
        min-height: 112px;
        height: 112px;
    }
    .login-showcase-copy h1 {
        font-size: 21px;
    }
    .login2-showcase-copy h1 {
        font-size: 21px;
    }
    .login-panel {
        padding: 24px 18px calc(28px + env(safe-area-inset-bottom, 0px));
    }
    .login-logo {
        height: 40px;
    }
    .login-form {
        gap: 10px;
    }
    .login-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 14px;
    }
    .login-social {
        gap: 6px;
    }
    .login-social-btn {
        min-height: 64px;
        padding: 10px 4px 8px;
        font-size: 11px;
        border-radius: 10px;
    }
    .login-social-btn img {
        width: 22px;
        height: 22px;
    }
    .login-modal {
        padding: 0;
        align-items: flex-end;
    }
    .login-modal-dialog {
        width: 100%;
        max-height: min(92dvh, 100%);
        padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px));
        border-radius: 18px 18px 0 0;
    }
    .login-field-row {
        grid-template-columns: 1fr;
    }
    .login-field-row .login-btn--ghost {
        width: 100%;
    }
}
@media (prefers-reduced-motion: reduce) {
    .login-field input,
    .login-btn,
    .login-social-btn,
    .login-save input {
        transition: none;
    }
    .login-frame-track {
        animation: none;
    }
}

/* ==========================================================================
   페이지 상단 타이틀 공통 규격 (AI기능 기준)
   ========================================================================== */

.store-page-hero,
.tpl-top,
.page-tg-list .tg-list-hero,
.api-key-hero,
.chat-search-hero,
.page-notice .notice-hero,
.profile-hero {
    margin-top: 0;
    margin-bottom: 20px;
}

.store-page-hero {
    text-align: left;
}

.store-page-hero h1,
.tpl-top-title h1,
.page-tg-list .tg-list-hero h1,
.api-key-hero-text h1,
.chat-search-hero h1,
.page-notice .notice-hero h1,
.profile-hero h1 {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.7px;
}

@media (min-width: 768px) {
    body.sidebar-collapsed .sidebar .menu:hover .menu-label,
    body.sidebar-collapsed .sidebar .menu:focus-visible .menu-label {
        display: none !important;
    }
}

.store-page-hero p,
.tpl-top-title p,
.page-tg-list .tg-list-hero p,
.api-key-hero-text p,
.chat-search-hero p,
.page-notice .notice-hero p,
.profile-hero p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

/* ==========================================================================
   이미지 생성 채팅 (picture-create.html)
   ========================================================================== */
.page-picture-create a.menu {
    box-sizing: border-box;
    color: inherit;
    text-decoration: none;
}
.page-picture-create main,
body.sidebar-collapsed.page-picture-create main {
    display: flex;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: var(--color-background);
}
.picture-create-room {
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    padding: 18px 0 14px;
    background: var(--color-background);
}
.picture-create-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
.picture-create-thread,
.picture-create-bottom {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    box-sizing: border-box;
}
.picture-create-thread {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0 4px;
}
.picture-create-bottom {
    flex: none;
    padding: 8px 4px 0;
}
.picture-composer {
    width: 100%;
    min-height: 120px;
}
.picture-composer textarea {
    max-height: 160px;
    overflow-y: auto;
    font-size: 16px;
}
.picture-attachments {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin: -6px 6px 18px;
}
.picture-attachments.is-visible {
    display: flex;
}
.picture-attachment {
    position: relative;
    width: 64px;
    height: 64px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface-muted);
}
.picture-attachment img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}
.picture-attachment button {
    position: absolute;
    top: -7px;
    right: -7px;
    display: flex;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #202226;
    color: #fff;
    font-size: 14px;
    line-height: 1;
}
.picture-generated-image {
    width: 100%;
    margin: 0;
    overflow: hidden;
    border-radius: 18px;
    background: var(--color-surface-muted);
}
.picture-generated-image img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}
@media (max-width: 1199px) {
    .picture-create-room {
        padding: 18px 0 14px;
    }
}
@media (max-width: 767px) {
    .page-picture-create main,
    body.sidebar-collapsed.page-picture-create main {
        padding: 0 !important;
    }
    .picture-create-room {
        padding: 56px 0 10px;
    }
    .picture-create-thread,
    .picture-create-bottom {
        max-width: 100%;
        padding-left: 14px;
        padding-right: 14px;
    }
    .picture-create-bottom {
        padding-top: 8px;
    }
    .picture-composer {
        min-height: 120px;
        padding: 16px;
        border-radius: 16px;
    }
    .picture-composer textarea {
        padding: 0;
        font-size: 16px;
    }
    .picture-generated-image {
        border-radius: 14px;
    }
}

/* ==========================================================================
   문서 검토 (document-review.html)
   ========================================================================== */
.page-document-review a.menu {
    color: inherit;
    text-decoration: none;
}
.page-document-review main,
body.sidebar-collapsed.page-document-review main {
    padding: 32px;
    background: var(--color-surface);
}
.document-review-wrap {
    display: flex;
    width: min(100%, var(--content-max));
    min-height: 100%;
    margin: 0 auto;
    flex-direction: column;
}
.document-review-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}
.document-review-hero h1 {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.7px;
    line-height: 1.2;
}
.document-review-hero p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 15px;
    line-height: 1.5;
}
.document-review-format {
    display: inline-flex;
    align-items: center;
    flex: none;
    padding: 7px 12px;
    border: 1px solid var(--color-primary-border);
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.2px;
}
.document-review-layout {
    display: grid;
    flex: 1;
    min-height: 620px;
    grid-template-columns: 370px minmax(0, 1fr);
    gap: 20px;
}
.document-review-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-background);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}
.document-review-control {
    align-self: stretch;
    padding: 22px;
}
.document-review-result {
    display: flex;
    min-height: 0;
    flex-direction: column;
}
.document-review-panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--color-border);
}
.document-review-control .document-review-panel-head {
    margin-bottom: 22px;
}
.document-review-result-head {
    flex: none;
    margin: 0 22px;
    padding: 22px 0 18px;
}
.document-review-panel-icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-primary-border);
    border-radius: 11px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
.document-review-panel-icon img,
.document-review-panel-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}
.document-review-panel-head h2 {
    margin: 0 0 3px;
    color: var(--color-text);
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -0.35px;
    line-height: 1.3;
}
.document-review-panel-head p {
    margin: 0;
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.document-review-form {
    display: flex;
    flex-direction: column;
}
.document-review-label {
    margin-bottom: 8px;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 650;
}
.document-review-file {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-background);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.document-review-file:hover,
.document-review-file.has-file {
    border-color: var(--color-primary-border);
    background: color-mix(in srgb, var(--color-primary) 3%, #ffffff);
}
.document-review-file:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.12);
}
.document-review-file-info {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}
.document-review-file-badge {
    display: inline-flex;
    min-width: 38px;
    height: 26px;
    flex: none;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 7px;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.2px;
}
.document-review-file.has-file .document-review-file-badge {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
.document-review-file-name {
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: 13px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.document-review-file.has-file .document-review-file-name {
    color: var(--color-text);
    font-weight: 600;
}
.document-review-file-remove {
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex: none;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 18px;
    line-height: 1;
}
.document-review-file-remove[hidden] {
    display: none;
}
.document-review-file-remove:hover,
.document-review-file-remove:focus-visible {
    background: var(--color-surface-muted);
    color: var(--color-text);
    outline: 0;
}
.document-review-primary-actions,
.document-review-mode-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.document-review-primary-actions {
    margin-top: 10px;
}
.document-review-divider {
    height: 1px;
    margin: 22px 0;
    background: var(--color-border);
}
.document-review-btn,
.document-review-mode {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.2;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.document-review-btn {
    min-height: 42px;
    padding: 10px 12px;
}
.document-review-btn--secondary {
    border: 1px solid var(--color-primary-border);
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
}
.document-review-btn--primary {
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--color-primary-hover), var(--color-primary), var(--color-secondary));
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.2);
    color: #fff;
}
.document-review-btn--secondary:hover,
.document-review-btn--secondary:focus-visible {
    border-color: var(--color-primary);
    background: var(--color-primary-tint);
    outline: 0;
}
.document-review-btn--primary:not(:disabled):hover,
.document-review-btn--primary:not(:disabled):focus-visible {
    filter: brightness(1.05);
    box-shadow: 0 6px 16px rgba(var(--color-primary-rgb), 0.28);
    outline: 0;
}
.document-review-btn:active,
.document-review-mode:active {
    transform: scale(0.98);
}
.document-review-btn:disabled,
.document-review-mode:disabled {
    border-color: var(--color-border);
    background: var(--color-surface-muted);
    box-shadow: none;
    color: #a1a7b0;
    cursor: not-allowed;
    filter: none;
    transform: none;
}
.document-review-mode {
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    background: var(--color-background);
    color: var(--color-text);
}
.document-review-mode:not(:disabled):hover,
.document-review-mode:not(:disabled):focus-visible,
.document-review-mode.is-active {
    border-color: var(--color-primary-border);
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    outline: 0;
}
.document-review-mode.is-active {
    box-shadow: inset 0 0 0 1px var(--color-primary-border);
}
.document-review-result-body {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 22px;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
.document-review-empty,
.document-review-loading {
    display: flex;
    min-height: 420px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}
.document-review-empty-icon {
    display: inline-flex;
    width: 58px;
    height: 58px;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-surface);
}
.document-review-empty-icon img {
    width: 24px;
    height: 24px;
    opacity: 0.45;
}
.document-review-empty strong,
.document-review-loading strong {
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
}
.document-review-empty p,
.document-review-loading p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 13px;
    line-height: 1.5;
}
.document-review-spinner {
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
    border: 4px solid var(--color-primary-soft);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: composer-file-spin 0.75s linear infinite;
}
.document-review-content {
    color: #1f2937;
    font-size: 14px;
    line-height: 1.7;
    letter-spacing: -0.2px;
}
.document-review-content > *:first-child {
    margin-top: 0;
}
.document-review-content > *:last-child {
    margin-bottom: 0;
}
.document-review-content h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.35px;
    line-height: 1.35;
}
.document-review-content h4 {
    margin: 20px 0 8px;
    font-size: 15px;
    font-weight: 750;
    line-height: 1.4;
}
.document-review-content p {
    margin: 0 0 12px;
}
.document-review-content ul {
    margin: 0 0 12px;
    padding-left: 1.25em;
}
.document-review-content li {
    margin-bottom: 5px;
}
.document-review-table-wrap {
    width: 100%;
    margin: 8px 0 16px;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: 12px;
}
.document-review-table-wrap table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    background: var(--color-background);
}
.document-review-table-wrap th,
.document-review-table-wrap td {
    padding: 11px 12px;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
    vertical-align: top;
}
.document-review-table-wrap tr > *:last-child {
    border-right: 0;
}
.document-review-table-wrap tbody tr:last-child > * {
    border-bottom: 0;
}
.document-review-table-wrap thead th {
    background: color-mix(in srgb, var(--color-primary) 14%, #ffffff);
    color: var(--color-primary-hover);
    font-weight: 700;
    white-space: nowrap;
}
.document-review-table-wrap tbody th {
    color: var(--color-text);
    font-weight: 700;
}
.document-review-table-wrap tbody tr:nth-child(even) {
    background: var(--color-surface);
}
.document-review-proofread-table {
    margin-top: 0;
}
.document-review-proofread-table table {
    min-width: 560px;
}
.document-review-table-empty td {
    height: 100px;
    color: var(--color-text-muted);
    text-align: center;
    vertical-align: middle;
}
@media (max-width: 1199px) {
    .page-document-review main,
    body.sidebar-collapsed.page-document-review main {
        padding: 28px;
    }
    .document-review-layout {
        grid-template-columns: 330px minmax(0, 1fr);
    }
}
@media (max-width: 960px) {
    .document-review-layout {
        min-height: 0;
        grid-template-columns: 1fr;
    }
    .document-review-control {
        padding: 20px;
    }
    .document-review-result {
        min-height: 560px;
    }
}
@media (max-width: 767px) {
    .page-document-review main,
    body.sidebar-collapsed.page-document-review main {
        padding: 72px 14px 18px !important;
    }
    .document-review-hero {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
    .document-review-hero h1 {
        font-size: 25px;
    }
    .document-review-format {
        display: none;
    }
    .document-review-layout {
        gap: 14px;
    }
    .document-review-panel {
        border-radius: 14px;
    }
    .document-review-result {
        min-height: 520px;
    }
    .document-review-result-head {
        margin: 0 16px;
        padding-top: 18px;
    }
    .document-review-result-body {
        padding: 16px;
    }
    .document-review-empty,
    .document-review-loading {
        min-height: 320px;
    }
}
@media (max-width: 430px) {
    .document-review-primary-actions,
    .document-review-mode-actions {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   문서 생성 채팅 (document-create.html)
   ========================================================================== */
.page-document-create a.menu {
    box-sizing: border-box;
    color: inherit;
    text-decoration: none;
}
.page-document-create main,
body.sidebar-collapsed.page-document-create main {
    display: flex;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: var(--color-background);
}
.document-create-room {
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    padding: 18px 0 14px;
    background: var(--color-background);
}
.document-create-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-color: var(--scrollbar-thumb) transparent;
    scrollbar-width: thin;
}
.document-create-thread,
.document-create-bottom {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    box-sizing: border-box;
}
.document-create-thread {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0 4px;
}
.document-create-bottom {
    position: relative;
    z-index: 4;
    flex: none;
    padding: 8px 4px 0;
}
.document-create-composer {
    width: 100%;
    min-height: 228px;
    padding: 16px 18px;
    gap: 10px;
}
.document-create-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding: 10px 12px 9px;
    border: 1px solid color-mix(in srgb, var(--color-border) 82%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-surface) 58%, var(--color-background));
    transition:
        border-color 0.16s ease,
        background 0.16s ease,
        box-shadow 0.16s ease;
}
.document-create-field:hover {
    border-color: color-mix(in srgb, var(--color-primary) 24%, var(--color-border));
}
.document-create-field:focus-within {
    border-color: var(--color-primary-border);
    background: var(--color-background);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.09);
}
.document-create-field label {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--color-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.2px;
    line-height: 1.3;
    text-align: left;
}
.document-create-field label span {
    margin-left: 0;
    color: var(--color-danger, #ef4444);
}
.page-document-create .document-create-field textarea {
    width: 100%;
    min-height: 42px;
    max-height: 110px;
    height: 42px;
    padding: 0;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.55;
    box-sizing: border-box;
}
.page-document-create .document-create-field textarea:focus {
    box-shadow: none;
}
.page-document-create .document-create-field textarea::placeholder {
    color: color-mix(in srgb, var(--color-text-muted) 82%, transparent);
}
.document-create-bar {
    min-height: 42px;
}
.document-format-select {
    position: relative;
}
.document-format-button {
    display: inline-flex;
    min-width: 142px;
    height: 40px;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-background);
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.2px;
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}
.document-format-button:hover,
.document-format-button:focus-visible,
.document-format-button[aria-expanded='true'] {
    border-color: var(--color-primary-border);
    background: var(--color-primary-soft);
    outline: 0;
}
.document-format-button.has-value {
    color: var(--color-text);
}
.document-format-button > img:first-child {
    width: 17px;
    height: 17px;
    flex: none;
}
.document-format-required {
    margin-left: -3px;
    color: var(--color-danger, #ef4444);
    font-size: 17px;
    line-height: 1;
}
.document-format-label {
    white-space: nowrap;
}
.document-format-chevron {
    width: 12px;
    height: 7px;
    margin-left: auto;
    transition: transform 0.2s ease;
}
.document-format-button[aria-expanded='true'] .document-format-chevron {
    transform: rotate(180deg);
}
.document-format-menu {
    position: fixed;
    z-index: 30;
    top: 0;
    left: 0;
    display: grid;
    width: 218px;
    padding: 6px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-background);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
    opacity: 0;
    pointer-events: none;
    transform: translateY(7px) scale(0.98);
    transform-origin: left bottom;
    transition:
        opacity 0.16s ease,
        transform 0.16s ease;
}
.document-format-menu.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.document-format-menu button {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    width: 100%;
    padding: 10px;
    border-radius: 9px;
    color: var(--color-text);
    text-align: left;
}
.document-format-menu button:hover,
.document-format-menu button:focus-visible,
.document-format-menu button.is-selected {
    background: var(--color-primary-soft);
    outline: 0;
}
.document-format-menu strong {
    color: var(--color-primary);
    font-size: 13px;
}
.document-format-menu span {
    color: var(--color-text-muted);
    font-size: 12px;
}
.document-create-request-format {
    display: inline-flex;
    margin-top: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
}
.page-document-create .document-create-request-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    line-height: 1.55;
}
.page-document-create .document-create-request-list li {
    display: grid;
    grid-template-columns: 10px 62px 8px minmax(0, 1fr);
    align-items: baseline;
}
.page-document-create .document-create-request-list li::before {
    content: '•';
    color: var(--color-text-muted);
}
.page-document-create .document-create-request-list strong {
    font-weight: 700;
}
.page-document-create .document-create-request-list span {
    color: var(--color-text-muted);
}
@media (max-width: 767px) {
    .page-document-create main,
    body.sidebar-collapsed.page-document-create main {
        padding: 0 !important;
    }
    .document-create-room {
        padding: 56px 0 10px;
    }
    .document-create-thread,
    .document-create-bottom {
        max-width: 100%;
        padding-right: 14px;
        padding-left: 14px;
    }
    .document-create-bottom {
        padding-top: 8px;
    }
    .document-create-composer {
        min-height: 222px;
        padding: 14px;
        border-radius: 16px;
    }
    .document-create-field {
        padding: 9px 10px 8px;
        border-radius: 11px;
    }
    .page-document-create .document-create-field textarea {
        min-height: 40px;
        height: 40px;
        font-size: 13px;
    }
}

/* ==========================================================================
   데이터 분석 채팅 (data-analyze.html)
   ========================================================================== */
.page-data-analyze main,
body.sidebar-collapsed.page-data-analyze main {
    position: relative;
    background: var(--color-background);
}
.data-analyze-room {
    background: var(--color-background);
}
.data-analyze-bottom {
    position: relative;
    z-index: 4;
}
.data-analyze-composer {
    min-height: 120px;
}
.data-analyze-attachments {
    display: none;
    min-height: 26px;
    align-items: center;
}
.data-analyze-attachments.is-visible {
    display: flex;
}
.data-analyze-file-chip {
    display: inline-flex;
    max-width: min(100%, 340px);
    height: 30px;
    align-items: center;
    gap: 7px;
    padding: 0 6px 0 8px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 12px;
}
.data-analyze-file-type {
    flex: none;
    padding: 2px 5px;
    border-radius: 5px;
    background: color-mix(in srgb, #16a34a 12%, #ffffff);
    color: #15803d;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.3;
}
.data-analyze-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.data-analyze-file-chip button {
    display: inline-flex;
    width: 20px;
    height: 20px;
    flex: none;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    color: var(--color-text-muted);
    font-size: 16px;
    line-height: 1;
}
.data-analyze-file-chip button:hover,
.data-analyze-file-chip button:focus-visible {
    background: var(--color-surface-muted);
    color: var(--color-text);
    outline: 0;
}
.data-analyze-add {
    display: inline-flex;
    height: 38px;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-background);
    color: var(--color-text);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.2px;
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}
.data-analyze-add:hover,
.data-analyze-add:focus-visible {
    border-color: var(--color-primary-border);
    background: var(--color-primary-soft);
    outline: 0;
}
.data-analyze-add img {
    width: 16px;
    height: 16px;
}
.data-analysis-overlay[hidden] {
    display: none;
}
.data-analysis-overlay {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(1px);
}
.data-analysis-overlay-content {
    display: flex;
    min-width: 240px;
    align-items: center;
    flex-direction: column;
    padding: 24px;
    color: var(--color-text);
    text-align: center;
}
.data-analysis-overlay-content strong {
    margin-top: 15px;
    font-size: 15px;
}
.data-analysis-overlay-content p {
    margin: 6px 0 0;
    color: var(--color-text-muted);
    font-size: 12px;
}
.data-analysis-spinner {
    width: 54px;
    height: 54px;
    border: 5px solid rgba(255, 255, 255, 0.7);
    border-top-color: var(--color-primary);
    border-right-color: var(--color-secondary);
    border-radius: 50%;
    animation: composer-file-spin 0.8s linear infinite;
}

/* 공통 로딩 모달 */
.common-loading-modal[hidden] {
    display: none;
}
.common-loading-modal {
    position: fixed;
    z-index: 20000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}
.common-loading-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(2px);
}
.common-loading-dialog {
    position: relative;
    display: flex;
    width: min(100%, 320px);
    min-height: 210px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    padding: 32px 28px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 20px;
    background: var(--color-background);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
    text-align: center;
    outline: 0;
    animation: common-loading-dialog-in 0.2s ease-out both;
}
.common-loading-spinner {
    position: relative;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 5px solid var(--color-primary-soft);
    border-top-color: var(--color-primary);
    border-right-color: var(--color-secondary);
    border-radius: 50%;
    transform-origin: center;
    will-change: transform;
    animation: common-loading-spin 0.8s linear infinite;
}
.common-loading-title {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-text);
}
.common-loading-description {
    margin: 7px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-muted);
}
body.common-loading-open {
    overflow: hidden !important;
}
@keyframes common-loading-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
@keyframes common-loading-dialog-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 공통 로딩 예시 페이지 */
html.page-loading-demo-root,
body.page-loading-demo {
    min-width: 0;
    min-height: 100%;
    height: auto;
    overflow: auto;
    background: var(--color-surface);
}
.page-loading-demo .loading-demo-main {
    display: flex;
    width: min(100% - 40px, 760px);
    height: auto;
    min-height: 100vh;
    max-height: none;
    margin: 0 auto;
    padding: 40px 0;
    flex-direction: column;
    justify-content: center;
    overflow: visible;
}
.loading-demo-header {
    margin-bottom: 20px;
}
.loading-demo-header a,
.loading-demo-header img {
    display: block;
    width: 119px;
}
.loading-demo-card {
    padding: 40px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-background);
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.06);
}
.loading-demo-label {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.loading-demo-card h1 {
    margin: 14px 0 8px;
    font-size: 28px;
    line-height: 1.35;
}
.loading-demo-card > p {
    max-width: 560px;
    margin: 0;
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 1.7;
}
.loading-demo-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 32px;
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
}
.loading-demo-preview > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}
.loading-demo-preview strong {
    font-size: 14px;
}
.loading-demo-preview span {
    color: var(--color-text-muted);
    font-size: 12px;
}
.loading-demo-preview button {
    flex: none;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    background: var(--color-primary);
    color: var(--color-background);
    font-size: 13px;
    font-weight: 600;
}
.loading-demo-preview button:hover,
.loading-demo-preview button:focus-visible {
    background: var(--color-primary-hover);
    outline: 3px solid var(--color-primary-soft);
}
.loading-demo-preview button:disabled {
    cursor: wait;
    opacity: 0.65;
}
.loading-demo-code {
    display: flex;
    margin-top: 16px;
    padding: 16px 18px;
    flex-direction: column;
    gap: 9px;
    border-radius: 12px;
    background: #111827;
    color: #e5e7eb;
}
.loading-demo-code > span {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 600;
}
.loading-demo-code code {
    font-size: 12px;
    line-height: 1.7;
}
@media (max-width: 600px) {
    .page-loading-demo .loading-demo-main {
        width: min(100% - 28px, 760px);
        padding: 24px 0;
    }
    .loading-demo-card {
        padding: 28px 22px;
    }
    .loading-demo-card h1 {
        font-size: 24px;
    }
    .loading-demo-preview {
        align-items: stretch;
        flex-direction: column;
        gap: 16px;
    }
    .loading-demo-preview button {
        width: 100%;
    }
}
@media (prefers-reduced-motion: reduce) {
    .common-loading-dialog {
        animation: none;
    }
    .common-loading-spinner {
        animation: common-loading-spin 1.6s linear infinite;
    }
}
.data-analyze-uploaded-file {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
}
.data-analysis-report,
.data-analysis-summary {
    font-size: 14px;
    line-height: 1.65;
}
.data-analysis-report h3,
.data-analysis-summary h3 {
    margin: 0 0 8px;
    font-size: 18px;
}
.data-analysis-report h4,
.data-analysis-summary h4 {
    margin: 18px 0 8px;
    font-size: 14px;
}
.data-analysis-report p,
.data-analysis-summary p {
    margin: 0 0 10px;
}
.data-analysis-report hr,
.data-analysis-summary hr {
    height: 1px;
    margin: 16px 0;
    border: 0;
    background: var(--color-border);
}
.data-analysis-report ul,
.data-analysis-summary ul {
    margin: 0;
    padding-left: 20px;
}
.data-analysis-table-wrap {
    width: 100%;
    margin: 8px 0 16px;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: 10px;
}
.data-analysis-table-wrap table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    background: var(--color-background);
}
.data-analysis-table-wrap th,
.data-analysis-table-wrap td {
    padding: 9px 10px;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
    vertical-align: top;
}
.data-analysis-table-wrap tr > *:last-child {
    border-right: 0;
}
.data-analysis-table-wrap tbody tr:last-child > * {
    border-bottom: 0;
}
.data-analysis-table-wrap thead th {
    background: color-mix(in srgb, var(--color-primary) 14%, #ffffff);
    color: var(--color-primary-hover);
    font-weight: 700;
}
@media (max-width: 767px) {
    .data-analysis-report,
    .data-analysis-summary {
        font-size: 13px;
    }
    .data-analysis-table-wrap table {
        min-width: 470px;
    }
}
/* 커스텀 */
#chatThread, #pictureCreateThread {
    padding-bottom: 60vh;
}

/* mathlive */
.ML__menu-toggle { display: none !important; }
.ML__virtual-keyboard-toggle { display: none !important; }
.ML__keyboard {
    z-index: 2147483647 !important;   /* 모달 배경보다 무조건 위 */
}
.math-modal{position:fixed;inset:0;background:rgba(0,0,0,.4);
    display:flex;align-items:center;justify-content:center;z-index:9999}
.math-modal[hidden]{display:none}
.math-modal-box{background:#fff;border-radius:12px;padding:16px;min-width:340px;
    box-shadow:0 8px 30px rgba(0,0,0,.2)}
.math-modal-title{font-weight:600;margin-bottom:10px}
#mathField{width:100%;font-size:22px;border:1px solid #ddd;border-radius:8px;padding:10px}
.math-modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:14px}
.math-modal-actions button{padding:6px 14px;border-radius:8px;border:1px solid #ddd;cursor:pointer}
.btn-insert{background:#2b6cff;color:#fff;border-color:#2b6cff}

#chatMessage{min-height:44px;padding:10px;outline:none;white-space:pre-wrap;overflow-y:auto;max-height:200px}
#chatMessage:empty::before{content:attr(data-ph);color:#999;pointer-events:none}
#chatMessage math-field{display:inline-block;margin:0 2px}
#chatMessage {
    border: none;
    outline: none;
    box-shadow: none;
}
#chatMessage math-field {
    border: none !important;
    background: transparent;
    padding: 0;
}
#chatMessage math-field::part(container) {
    border: none !important;
    background: transparent;
}

/* 코드 css 추가 */
/* 채팅 메시지 너비 제한 */
.page-chat .chat-bubble {
    min-width: 0;
    box-sizing: border-box;
}

/* Markdown 코드 블록 */
.page-chat .chat-md pre,
.page-chat .chat-bubble pre {
    max-width: 100%;
    min-width: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

/* 코드 블록 내부 텍스트 */
.page-chat .chat-md pre code,
.page-chat .chat-bubble pre code {
    white-space: inherit;
    overflow-wrap: inherit;
}


/* 커스텀 모달팝업 */
/* 개인정보 활용 동의 모달 */
.modal:has(.agreement-container) {
    inset: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.55);
}

.modal:has(.agreement-container) .popup {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.modal:has(.agreement-container) .popup-cont {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    padding: 30px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%);
}

.modal:has(.agreement-container) .pop-tit {
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
}

.modal:has(.agreement-container) .agreement-container {
    min-height: 0;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
}

.modal:has(.agreement-container) .agreement-container p {
    margin: 0;
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.9;
    overflow-wrap: break-word;
}

.modal:has(.agreement-container) .buttons {
    display: flex;
    justify-content: center;
}

.modal:has(.agreement-container) #agreementBtn {
    width: 100%;
    padding: 13px 20px;
    border-radius: 10px;
    background: var(--color-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.modal:has(.agreement-container) #agreementBtn:hover {
    background: var(--color-primary-hover);
}

/* 닫기 버튼 */
.modal:has(.agreement-container) .closed-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 28px;
    height: 28px;
    cursor: pointer;
}

.modal:has(.agreement-container) .closed-btn::before,
.modal:has(.agreement-container) .closed-btn::after {
    content: '';
    position: absolute;
    top: 13px;
    left: 5px;
    width: 18px;
    height: 2px;
    background: var(--color-text-muted);
}

.modal:has(.agreement-container) .closed-btn::before {
    transform: rotate(45deg);
}

.modal:has(.agreement-container) .closed-btn::after {
    transform: rotate(-45deg);
}

@media (max-width: 767px) {
    .modal:has(.agreement-container) .popup {
        padding: 12px;
    }

    .modal:has(.agreement-container) .popup-cont {
        padding: 24px 18px;
    }

    .modal:has(.agreement-container) .pop-tit {
        font-size: 18px;
    }

    .modal:has(.agreement-container) .agreement-container p {
        font-size: 13px;
    }
}



/* ==============================
   공지사항 팝업
============================== */

/* 전체 화면 오버레이 */
#notice-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 8999;
    background: rgba(15, 23, 42, 0.55);
}

#notice-popup-overlay.on {
    display: block;
}


/* ==============================
   팝업 전체 컨테이너
============================== */

.notice-popup-item {
    position: absolute;
    display: flex;
    flex-direction: column;

    width: calc(100% - 40px);
    max-width: 600px;
    max-height: 85vh;

    background: #ffffff;
    border: 1px solid #d9dee7;
    border-radius: 14px;

    box-shadow:
            0 24px 64px rgba(15, 23, 42, 0.22),
            0 4px 12px rgba(15, 23, 42, 0.08);

    overflow: hidden;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
}


/* ==============================
   1. 헤더 영역
============================== */

.notice-popup-header {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    min-height: 64px;
    padding: 0 24px;

    background: #e2e6ec;
    border-bottom: 1px solid #d2d8e1;

    box-sizing: border-box;
}

/* 헤더 제목 */
.notice-popup-title {
    flex: 1;
    min-width: 0;

    margin: 0;
    padding: 0;

    color: #202938;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: -0.3px;

    overflow-wrap: anywhere;
}

/* 헤더 X 버튼 */
.notice-popup-close-x {
    position: static;

    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    margin: 0;
    padding: 0;

    border: none;
    border-radius: 6px;

    background: transparent;
    color: #64748b;

    font-size: 18px;
    font-weight: 400;
    line-height: 1;

    cursor: pointer;

    transition:
            background 0.2s,
            color 0.2s;
}

.notice-popup-close-x:hover {
    background: #d3d9e2;
    color: #202938;
}


/* ==============================
   2. 바디 영역
============================== */

.notice-popup-body {
    flex: 0 1 auto;
    min-height: 0;

    padding: 24px;

    background: #ffffff;
    color: #334155;

    font-size: 14px;
    line-height: 1.7;

    overflow-x: hidden;
    overflow-y: auto;
    overflow-wrap: anywhere;

    box-sizing: border-box;
}

/* 본문 제목 H1 */
.notice-popup-body h1 {
    margin: 0 0 16px;

    color: #1e293b;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;

    overflow-wrap: anywhere;
}

/* 본문 제목 H2 */
.notice-popup-body h2 {
    margin: 0 0 14px;

    color: #1e293b;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;

    overflow-wrap: anywhere;
}

/* 본문 제목 H3 */
.notice-popup-body h3 {
    margin: 0 0 12px;

    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;

    overflow-wrap: anywhere;
}

/* 문단 */
.notice-popup-body p {
    margin: 0 0 12px;
    line-height: 1.7;
}

.notice-popup-body p:last-child {
    margin-bottom: 0;
}

/* 이미지 */
.notice-popup-body img {
    display: block;
    max-width: 100%;
    height: auto;

    border-radius: 6px;
    object-fit: contain;
}

/* 동영상 */
.notice-popup-body video {
    max-width: 100%;
    height: auto;
}

/* iframe */
.notice-popup-body iframe {
    max-width: 100%;
    border: none;
}

/* 테이블 */
.notice-popup-body table {
    max-width: 100%;
    border-collapse: collapse;
}

/* 긴 코드 및 텍스트 */
.notice-popup-body pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* 리스트 */
.notice-popup-body ul,
.notice-popup-body ol {
    padding-left: 24px;
    margin: 0 0 12px;
}

/* 링크 */
.notice-popup-body a {
    color: #4f73ee;
    text-decoration: underline;
}

/* 본문 스크롤바 */
.notice-popup-body::-webkit-scrollbar {
    width: 6px;
}

.notice-popup-body::-webkit-scrollbar-track {
    background: transparent;
}

.notice-popup-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
}

.notice-popup-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* ==============================
   3. 푸터 영역
============================== */

.notice-popup-footer {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    min-height: 68px;
    padding: 12px 24px;

    background: #f1f3f6;
    border-top: 1px solid #dee3ea;

    box-sizing: border-box;
}


/* ==============================
   다시 보지 않기 버튼
============================== */

.notice-popup-hide-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 36px;
    padding: 8px 14px;

    background: #ffffff;
    color: #475569;

    border: 1px solid #d7dde5;
    border-radius: 7px;

    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;

    cursor: pointer;
    white-space: nowrap;

    transition:
            background 0.2s,
            border-color 0.2s;
}

.notice-popup-hide-btn:hover {
    background: #e9edf3;
    border-color: #c3ccd8;
}


/* ==============================
   닫기 버튼
============================== */

.notice-popup-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 76px;
    min-height: 36px;
    padding: 8px 18px;

    background: #4f73ee;
    color: #ffffff;

    border: none;
    border-radius: 7px;

    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;

    cursor: pointer;
    white-space: nowrap;

    transition: background 0.2s;
}

.notice-popup-close-btn:hover {
    background: #3c60dc;
}


/* ==============================
   모바일 반응형
============================== */

@media (max-width: 767px) {

    /* 팝업 전체 */
    .notice-popup-item {
        width: calc(100% - 24px);
        max-height: 85vh;
        border-radius: 12px;
    }

    /* 헤더 */
    .notice-popup-header {
        min-height: 56px;
        padding: 0 18px;
        gap: 12px;
    }

    /* 헤더 제목 */
    .notice-popup-title {
        font-size: 16px;
    }

    /* X 버튼 */
    .notice-popup-close-x {
        width: 30px;
        height: 30px;
        font-size: 18px;
    }

    /* 바디 */
    .notice-popup-body {
        padding: 20px 18px;
        font-size: 13px;
        line-height: 1.6;
    }

    .notice-popup-body h1 {
        font-size: 18px;
    }

    .notice-popup-body h2 {
        font-size: 16px;
    }

    .notice-popup-body h3 {
        font-size: 15px;
    }

    .notice-popup-body p {
        margin-bottom: 10px;
    }

    /* 푸터 */
    .notice-popup-footer {
        min-height: 62px;
        padding: 12px 18px;
        gap: 10px;
    }

    /* 다시 보지 않기 */
    .notice-popup-hide-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* 닫기 */
    .notice-popup-close-btn {
        min-width: 70px;
        padding: 8px 16px;
        font-size: 12px;
    }
}