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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

#app {
    display: grid;
    grid-template-rows: 48px 1fr 32px;
    grid-template-columns: 1fr 320px;
    height: 100vh;
}

/* Header */
#header {
    grid-column: 1 / -1;
    background: #16213e;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    border-bottom: 1px solid #2a2a4a;
}

#header h1 {
    font-size: 16px;
    font-weight: 600;
    color: #e94560;
}

#plan-name {
    font-size: 13px;
    color: #888;
}

#connection-status {
    margin-left: auto;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

#connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e94560;
}

#connection-dot.connected { background: #4ecca3; }

#clients-count {
    font-size: 12px;
    color: #666;
}

/* Plan Viewer */
#viewer {
    position: relative;
    overflow: hidden;
    background: #0f0f23;
    cursor: crosshair;
}

#plan-svg-container {
    width: 100%;
    height: 100%;
}

#plan-svg-container svg {
    width: 100%;
    height: 100%;
}

#overlay-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Cursors */
.remote-cursor {
    position: absolute;
    pointer-events: none;
    z-index: 100;
    transition: left 0.05s linear, top 0.05s linear;
}

.cursor-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    margin: -6px 0 0 -6px;
}

.cursor-label {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
    margin-top: 2px;
    margin-left: -4px;
}

#bot-cursor .cursor-dot { background: #e94560; }
#bot-cursor .cursor-label { background: #e94560; color: white; }

/* Click markers */
.click-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #4ecca3;
    border-radius: 50%;
    pointer-events: none;
    animation: click-pulse 1s ease-out forwards;
}

@keyframes click-pulse {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

/* Chat Panel */
#chat-panel {
    background: #16213e;
    border-left: 1px solid #2a2a4a;
    display: flex;
    flex-direction: column;
}

#chat-header {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid #2a2a4a;
    color: #4ecca3;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-msg {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    max-width: 90%;
    word-wrap: break-word;
}

.chat-msg.user {
    background: #1a3a5c;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-msg.bot {
    background: #2a2a4a;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-msg .sender {
    font-size: 10px;
    color: #888;
    margin-bottom: 2px;
}

.chat-msg.system {
    background: none;
    color: #666;
    font-size: 11px;
    text-align: center;
    align-self: center;
}

#chat-input-area {
    padding: 12px;
    border-top: 1px solid #2a2a4a;
    display: flex;
    gap: 8px;
}

#chat-input {
    flex: 1;
    background: #0f0f23;
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    padding: 8px 12px;
    color: #e0e0e0;
    font-size: 13px;
    outline: none;
}

#chat-input:focus { border-color: #4ecca3; }

#chat-send {
    background: #4ecca3;
    color: #1a1a2e;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}

#chat-send:hover { background: #3dbb94; }

/* Status Bar */
#statusbar {
    grid-column: 1 / -1;
    background: #16213e;
    border-top: 1px solid #2a2a4a;
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 11px;
    color: #666;
    gap: 24px;
}

#coord-display { font-family: 'Courier New', monospace; color: #4ecca3; }

/* Empty state */
#empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #444;
}

#empty-state h2 { font-size: 20px; margin-bottom: 8px; }
#empty-state p { font-size: 13px; }

/* Upload zone */
#upload-zone {
    border: 2px dashed #2a2a4a;
    border-radius: 12px;
    padding: 40px;
    margin: 20px;
    cursor: pointer;
    transition: border-color 0.2s;
}

#upload-zone:hover { border-color: #4ecca3; }
#upload-zone.dragover { border-color: #e94560; background: rgba(233, 69, 96, 0.05); }

#file-input { display: none; }
