/* ═══════════════════════════════════════════════════════════
   한동노무법인 가상 사무실
   Game-Style Virtual Office + Chat
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DungGeunMo&display=swap');

:root {
    /* Theme */
    --bg-deep: #0c0c1a;
    --bg-office: #1a1a2e;
    --bg-floor: #2a2a45;
    --bg-desk: #3d2b1f;
    --bg-desk-top: #5c4033;
    --bg-panel: #111122;
    --bg-input: #1e1e35;
    --bg-msg-input: #252540;

    --text-primary: #eaeaf5;
    --text-secondary: #9595b5;
    --text-muted: #5a5a7a;

    --accent-boss: #6C5CE7;
    --accent-boss-soft: rgba(108, 92, 231, 0.15);
    --accent-cheoljung: #FF6B35;
    --accent-cheoljung-soft: rgba(255, 107, 53, 0.15);
    --accent-sansu: #00D4AA;
    --accent-sansu-soft: rgba(0, 212, 170, 0.15);

    --border: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(108, 92, 231, 0.3);

    --wall-color: #252545;
    --floor-color: #1e1e3a;
    --floor-tile: #232340;

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', 'Inter', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

/* ── App Layout ─────────────────────────────────────────── */

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

/* ── Office Viewport (Top ~55%) ─────────────────────────── */

