/* ============================================
   Apple Design System - Mobile-First Responsive
   Pure Apple Aesthetic with SF Colors
   ============================================ */

:root {
    /* 고려대학교 시그니처 컬러 (KU Crimson) */
    --ku-crimson: #961A32;
    --ku-crimson-dark: #7a1529;
    --ku-crimson-light: #b02a44;
    --ku-crimson-lighter: #f9ecee;

    /* Apple System Colors */
    --apple-blue: #007AFF;
    --apple-blue-dark: #0051D5;
    --apple-blue-light: #5AC8FA;
    --apple-blue-lighter: rgba(0, 122, 255, 0.1);
    --apple-green: #34C759;
    --apple-red: #FF3B30;
    --apple-orange: #FF9500;
    --apple-purple: #5856D6;

    /* 배경 컬러 */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-tertiary: #fafafa;
    --bg-dark: #1d1d1f;

    /* 텍스트 컬러 */
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #6e6e73;
    --text-light: #ffffff;

    /* 보더 & 디바이더 */
    --border-color: #d2d2d7;
    --border-light: #e5e5ea;
    --divider: rgba(0, 0, 0, 0.06);

    /* 반경 (Radius) */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-2xl: 30px;
    --radius-full: 999px;

    /* 그림자 (Shadow) */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.10);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.12);
    --shadow-apple: 0 8px 30px rgba(0, 0, 0, 0.04);

    /* 간격 (Spacing) */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;
    --spacing-4xl: 80px;
    --spacing-5xl: 120px;

    /* 전환 효과 (Transitions) */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-apple: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* 폰트 */
    --font-system: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;

    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ============================================
   기본 스타일 & 리셋
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-system);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ============================================
   애니메이션
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   헤더 & 네비게이션 (모바일 우선)
   ============================================ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--divider);
    transition: all var(--transition-base);
    animation: slideInDown 0.6s ease-out;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-sm);
}

.nav {
    max-width: 1600px;
    margin: 0 auto;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-md);
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: var(--z-modal);
    position: relative;
}

.logo:active {
    transform: scale(0.97);
}

.logo-img {
    height: 3rem;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
}

.logo-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-subtitle {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

/* 햄버거 메뉴 버튼 (모바일) */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: var(--z-modal);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.menu-toggle span {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-base);
    transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* 네비게이션 메뉴 */
.nav-menu {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all var(--transition-slow);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0);
    border-bottom: 1px solid transparent;
}

.nav-menu.active {
    max-height: 700px;
    opacity: 1;
    box-shadow: var(--shadow-md);
    border-bottom-color: var(--border-light);
}

.nav-menu a {
    display: block;
    padding: 16px var(--spacing-lg);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: rgba(150, 26, 50, 0.1);
    white-space: nowrap;
    overflow: visible;
}

.nav-menu a:last-child {
    border-bottom: none;
}

.nav-menu a:active {
    background: var(--bg-secondary);
    color: var(--apple-blue);
}

.nav-menu a.active {
    color: var(--ku-crimson);
    background: var(--ku-crimson-lighter);
}

/* 데스크톱 네비게이션 */
@media (min-width: 1220px) {
    .nav {
        height: 56px;
        padding: 0 clamp(24px, 4vw, 64px);
    }

    .logo {
        font-size: 1.2rem;
        gap: 14px;
    }

    .logo-img {
        height: 3.5rem;
    }

    .logo-title {
        font-size: 1.05rem;
    }

    .logo-subtitle {
        font-size: 0.7rem;
    }

    .menu-toggle {
        display: none;
    }

    .nav-menu {
        position: static;
        display: flex;
        gap: var(--spacing-xl);
        align-items: center;
        max-height: none;
        opacity: 1;
        box-shadow: none;
        background: transparent;
        border: none;
    }

    .nav-menu a {
        padding: 0;
        font-size: 0.9rem;
        opacity: 0.8;
        border: none;
        position: relative;
    }

    .nav-menu a::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--ku-crimson);
        transition: width var(--transition-base);
    }

    .nav-menu a:hover {
        opacity: 1;
        color: var(--ku-crimson);
    }

    .nav-menu a:hover::after,
    .nav-menu a.active::after {
        width: 100%;
    }

    .nav-menu a.active {
        opacity: 1;
        color: var(--ku-crimson);
        background: transparent;
    }
}

