/* Console — dark terminal panel that takes its tint from the active theme */
.term {
    --term-bg: color-mix(in srgb, var(--primary-deep) 55%, #070a10);
    --term-bar: color-mix(in srgb, var(--primary-deep) 40%, #0c1018);
    --term-line: rgba(255, 255, 255, 0.08);
    --term-text: #d9deea;
    --term-dim: #7f8aa3;
    --term-blue: #8fb4ff;
    --term-green: #6fdba0;
    --term-red: #ff8f8f;

    display: flex;
    flex-direction: column;
    height: clamp(420px, calc(100vh - 320px), 720px);
    background: var(--term-bg);
    border: 1px solid var(--term-line);
    border-radius: 12px;
    box-shadow: var(--shadow-2);
    overflow: hidden;
    color: var(--term-text);
    font-family: var(--font-mono);
    transition: box-shadow var(--dur-fast) var(--ease);
}
.term:focus-within {
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent),
        var(--shadow-2);
}

/* Title bar */
.term-head {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 16px;
    background: var(--term-bar);
    border-bottom: 1px solid var(--term-line);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--term-dim);
    flex-shrink: 0;
}
.term-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}
.term-dot:nth-child(1) {
    background: #ff5f57;
}
.term-dot:nth-child(2) {
    background: #febc2e;
}
.term-dot:nth-child(3) {
    background: #28c840;
}
.term-title {
    margin-left: 10px;
}
.term-access {
    margin-left: auto;
    padding: 3px 11px;
    border: 1px solid var(--term-line);
    border-radius: 20px;
    font-size: 10px;
    letter-spacing: 0.06em;
    color: var(--term-dim);
    background: rgba(255, 255, 255, 0.03);
}
.term-access.is-full {
    color: var(--term-green);
    border-color: rgba(111, 219, 160, 0.35);
    background: rgba(111, 219, 160, 0.08);
}

/* Output */
.term-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 20px;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.term-body::selection,
.term-body *::selection {
    background: color-mix(in srgb, var(--accent) 60%, #000);
    color: #fff;
}
.term-line {
    color: var(--term-text);
}
.term-line.is-ok {
    color: var(--term-green);
}
.term-line.is-err {
    color: var(--term-red);
}
.term-line.is-dim {
    color: var(--term-dim);
}
.term-line.is-head {
    margin-top: 10px;
    padding-bottom: 3px;
    color: var(--term-blue);
    font-weight: 600;
    letter-spacing: 0.02em;
}
.term-line.is-head:first-child {
    margin-top: 0;
}
.term-prompt {
    color: var(--term-green);
    margin-right: 8px;
    user-select: none;
}
.term-cmd {
    color: #fff;
}

/* Input */
.term-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px 15px;
    background: var(--term-bar);
    border-top: 1px solid var(--term-line);
    flex-shrink: 0;
    font-size: 13px;
}
.term-input-row .term-prompt {
    margin-right: 0;
    white-space: nowrap;
    font-size: 13px;
}
.term-input-row input {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    outline: none;
    padding: 0;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 13px;
    caret-color: var(--term-blue);
}
.term-input-row input:focus-visible {
    outline: none;
}
.term-input-row input:disabled {
    opacity: 0.5;
}

/* Quick commands (sit under the terminal) */
.term-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}
.term-chips::before {
    content: "Quick run";
    margin-right: 4px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.term-chip {
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    color: var(--ink-soft);
    font-family: var(--font-mono);
    font-size: 11.5px;
    cursor: pointer;
}
.term-chip:hover {
    background: var(--btn-bg);
    border-color: var(--btn-bg);
    color: #fff;
}

@media (max-width: 880px) {
    .term {
        height: clamp(360px, calc(100vh - 260px), 640px);
        border-radius: 10px;
    }
    .term-title {
        display: none;
    }
    .term-input-row .term-prompt {
        display: none;
    }
    .term-body {
        font-size: 12px;
        padding: 14px;
    }
}