.office-viewport {
    flex: 0 0 55%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.office-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(17, 17, 34, 0.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.office-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.office-logo {
    font-size: 22px;
    filter: drop-shadow(0 2px 6px rgba(108, 92, 231, 0.5));
}

.office-name {
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, #e8e8f5, #a0a0c0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.office-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent-boss);
    background: var(--accent-boss-soft);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(108, 92, 231, 0.2);
}

.office-clock {
    font-family: 'Inter', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-input);
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* ── Office Scene ───────────────────────────────────────── */

.office-scene {
    flex: 1;
    position: relative;
    background: radial-gradient(ellipse at 50% 30%, #252550 0%, #161636 40%, #0e0e24 100%);
    overflow: hidden;
    perspective: 600px;
}

/* Floor pattern */
.office-floor {
    position: absolute;
    bottom: 0;
    left: -20%;
    right: -20%;
    height: 58%;
    background:
        repeating-linear-gradient(90deg,
            rgba(108, 92, 231, 0.03) 0px, rgba(108, 92, 231, 0.03) 1px,
            transparent 1px, transparent 80px),
        repeating-linear-gradient(0deg,
            rgba(108, 92, 231, 0.03) 0px, rgba(108, 92, 231, 0.03) 1px,
            transparent 1px, transparent 80px),
        linear-gradient(180deg, #1a1a3a 0%, #141430 100%);
    transform: rotateX(55deg);
    transform-origin: center top;
}

.office-floor::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 20%, rgba(108, 92, 231, 0.08) 0%, transparent 60%);
}

/* ── Window ─────────────────────────────────────────────── */

.office-window {
    position: absolute;
    top: 4%;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 90px;
    z-index: 1;
}

.window-frame {
    width: 100%;
    height: 100%;
    border: 4px solid #4a4a6a;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(100, 150, 255, 0.1), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.window-sky {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #1a1a4a 0%, #2a2a6a 50%, #3a3a8a 100%);
    position: relative;
}

.cloud {
    position: absolute;
    width: 40px;
    height: 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    animation: cloudDrift 20s linear infinite;
}

.cloud::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 10px;
    width: 20px;
    height: 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.cloud-1 {
    top: 20px;
    left: -40px;
    animation-duration: 25s;
}

.cloud-2 {
    top: 45px;
    left: -80px;
    animation-duration: 35s;
    animation-delay: -10s;
}

@keyframes cloudDrift {
    from {
        transform: translateX(-40px);
    }

    to {
        transform: translateX(220px);
    }
}

/* ── Office Decorations ─────────────────────────────────── */

.office-plant {
    position: absolute;
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    z-index: 2;
}

.plant-1 {
    bottom: 25%;
    left: 5%;
}

.plant-2 {
    bottom: 25%;
    right: 5%;
}

.office-item {
    position: absolute;
    font-size: 24px;
    z-index: 2;
}

.water-cooler {
    bottom: 35%;
    right: 12%;
}

.office-whiteboard {
    position: absolute;
    top: 8%;
    right: 15%;
    width: 100px;
    height: 60px;
    background: #e8e8e8;
    border: 3px solid #888;
    border-radius: 3px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whiteboard-text {
    font-size: 8px;
    color: #333;
    text-align: center;
    line-height: 1.4;
    font-weight: 600;
}

/* 인재상 액자 */
.office-frame {
    position: absolute;
    top: 5%;
    left: 12%;
    z-index: 1;
    padding: 5px;
    background: linear-gradient(135deg, #8B7355, #6B5335, #8B7355);
    border-radius: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.frame-inner {
    background: linear-gradient(180deg, #FFF8E7, #F5E6C8);
    border: 1px solid rgba(139, 115, 85, 0.3);
    border-radius: 2px;
    padding: 6px 10px;
    text-align: center;
    min-width: 80px;
}

.frame-title {
    font-size: 8px;
    font-weight: 800;
    color: #4a3520;
    margin-bottom: 3px;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(139, 115, 85, 0.2);
    padding-bottom: 3px;
}

.frame-content {
    font-size: 9px;
    font-weight: 700;
    color: #6B4226;
    line-height: 1.5;
    letter-spacing: 1px;
}

/* ── Desks ──────────────────────────────────────────────── */

.desk-area {
    position: absolute;
    z-index: 3;
}

.desk {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.desk-surface {
    width: 80px;
    height: 28px;
    background: linear-gradient(135deg, #5c4033, #3d2b1f);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: perspective(200px) rotateX(8deg);
}

.desk-monitor {
    position: absolute;
    top: -16px;
    font-size: 18px;
    filter: drop-shadow(0 0 6px rgba(100, 200, 255, 0.3));
}

.desk-name-plate {
    font-size: 8px;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Desk positions */
.desk-boss {
    bottom: 22%;
    left: 50%;
    transform: translateX(-50%);
}

.desk-cheoljung {
    bottom: 35%;
    left: 15%;
}

.desk-sansu {
    bottom: 35%;
    right: 15%;
}

/* ── Meeting Area ───────────────────────────────────────── */

.meeting-area {
    position: absolute;
    bottom: 45%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.meeting-table {
    position: relative;
}

.table-surface {
    width: 120px;
    height: 40px;
    background: linear-gradient(135deg, #4a3828 0%, #3a2818 50%, #2a1808 100%);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    transform: perspective(300px) rotateX(15deg);
}

/* Meeting chairs */
.meeting-table::before,
.meeting-table::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #3a3a5a, #2a2a4a);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.meeting-table::before {
    left: -14px;
}

.meeting-table::after {
    right: -14px;
}

.meeting-label {
    font-size: 8px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 1px;
    opacity: 0.6;
}

/* ── Characters ─────────────────────────────────────────── */

.character {
    position: absolute;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.character:hover {
    transform: scale(1.08);
}

.character:hover .char-name {
    opacity: 1;
    color: var(--text-primary);
}

.char-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.char-head {
    font-size: 30px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
    line-height: 1;
}

.char-torso {
    font-size: 14px;
    margin-top: -4px;
    line-height: 1;
}

.char-name {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    transition: all 0.2s;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.char-shadow {
    width: 30px;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    margin-top: -2px;
    transition: all 0.8s ease;
}

/* Character at desk positions */
#char-boss {
    bottom: 24%;
    left: 50%;
    transform: translateX(-50%);
}

#char-cheoljung {
    bottom: 37%;
    left: 16%;
}

#char-sansu {
    bottom: 37%;
    right: 16%;
}

/* Walking animation */
.character.walking .char-head {
    animation: walk-bounce 0.3s ease-in-out infinite alternate;
}

.character.walking .char-shadow {
    animation: shadow-pulse 0.3s ease-in-out infinite alternate;
}

@keyframes walk-bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-4px);
    }
}

@keyframes shadow-pulse {
    from {
        transform: scaleX(1);
        opacity: 0.3;
    }

    to {
        transform: scaleX(0.7);
        opacity: 0.15;
    }
}

/* Idle breathing animation */
.character[data-state="idle"] .char-head {
    animation: idle-breathe 3s ease-in-out infinite;
}

@keyframes idle-breathe {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

/* Working animation */
.character[data-state="working"] .char-head {
    animation: working 0.6s ease-in-out infinite;
}

@keyframes working {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-1px) rotate(-2deg);
    }

    75% {
        transform: translateY(-1px) rotate(2deg);
    }
}

/* Meeting position glow */
.character[data-state="meeting"] {
    filter: drop-shadow(0 0 12px rgba(108, 92, 231, 0.3));
}

/* ── Speech Bubbles ─────────────────────────────────────── */

.char-speech-bubble {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 120px;
    max-width: 220px;
    padding: 8px 12px;
    background: rgba(20, 20, 40, 0.95);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 8px;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    text-align: center;
    z-index: 20;
    white-space: pre-line;
    word-break: keep-all;
}

.char-speech-bubble.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

.char-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: rgba(20, 20, 40, 0.95);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: translateX(-50%) rotate(45deg);
}

/* Per-character bubble colors */
#char-boss .char-speech-bubble {
    border-color: rgba(108, 92, 231, 0.3);
    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.15);
}

#char-cheoljung .char-speech-bubble {
    border-color: rgba(255, 107, 53, 0.3);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.15);
}