/* ============================================
   레이아웃
   ============================================ */

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-4xl) 0;
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--spacing-lg);
    }

    .section {
        padding: var(--spacing-5xl) 0;
    }
}

/* ============================================
   타이포그래피
   ============================================ */

.hero-text {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: var(--spacing-lg);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--ku-crimson) 60%, var(--text-primary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
}

@media (min-width: 768px) {
    .hero-text {
        font-size: 4rem;
    }
}

@media (min-width: 1024px) {
    .hero-text {
        font-size: 4.5rem;
    }
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    animation: slideInUp 0.8s ease-out forwards;
    opacity: 0;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 2.25rem;
    }
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: var(--spacing-xl);
    animation: slideInUp 0.8s ease-out 0.1s forwards;
    opacity: 0;
}

@media (min-width: 768px) {
    .section-subtitle {
        font-size: 1.2rem;
    }
}

/* ============================================
   Bento Grid (반응형)
   ============================================ */

.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

@media (min-width: 640px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

@media (min-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xl);
    }
}

.bento-item {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    transition: all var(--transition-slow);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    min-height: 200px;
    opacity: 0;
    transform: translateY(30px);
    animation: slideInUp 0.8s ease-out forwards;
}

@media (min-width: 768px) {
    .bento-item {
        padding: var(--spacing-xl);
        min-height: 240px;
    }
}

.bento-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(150, 26, 50, 0.3), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.bento-item:hover::before {
    opacity: 1;
}

.bento-item:nth-child(1) { animation-delay: 0.1s; }
.bento-item:nth-child(2) { animation-delay: 0.2s; }
.bento-item:nth-child(3) { animation-delay: 0.3s; }
.bento-item:nth-child(4) { animation-delay: 0.4s; }
.bento-item:nth-child(5) { animation-delay: 0.5s; }
.bento-item:nth-child(6) { animation-delay: 0.6s; }

.bento-item:active {
    transform: scale(0.98);
}

@media (hover: hover) {
    .bento-item:hover {
        transform: translateY(-8px);
        box-shadow: var(--shadow-lg);
        border-color: var(--ku-crimson);
    }
}

/* Bento 특수 레이아웃 */
.bento-tall {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #2d2d30 100%);
    color: white;
}

@media (min-width: 640px) {
    .bento-tall {
        grid-row: span 2;
    }
}

.bento-large {
    grid-column: span 1;
}

@media (min-width: 640px) {
    .bento-large {
        grid-column: span 2;
    }
}

/* ============================================
   배지 (Badge)
   ============================================ */

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: var(--transition-base);
}

@media (min-width: 768px) {
    .badge {
        font-size: 0.75rem;
        padding: 7px 16px;
    }
}

.badge-primary {
    background: var(--ku-crimson);
    color: white;
}

.badge-success {
    background: var(--ku-crimson-lighter);
    color: var(--ku-crimson);
}

.badge-info {
    background: #fef2f2;
    color: var(--ku-crimson);
}

.badge-warning {
    background: var(--ku-crimson-lighter);
    color: var(--ku-crimson);
}

.badge-secondary {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

/* ============================================
   버튼
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--text-primary);
    color: white;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active {
    transform: scale(0.97);
}

@media (hover: hover) {
    .btn:hover::before {
        width: 300px;
        height: 300px;
    }

    .btn:hover {
        background: #000;
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }
}

.btn-primary {
    background: var(--ku-crimson);
}

@media (hover: hover) {
    .btn-primary:hover {
        background: var(--ku-crimson-dark);
    }
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

@media (hover: hover) {
    .btn-secondary:hover {
        background: #e5e5ea;
    }
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--ku-crimson);
    color: var(--ku-crimson);
}

@media (hover: hover) {
    .btn-outline:hover {
        background: var(--ku-crimson);
        color: white;
    }
}

.btn-small {
    padding: 10px 20px;
    font-size: 0.85rem;
    min-height: 40px;
}

/* ============================================
   카드
   ============================================ */

.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-light);
    transition: all var(--transition-slow);
    display: block;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(150, 26, 50, 0.05);
}

