/* ==========================================================================
   UR5e Workbench — app-specific styles
   ========================================================================== */

/* -- Layout modes --------------------------------------------------------- */

#main[data-app="ur5e"][data-view="split-50"] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

#main[data-app="ur5e"][data-view="split-75"] {
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
}

/* -- Right panel ---------------------------------------------------------- */

#right-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    height: 100%;
}

#right-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #a1a1aa;
    border-bottom: 1px solid #27272a;
    flex-shrink: 0;
}

#view-buttons {
    display: flex;
    gap: 4px;
}

.view-btn {
    padding: 3px 9px;
    border: 1px solid #27272a;
    background: transparent;
    color: #52525b;
    cursor: pointer;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.15s;
    letter-spacing: -0.01em;
}

.view-btn:hover {
    background: #18181b;
    color: #a1a1aa;
}

.view-btn.active {
    background: #27272a;
    color: #fafafa;
    border-color: #3f3f46;
}

#interactive-container {
    flex: none;
    max-height: 30%;
    overflow-y: auto;
}

#chat-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top: 1px solid #27272a;
}

/* -- Chat panel ----------------------------------------------------------- */

.chat-header {
    padding: 8px 12px;
    font-weight: 600;
    font-size: 13px;
    color: #a1a1aa;
    border-bottom: 1px solid #27272a;
    flex-shrink: 0;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-input-row {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid #27272a;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid #3f3f46;
    border-radius: 4px;
    background: #18181b;
    color: #fafafa;
    font-size: 13px;
}

.chat-input:focus {
    outline: none;
    border-color: #3b82f6;
}

/* -- Terminal output ------------------------------------------------------ */

.terminal-output {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace !important;
    font-size: 12px !important;
    background: #0c0c0c !important;
    padding: 8px !important;
    gap: 0 !important;
    overflow-x: hidden;
}

.terminal-line {
    white-space: pre;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    color: #d4d4d8;
    min-height: 1.5em;
}

.terminal-disconnected {
    padding: 16px;
    color: #71717a;
    font-style: italic;
    text-align: center;
}

/* -- Grid panel ----------------------------------------------------------- */

.planner-section {
    padding: 8px 12px;
    border-bottom: 1px solid #27272a;
}

.planner-grid-section {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.planner-hint {
    font-size: 11px;
    color: #52525b;
    padding: 4px 12px;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.planner-grid-table {
    display: grid;
    gap: 2px;
}

.grid-cell {
    padding: 6px 2px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-cell--empty {
    background: #18181b;
    border: 1px solid #27272a;
}

.grid-cell--occupied {
    color: #fff;
}

/* -- Responsive ----------------------------------------------------------- */

@media (max-width: 960px) {
    #main[data-app="ur5e"][data-view="split-50"],
    #main[data-app="ur5e"][data-view="split-75"] {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) minmax(220px, 45vh);
    }
}