#char-sansu .char-speech-bubble {
    border-color: rgba(0, 212, 170, 0.3);
    box-shadow: 0 8px 20px rgba(0, 212, 170, 0.15);
}

/* ── Status Toast ───────────────────────────────────────── */

.status-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 24px;
    background: rgba(10, 10, 26, 0.9);
    border: 1px solid var(--accent-boss);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-boss);
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(108, 92, 231, 0.2);
}

.status-toast.visible {
    opacity: 1;
}

/* ── Chat Panel (Bottom ~45%) ───────────────────────────── */

.chat-panel {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border-top: 2px solid var(--border);
    position: relative;
    z-index: 10;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(17, 17, 34, 0.8);
}

.chat-tabs {
    display: flex;
    gap: 4px;
}

.chat-tab {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-tab:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.chat-tab.active {
    background: var(--accent-boss-soft);
    border-color: rgba(108, 92, 231, 0.2);
    color: var(--text-primary);
}

.chat-tab[data-target="cheoljung"].active {
    background: var(--accent-cheoljung-soft);
    border-color: rgba(255, 107, 53, 0.2);
}

.chat-tab[data-target="sansu"].active {
    background: var(--accent-sansu-soft);
    border-color: rgba(0, 212, 170, 0.2);
}

.chat-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.relay-toggle {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.relay-toggle:hover {
    border-color: rgba(108, 92, 231, 0.4);
    color: var(--text-secondary);
}

.relay-toggle.active {
    background: rgba(108, 92, 231, 0.15);
    border-color: var(--accent-boss);
    color: var(--accent-boss);
    box-shadow: 0 0 8px rgba(108, 92, 231, 0.2);
}

.relay-rounds {
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.relay-rounds option {
    background: var(--bg-panel);
    color: var(--text-primary);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.conn-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #FFD600;
    animation: blink 1s ease-in-out infinite;
}

.conn-dot.connected {
    background: #00E676;
    animation: none;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
}

.conn-dot.error {
    background: #FF5252;
    animation: none;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* ── Messages ───────────────────────────────────────────── */

.messages-container {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.messages-container::-webkit-scrollbar {
    width: 4px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

.welcome-message {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
}

.welcome-message strong {
    color: var(--text-primary);
}

.welcome-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Message Bubbles ────────────────────────────────────── */

.message {
    display: flex;
    gap: 8px;
    max-width: 80%;
    animation: msgIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-bot {
    align-self: flex-start;
}

.msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.msg-avatar-user {
    background: linear-gradient(135deg, #6C5CE7, #8b7bff);
}

.msg-avatar-cheoljung {
    background: linear-gradient(135deg, #FF6B35, #ff8c5a);
}

.msg-avatar-sansu {
    background: linear-gradient(135deg, #00D4AA, #33e5c2);
}

.msg-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.msg-name {
    font-size: 10px;
    font-weight: 600;
    padding: 0 2px;
}

.msg-name-user {
    color: var(--accent-boss);
    text-align: right;
}

.msg-name-cheoljung {
    color: var(--accent-cheoljung);
}

.msg-name-sansu {
    color: var(--accent-sansu);
}

.msg-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message-user .msg-bubble {
    background: linear-gradient(135deg, #6C5CE7, #5a4bd1);
    color: white;
    border-bottom-right-radius: 3px;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.2);
}

.message-cheoljung .msg-bubble {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.12), rgba(255, 107, 53, 0.05));
    border: 1px solid rgba(255, 107, 53, 0.12);
    border-bottom-left-radius: 3px;
}

.message-sansu .msg-bubble {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.12), rgba(0, 212, 170, 0.05));
    border: 1px solid rgba(0, 212, 170, 0.12);
    border-bottom-left-radius: 3px;
}

.msg-time {
    font-size: 9px;
    color: var(--text-muted);
    padding: 0 2px;
}

.message-user .msg-time {
    text-align: right;
}

/* Typing indicator */
.typing-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    animation: msgIn 0.3s ease;
}

.typing-dots {
    display: flex;
    gap: 3px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    border-bottom-left-radius: 3px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typeDot 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typeDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.typing-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* Error message */
.error-msg {
    padding: 6px 12px;
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.15);
    border-radius: 6px;
    color: #FF5252;
    font-size: 12px;
    text-align: center;
}

/* System message */
.system-msg {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px;
}

/* ── Input Area ─────────────────────────────────────────── */

.input-area {
    padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    background: rgba(17, 17, 34, 0.95);
    flex-shrink: 0;
    z-index: 20;
}

.input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: var(--bg-msg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px 6px 6px 14px;
    transition: all var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--accent-boss);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

#message-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    max-height: 80px;
    padding: 5px 0;
}

#message-input::placeholder {
    color: var(--text-muted);
}

.btn-send {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6C5CE7, #5a4bd1);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
    box-shadow: 0 3px 10px rgba(108, 92, 231, 0.3);
}

.btn-send:hover {
    transform: scale(1.08);
}

.btn-send:active {
    transform: scale(0.92);
}

.btn-send:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-height: 600px) {
    .office-viewport {
        flex: 0 0 45%;
    }

    .chat-panel {
        flex: 0 0 55%;
    }
}

/* Mobile: use fixed height for office, chat fills remaining space */
@media (max-width: 768px) {
    .office-viewport {
        flex: 0 0 auto;
        height: 240px;
        min-height: 240px;
        max-height: 240px;
    }

    .chat-panel {
        flex: 1 1 auto;
        min-height: 0;
    }

    .chat-header {
        padding: 6px 10px;
    }

    .chat-tab {
        padding: 5px 10px;
        font-size: 11px;
    }

    .messages-container {
        padding: 8px 12px;
    }

    .input-area {
        padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .office-title-bar {
        padding: 6px 12px;
    }

    .office-name {
        font-size: 13px;
    }

    .office-badge {
        font-size: 8px;
        padding: 2px 6px;
    }

    .office-clock {
        font-size: 12px;
        padding: 3px 8px;
    }

    /* Move office elements down so they don't cover frame/whiteboard */
    .meeting-area {
        bottom: 38%;
    }

    .desk-boss {
        bottom: 12%;
    }

    .desk-cheoljung {
        bottom: 25%;
    }

    .desk-sansu {
        bottom: 25%;
    }

    #char-boss {
        bottom: 14%;
    }

    #char-cheoljung {
        bottom: 27%;
    }

    #char-sansu {
        bottom: 27%;
    }

    .office-plant {
        bottom: 15% !important;
        font-size: 22px;
    }

    .office-item.water-cooler {
        bottom: 25%;
    }

    .office-whiteboard {
        top: 3%;
        right: 10%;
        width: 85px;
        height: 50px;
    }

    .whiteboard-text {
        font-size: 7px;
    }

    .office-frame {
        top: 2%;
        left: 8%;
    }

    .frame-title {
        font-size: 7px;
    }

    .frame-content {
        font-size: 8px;
    }

    .char-head {
        font-size: 24px;
    }

    .char-name {
        font-size: 8px;
    }

    .table-surface {
        width: 100px;
        height: 32px;
    }
}