@media (min-width: 768px) {
    .card {
        padding: var(--spacing-xl);
    }
}

.card:active {
    transform: scale(0.98);
}

@media (hover: hover) {
    .card:hover {
        transform: translateY(-6px);
        box-shadow: var(--shadow-md);
        border-color: var(--ku-crimson);
    }
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

@media (min-width: 640px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

@media (min-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: var(--spacing-xl);
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-sm);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .card-title {
        font-size: 1.25rem;
    }
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 6px 0 0 0;
}

.card-content {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.card-footer {
    margin-top: auto;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-light);
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================================
   폼 요소
   ============================================ */

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 1rem;
    background: var(--bg-secondary);
    transition: all var(--transition-base);
    font-family: inherit;
    min-height: 48px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--ku-crimson);
    background: white;
    box-shadow: 0 0 0 3px rgba(150, 26, 50, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ============================================
   테이블
   ============================================ */

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    text-align: left;
    padding: var(--spacing-md);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
}

.table tr:last-child td {
    border-bottom: none;
}

/* ============================================
   Flash 메시지
   ============================================ */

.flash {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-weight: 600;
    animation: slideInDown 0.5s ease-out;
    border-left: 4px solid;
    font-size: 0.95rem;
}

.flash-error {
    background: #fef2f2;
    color: #dc2626;
    border-color: #dc2626;
}

.flash-success {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #16a34a;
}

/* ============================================
   푸터
   ============================================ */

footer {
    background: var(--bg-secondary);
    padding: var(--spacing-4xl) 0;
    margin-top: var(--spacing-5xl);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-light);
}

footer h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
    font-weight: 700;
}

@media (min-width: 768px) {
    footer h3 {
        font-size: 1.1rem;
    }
}

footer p {
    margin: 4px 0;
}

footer a {
    transition: var(--transition-base);
    -webkit-tap-highlight-color: rgba(150, 26, 50, 0.1);
}

footer a:active,
footer a:hover {
    color: var(--apple-blue);
}

/* ============================================
   조직도 (모바일 우선)
   ============================================ */

.org-tree {
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding: var(--spacing-xl) 0;
}

.org-tree ul {
    padding-top: var(--spacing-lg);
    display: block;
    width: 100%;
}

.org-tree li {
    display: block;
    padding: var(--spacing-sm) 0;
    width: 100%;
}

.org-node {
    background: white;
    border: 1px solid var(--border-light);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-xs);
    -webkit-tap-highlight-color: rgba(150, 26, 50, 0.05);
}

.org-node:active {
    transform: scale(0.98);
}

@media (hover: hover) {
    .org-node:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
        border-color: var(--ku-crimson);
    }
}

.org-node img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-secondary);
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .org-node img {
        width: 60px;
        height: 60px;
    }
}

.org-role {
    font-size: 0.8rem;
    color: var(--ku-crimson);
    font-weight: 600;
    margin-bottom: 2px;
}

.org-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.org-info-wrap {
    display: flex;
    flex-direction: column;
}

