/* Back-to-Ideas link — floats in the bottom-right corner of the terminal */
.shell-back {
    position: absolute;
    bottom: 10px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
    color: #6c7086;
    background: rgba(49, 50, 68, 0.7);
    backdrop-filter: blur(4px);
    text-decoration: none;
    border: 1px solid #313244;
    border-radius: 999px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    pointer-events: auto;
}

.shell-back:hover {
    background: #313244;
    color: #cdd6f4;
    border-color: #45475a;
}

/* Main layout — resizable split between terminal and right-hand panels */
.shell-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

.terminal-panel {
    flex: 2;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.side-panels {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
}

/* Policy editor gets the bulk of right-hand space; filesystem gets a fixed chunk */
.side-panels .policy-panel {
    flex: 2;
    min-height: 0;
    border-bottom: 1px solid #313244;
}

.side-panels .fs-panel {
    flex: 1;
    min-height: 0;
}

/* Vertical drag handle between terminal and side panels */
.shell-drag-handle {
    width: 6px;
    background: #313244;
    cursor: col-resize;
    flex-shrink: 0;
    transition: background 0.15s;
}

.shell-drag-handle:hover,
.shell-drag-handle.dragging {
    background: #89b4fa;
}

/* Terminal body */
.terminal {
    flex: 1;
    background: #11111b;
    padding: 12px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    cursor: text;
    min-height: 0;
}

#terminal-output {
    white-space: pre-wrap;
    word-break: break-all;
}

.input-line {
    display: flex;
    align-items: center;
}

.prompt {
    color: #a6e3a1;
    white-space: nowrap;
    margin-right: 4px;
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #cdd6f4;
    font-family: inherit;
    font-size: inherit;
    caret-color: #89b4fa;
}

/* Terminal output classes */
.term-cmd { color: #cdd6f4; }
.term-output { color: #bac2de; }
.term-error { color: #f38ba8; }
.term-info { color: #94e2d5; }
.term-prompt { color: #a6e3a1; }
.term-rhai { color: #6c7086; font-style: italic; }

/* Visually distinct "policy denied" errors to teach what's happening */
.term-denied {
    color: #f38ba8;
    background: rgba(243, 139, 168, 0.06);
    border-left: 2px solid #f38ba8;
    padding: 1px 8px;
    display: inline-block;
    border-radius: 0 3px 3px 0;
}

.term-denied::before {
    content: "policy denied: ";
    color: #f38ba8;
    font-weight: 600;
}

/* Group each command + its translation + its output so the boundary is clear */
.term-group {
    padding: 4px 0;
    border-bottom: 1px dashed #1e1e2e;
}

.term-group:last-child {
    border-bottom: none;
}

/* Secondary button style (Clear) */
.panel-btn-secondary {
    background: #313244 !important;
    color: #a6adc8 !important;
    font-weight: 500 !important;
    border: 1px solid #45475a !important;
}

.panel-btn-secondary:hover {
    background: #45475a !important;
    color: #cdd6f4 !important;
}

/* Welcome banner inside the terminal — styled so the intro feels native */
.term-banner {
    color: #a6adc8;
    margin-bottom: 8px;
}

.term-banner-title {
    color: #89b4fa;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.term-banner-line {
    display: block;
    line-height: 1.6;
}

.term-banner-cmd {
    color: #a6e3a1;
}

.term-banner-rule {
    color: #313244;
    display: block;
    margin: 6px 0;
}