/* ── File Attach Button ────────────────────────────────────── */

.btn-attach {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
}

.btn-attach:hover {
    color: var(--accent-boss);
    border-color: var(--accent-boss);
    background: var(--accent-boss-soft);
    transform: scale(1.08);
}

.btn-attach:active {
    transform: scale(0.92);
}

.btn-attach.has-files {
    color: var(--accent-boss);
    border-color: var(--accent-boss);
    background: var(--accent-boss-soft);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.2);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(108, 92, 231, 0);
    }
}

/* ── File Preview Area ─────────────────────────────────────── */

.file-preview-area {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px 4px;
}

.file-preview-area:not(:empty) {
    display: flex;
}

.file-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(108, 92, 231, 0.08);
    border: 1px solid rgba(108, 92, 231, 0.15);
    border-radius: 20px;
    font-size: 11px;
    color: var(--text-primary);
    animation: chipIn 0.2s ease-out;
    max-width: 200px;
}

@keyframes chipIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.file-chip-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.file-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.file-chip-size {
    font-size: 9px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.file-chip-remove {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 82, 82, 0.15);
    border: none;
    color: #FF5252;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    transition: all 0.15s ease;
    line-height: 1;
}

.file-chip-remove:hover {
    background: rgba(255, 82, 82, 0.3);
    transform: scale(1.1);
}