/* 데스크톱 조직도 트리 구조 */
@media (min-width: 1024px) {
    .org-tree ul {
        padding-top: 20px;
        position: relative;
        display: flex;
        justify-content: center;
    }

    .org-tree li {
        float: left;
        text-align: center;
        list-style-type: none;
        position: relative;
        padding: 20px 10px 0 10px;
    }

    /* 커넥터 라인 */
    .org-tree li::before,
    .org-tree li::after {
        content: '';
        position: absolute;
        top: 0;
        right: 50%;
        border-top: 2px solid var(--border-color);
        width: 50%;
        height: 20px;
    }

    .org-tree li::after {
        right: auto;
        left: 50%;
        border-left: 2px solid var(--border-color);
    }

    .org-tree li:only-child::after,
    .org-tree li:only-child::before {
        display: none;
    }

    .org-tree li:only-child {
        padding-top: 0;
    }

    .org-tree li:first-child::before,
    .org-tree li:last-child::after {
        border: 0 none;
    }

    .org-tree li:last-child::before {
        border-right: 2px solid var(--border-color);
        border-radius: 0 5px 0 0;
    }

    .org-tree li:first-child::after {
        border-radius: 5px 0 0 0;
    }

    .org-tree ul ul::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        border-left: 2px solid var(--border-color);
        width: 0;
        height: 20px;
    }

    .org-node {
        flex-direction: column;
        text-align: center;
        min-width: 140px;
        width: auto;
    }

    .org-node img {
        margin-bottom: var(--spacing-sm);
    }
}

/* ============================================
   유틸리티
   ============================================ */

.scroll-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--transition-slow);
}

.scroll-fade.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   반응형 헬퍼
   ============================================ */

.show-mobile {
    display: none !important;
}

@media (max-width: 767px) {
    .show-mobile {
        display: inline !important;
    }
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ============================================
   KU 커스텀 스타일
   ============================================ */

/* 버튼 스타일 */
.btn-ku {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ku-crimson);
    color: white;
    padding: 12px 28px;
    border-radius: 980px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition-apple);
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-ku:hover {
    transform: scale(1.02);
    background: var(--ku-crimson-dark);
    box-shadow: 0 8px 20px rgba(150, 26, 50, 0.2);
}

.btn-ku:active {
    transform: scale(0.98);
}

/* 카드 UI */
.apple-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-apple);
    border: 1px solid var(--border-light);
    transition: var(--transition-apple);
}

.apple-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

/* 조직도 전용 탭 버튼 */
.tab-container {
    display: inline-flex;
    background: var(--bg-secondary);
    padding: 5px;
    border-radius: 980px;
    gap: 4px;
}

.tab-btn {
    padding: 8px 24px;
    border-radius: 980px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-apple);
    background: transparent;
    color: var(--text-secondary);
}

.tab-btn.active {
    background: var(--ku-crimson);
    color: white;
}

/* ============================================
   우측 고정 위젯 (알약형)
   ============================================ */

.side-widget {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: var(--z-fixed);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-full);
    padding: 8px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow var(--transition-base);
}

.side-widget:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.widget-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 60px;
    height: 60px;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
    padding: 4px;
    -webkit-tap-highlight-color: transparent;
}

.widget-btn:hover {
    background: rgba(150, 26, 50, 0.08);
    color: var(--ku-crimson);
    transform: scale(1.08);
}

.widget-btn:active {
    transform: scale(0.96);
}

.widget-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.widget-icon-img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
}

.widget-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: -0.2px;
    line-height: 1;
    white-space: nowrap;
}

.widget-divider {
    width: 32px;
    height: 1px;
    background: var(--border-light);
    margin: 2px 0;
    flex-shrink: 0;
}

/* ============================================
   위젯 모달
   ============================================ */

.widget-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    padding: 24px;
}

.widget-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.widget-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 440px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.97);
    transition: transform var(--transition-slow), opacity var(--transition-slow),
                max-width 0.3s ease, max-height 0.3s ease, border-radius 0.3s ease;
    opacity: 0;
    overflow: hidden;
}

/* 식단표 전용 모달 — 기본 크기를 크게 */
.widget-modal--menu {
    max-width: 820px;
    max-height: 88vh;
}

/* 전체화면 상태 */
.widget-modal--menu.is-fullscreen {
    max-width: 100vw;
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.widget-modal-overlay.active .widget-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* 전체화면일 때 overlay padding 제거 */
.widget-modal-overlay:has(.is-fullscreen) {
    padding: 0;
}

.widget-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-primary);
}

.widget-modal-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* 헤더 우측 액션 버튼 묶음 */
.widget-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-modal-close,
.widget-modal-fullscreen {
    background: rgba(0, 0, 0, 0.06);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}

.widget-modal-close {
    font-size: 1.25rem;
    line-height: 1;
}

.widget-modal-fullscreen svg {
    width: 15px;
    height: 15px;
}

.widget-modal-close:hover,
.widget-modal-fullscreen:hover {
    background: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}

.widget-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 24px;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.widget-modal-body::-webkit-scrollbar { width: 5px; }
.widget-modal-body::-webkit-scrollbar-track { background: transparent; }
.widget-modal-body::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

/* ---- 버스 시간 표시 ---- */
.bus-time-display {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
    margin-bottom: 14px;
}

.bus-sections-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bus-section-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
}

.bus-section-card h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ku-crimson);
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.bus-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin: 6px 0;
    font-size: 0.82rem;
    gap: 8px;
}

.bus-item.bus-imminent {
    background: rgba(150, 26, 50, 0.06);
    animation: busItemBlink 1s ease-in-out infinite;
}

@keyframes busItemBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

.bus-item.bus-friday {
    opacity: 0.55;
}

.bus-item.bus-past {
    opacity: 0.4;
}

/* 버스 전체/다음 토글 버튼 */
.bus-view-toggle {
    padding: 5px 14px;
    background: rgba(150, 26, 50, 0.08);
    color: var(--ku-crimson);
    border: 1px solid rgba(150, 26, 50, 0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 4px;
}

.bus-view-toggle:hover,
.bus-view-toggle.is-all {
    background: var(--ku-crimson);
    color: white;
    border-color: var(--ku-crimson);
}

.bus-departure {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 42px;
}

.bus-countdown {
    font-size: 0.78rem;
    color: var(--ku-crimson);
    font-weight: 600;
    background: rgba(150, 26, 50, 0.08);
    padding: 2px 7px;
    border-radius: 20px;
}

.bus-note {
    font-size: 0.73rem;
    color: var(--text-tertiary);
    margin-left: auto;
    text-align: right;
}

.bus-no-service {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.82rem;
    padding: 10px 0;
}

/* ---- 식단표 ---- */
.menu-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.menu-week-info {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ku-crimson);
    padding: 8px 14px;
    background: rgba(150, 26, 50, 0.05);
    border-radius: var(--radius-full);
    flex: 1;
    box-sizing: border-box;
}

/* 전체/오늘 토글 — 모바일에서만 표시 */
.menu-view-toggle {
    display: none;
    flex-shrink: 0;
    padding: 7px 14px;
    border: 1.5px solid var(--ku-crimson);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--ku-crimson);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}

.menu-view-toggle.is-all {
    background: var(--ku-crimson);
    color: white;
}

.menu-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-full);
}