.file-chip-img {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

/* ── Drag & Drop Overlay ───────────────────────────────────── */

.drop-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(108, 92, 231, 0.12);
    backdrop-filter: blur(8px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    border: 3px dashed var(--accent-boss);
    border-radius: 12px;
    pointer-events: none;
}

.drop-overlay.visible {
    display: flex;
}

.drop-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.drop-icon {
    font-size: 40px;
    animation: drop-bounce 0.6s ease-in-out infinite alternate;
}

@keyframes drop-bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-8px);
    }
}

.drop-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-boss);
}

.drop-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Message File Tags ─────────────────────────────────────── */

.msg-files {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.msg-file-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: 10px;
    color: var(--text-secondary);
    cursor: default;
}

.msg-file-tag-icon {
    font-size: 12px;
}

.msg-file-tag img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer;
}

.msg-file-tag img:hover {
    opacity: 0.85;
    transform: scale(1.05);
    transition: all 0.15s;
}

/* ── Lock Screen ───────────────────────────────────────── */

.lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 30%, #1a1a40 0%, #0c0c1a 100%);
    animation: lockBgPulse 8s ease-in-out infinite alternate;
}

@keyframes lockBgPulse {
    from {
        background: radial-gradient(ellipse at 50% 30%, #1a1a40 0%, #0c0c1a 100%);
    }

    to {
        background: radial-gradient(ellipse at 50% 40%, #201a50 0%, #0c0c1a 100%);
    }
}

.lock-screen.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.lock-card {
    background: rgba(20, 20, 45, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(108, 92, 231, 0.25);
    border-radius: 20px;
    padding: 40px 36px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(108, 92, 231, 0.1);
    max-width: 360px;
    width: 90%;
    animation: lockCardAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes lockCardAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.lock-icon {
    font-size: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px rgba(108, 92, 231, 0.4));
}

.lock-title {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #e8e8f5, #a0a0d0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.lock-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.lock-question {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-boss);
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(108, 92, 231, 0.3);
}

.lock-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(30, 30, 55, 0.9);
    border: 2px solid rgba(108, 92, 231, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.lock-input:focus {
    border-color: var(--accent-boss);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.2);
}

.lock-error {
    font-size: 12px;
    color: #ff4757;
    min-height: 20px;
    margin-top: 8px;
    font-weight: 600;
}

.lock-btn {
    width: 100%;
    padding: 14px;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--accent-boss), #5a4bd4);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.lock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.lock-btn:active {
    transform: translateY(0);
}

.lock-input.shake {
    animation: shake 0.4s ease-in-out;
    border-color: #ff4757;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    50% {
        transform: translateX(8px);
    }

    75% {
        transform: translateX(-4px);
    }
}