.menu-tab {
    flex: 1;
    padding: 8px 0;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.menu-tab.active {
    background: var(--ku-crimson);
    color: white;
}

.menu-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.menu-scroll-wrapper::-webkit-scrollbar { height: 5px; }
.menu-scroll-wrapper::-webkit-scrollbar-track { background: var(--bg-secondary); }
.menu-scroll-wrapper::-webkit-scrollbar-thumb { background: var(--ku-crimson); border-radius: 3px; opacity: 0.6; }

.widget-menu-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.widget-menu-table th,
.widget-menu-table td {
    border: 1px solid var(--border-light);
    padding: 10px 12px;
    text-align: center;
    vertical-align: top;
    min-width: 90px;
    word-break: keep-all;
    line-height: 1.5;
}

.widget-menu-table thead th {
    background: var(--ku-crimson);
    color: white;
    font-weight: 700;
    font-size: 0.88rem;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px;
}

.widget-menu-table tbody th {
    background: #fdf0f2;
    font-weight: 700;
    color: var(--ku-crimson);
    font-size: 0.8rem;
    text-align: center;
    min-width: 90px;
    position: sticky;
    left: 0;
    z-index: 1;
    border-right: 2px solid rgba(150, 26, 50, 0.15);
}

.widget-menu-table tbody tr:hover td {
    background: var(--bg-secondary);
}

.widget-menu-item {
    display: block;
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.5;
    padding: 1px 0;
}

.menu-notice {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 14px;
    text-align: center;
}

/* ---- 로딩 / 에러 ---- */
.widget-loading {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 40px 0;
}

.widget-error {
    text-align: center;
    color: var(--apple-red);
    font-size: 0.85rem;
    padding: 20px 16px;
    background: rgba(255, 59, 48, 0.06);
    border-radius: var(--radius-md);
}

/* ============================================
   모바일 위젯 조정
   ============================================ */

@media (max-width: 768px) {
    .side-widget {
        right: 10px;
    }

    .widget-btn {
        width: 50px;
        height: 50px;
    }

    .widget-btn svg {
        width: 20px;
        height: 20px;
    }

    .widget-icon-img {
        width: 22px;
        height: 22px;
    }

    .widget-label {
        font-size: 8px;
    }

    /* 버스 모달 — 하단 시트 스타일 */
    .widget-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .widget-modal {
        max-height: 80vh;
        max-height: 80svh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        max-width: 100%;
    }

    /* 식단표 — 전체화면으로 강제 (모바일에서 기본) */
    .widget-modal--menu {
        max-width: 100%;
        max-height: 92vh;
        max-height: 92svh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    /* 식단표 — 모바일: 오늘 컬럼만 표시 (기본값) */
    .widget-menu-table:not(.show-all) {
        min-width: unset;
        width: 100%;
    }

    .widget-menu-table:not(.show-all) thead th:not(:first-child):not(.is-today),
    .widget-menu-table:not(.show-all) tbody td:not(.is-today) {
        display: none;
    }

    .widget-menu-table:not(.show-all) thead th.is-today,
    .widget-menu-table:not(.show-all) tbody td.is-today {
        min-width: unset;
        width: auto;
    }

    /* 전체 보기 모드 */
    .widget-menu-table.show-all {
        font-size: 0.78rem;
        min-width: 480px;
    }

    /* 토글 버튼 표시 */
    .menu-view-toggle {
        display: block;
    }

    .widget-modal--menu.is-fullscreen {
        max-height: 100vh;
        border-radius: 0;
    }

    .widget-menu-table {
        font-size: 0.78rem;
    }

    .widget-menu-table th,
    .widget-menu-table td {
        padding: 8px 8px;
        min-width: 72px;
    }

    .widget-menu-table thead th {
        padding: 10px 8px;
        font-size: 0.82rem;
    }

    .widget-menu-table tbody th {
        min-width: 76px;
        font-size: 0.73rem;
    }

    .widget-menu-item {
        font-size: 0.76rem;
    }

    /* 버스 모달 — 3단 컬럼 → 1단 */
    .bus-sections-grid {
        gap: 10px;
    }

    /* 전체화면 버튼 숨김 (모바일에서 이미 꽉 참) */
    .widget-modal-fullscreen {
        display: none;
    }
}

/* ============================================
   위젯 접기 탭 (모바일 전용)
   ============================================ */

.widget-collapse-tab {
    display: none; /* 데스크톱에서 숨김 */
}

@media (max-width: 768px) {
    /* 위젯 슬라이드 트랜지션 */
    .side-widget {
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                    box-shadow 0.25s ease;
        overflow: visible;
    }

    /* 접기 탭 — 위젯 왼쪽에 붙는 핸들 */
    .widget-collapse-tab {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        left: -22px;
        top: 50%;
        transform: translateY(-50%);
        width: 22px;
        height: 42px;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, 0.6);
        border-radius: 10px 0 0 10px;
        cursor: pointer;
        box-shadow: -3px 0 12px rgba(0, 0, 0, 0.1);
        color: var(--text-secondary);
        -webkit-tap-highlight-color: transparent;
        padding: 0;
        transition: background 0.2s ease;
    }

    .widget-collapse-tab:active {
        background: rgba(245, 245, 247, 0.95);
    }

    .widget-collapse-tab svg {
        width: 13px;
        height: 13px;
        flex-shrink: 0;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* 접혀진 상태 — 위젯을 오른쪽으로 슬라이드 */
    .side-widget.widget-collapsed {
        transform: translateY(-50%) translateX(calc(100% + 10px));
    }

    /* 접혀진 상태에서 아이콘 좌우 반전 */
    .side-widget.widget-collapsed .widget-collapse-tab svg {
        transform: rotate(180deg);
    }
}

/* 아주 좁은 화면 (360px 이하) */
@media (max-width: 380px) {
    .side-widget {
        right: 6px;
    }

    .widget-btn {
        width: 44px;
        height: 44px;
    }

    .widget-btn svg {
        width: 18px;
        height: 18px;
    }

    .widget-icon-img {
        width: 19px;
        height: 19px;
    }

    .widget-label {
        display: none;
    }

    /* 380px에서 접힌 상태 — right: 6px 보정 */
    .side-widget.widget-collapsed {
        transform: translateY(-50%) translateX(calc(100% + 6px));
    }

    .widget-collapse-tab {
        left: -20px;
        width: 20px;
    }
}

/* ============================================
   챗봇 문의 위젯
   ============================================ */

/* 사이드 위젯 문의 버튼 활성 상태 */
.widget-btn--inquiry.is-active {
    background: rgba(150, 26, 50, 0.1);
    color: var(--ku-crimson);
}


/* 채팅 패널 — 데스크탑: 사이드 위젯 왼쪽에 고정 */
.chat-panel {
    position: fixed;
    bottom: 28px;
    right: 108px; /* 사이드 위젯(right:20px + 너비~68px) + 여백 20px */
    left: auto;
    width: 340px;
    max-width: calc(100vw - 160px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0,0,0,0.08);
    z-index: 998;
    overflow: hidden;
    transform: scale(0.9) translateY(12px);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
}

.chat-panel.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.chat-panel-header {
    background: var(--ku-crimson, #961A32);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-panel-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.chat-panel-close:hover {
    opacity: 1;
}

.chat-panel-body {
    padding: 24px 20px;
    max-height: 420px;
    overflow-y: auto;
}

/* 환영 화면 */
.chat-welcome {
    text-align: center;
    padding-bottom: 20px;
}

.chat-welcome-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--ku-crimson, #961A32), #c0273f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
}

.chat-start-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--ku-crimson, #961A32);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    margin-top: 4px;
    font-family: inherit;
}

.chat-start-btn:hover {
    opacity: 0.88;
}

.chat-start-btn:active {
    transform: scale(0.98);
}

/* 폼 */
.chat-form-group {
    margin-bottom: 14px;
}

.chat-form-label {
    display: block;
    font-size: 0.83rem;
    font-weight: 700;
    color: #444;
    margin-bottom: 6px;
}

.chat-form-input,
.chat-form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    background: #fafafa;
    color: #1a1a1a;
}

.chat-form-input:focus,
.chat-form-textarea:focus {
    outline: none;
    border-color: var(--ku-crimson, #961A32);
    box-shadow: 0 0 0 3px rgba(150, 26, 50, 0.1);
    background: white;
}

.chat-form-textarea {
    resize: vertical;
    min-height: 100px;
}

.chat-form-error {
    padding: 10px 12px;
    background: #fee2e2;
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.chat-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: var(--ku-crimson, #961A32);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
    font-family: inherit;
    margin-bottom: 8px;
}

.chat-submit-btn:hover:not(:disabled) {
    opacity: 0.88;
}

.chat-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-back-btn {
    display: block;
    width: 100%;
    padding: 9px;
    background: none;
    border: none;
    color: #888;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s;
}

.chat-back-btn:hover {
    color: #444;
}

/* 스피너 */
.chat-spinner {
    width: 16px;
    height: 16px;
    animation: chatSpin 0.8s linear infinite;
}

@keyframes chatSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 모바일: 패널을 사이드 위젯 아래에 위치 */
@media (max-width: 768px) {
    .chat-panel {
        bottom: 20px;
        right: 10px;
        left: auto;
        width: calc(100vw - 80px);
        max-width: 320px;
        transform-origin: bottom right;
    }
}
