.pair-controls,
.vgc-chat-window > .pair-modes {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
}

.pair-modes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    min-width: 0;
}

.pair-modes button {
    min-width: 0;
    min-height: 32px;
    padding: 5px 2px;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.pair-modes button[aria-pressed="true"] {
    color: #b0f1d9;
    background: #18392f;
    border-color: #346755;
}

.pair-modes button[data-pair-mode="debug"][aria-pressed="true"] {
    color: #ffcdaf;
    background: #3c2b27;
    border-color: #705047;
}

.pair-modes button[data-pair-mode="review"][aria-pressed="true"],
.pair-modes button[data-pair-mode="explain"][aria-pressed="true"] {
    color: #c2deff;
    background: #203446;
    border-color: #436a88;
}

.pair-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
}

.pair-actions button,
.pair-text-action,
.pair-stop,
.pair-code-bar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 30px;
    padding: 4px 6px;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: #d3dce6;
    background: var(--panel);
    font: inherit;
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
}

.pair-actions button[data-pair-undo] {
    flex: 0 0 30px;
    width: 30px;
    margin-left: auto;
}

.pair-actions img,
.pair-code-bar img {
    filter: brightness(0) invert(0.8);
}

.pair-controls button:hover:not(:disabled),
.pair-code-bar button:hover,
.pair-text-action:hover,
.pair-stop:hover {
    border-color: #7693a8;
    color: #fff;
}

.pair-controls button:focus-visible,
.pair-modes button:focus-visible,
.pair-brief summary:focus-visible,
.pair-code-bar button:focus-visible,
.pair-text-action:focus-visible,
.pair-stop:focus-visible,
.pair-changes summary:focus-visible,
.pair-checks summary:focus-visible {
    outline: 2px solid #83c3ff;
    outline-offset: 2px;
}

.pair-controls button:disabled,
.pair-modes button:disabled {
    opacity: 0.5;
    cursor: default;
}

.project-partner-card {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
}

.project-partner-card > img {
    width: 42px;
    height: 42px;
}

.project-partner-card h2 {
    font-size: 15px;
    line-height: 1.3;
}

.project-partner-card .eyebrow {
    margin-bottom: 3px;
    font-size: 10px;
}

.project-partner-card p:last-child {
    margin-bottom: 0;
    font-size: 11px;
}

.project-chat-tools {
    padding: 8px 12px;
}

.project-chat-tools .button {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 12px;
}

.project-chat-context {
    flex: 0 0 auto;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px 12px;
}

.pair-brief {
    min-width: 0;
    border-top: 1px solid var(--line);
    padding-top: 6px;
}

.pair-brief summary {
    color: #b8c5d2;
    font-size: 11px;
    line-height: 1.6;
    cursor: pointer;
}

.pair-brief summary small {
    float: right;
    color: #87dcb5;
    font-size: 10px;
}

.pair-brief textarea {
    display: block;
    width: 100%;
    min-height: 70px;
    max-height: 110px;
    margin-top: 6px;
    padding: 8px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--ink);
    background: var(--bg);
    font: inherit;
    font-size: 12px;
}

.project-chat-message,
.vgc-bubble {
    min-width: 0;
    overflow-wrap: anywhere;
}

.project-chat-message ul,
.vgc-bubble ul {
    margin: 8px 0;
    padding-left: 18px;
}

.pair-code {
    min-width: 0;
    max-width: 100%;
    margin: 10px 0;
    border-top: 1px solid #35424f;
    border-bottom: 1px solid #35424f;
    color: #d9e4ef;
    background: #0c1117;
    overflow: hidden;
}

.pair-code-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
    padding: 3px 7px;
    border-bottom: 1px solid #27323d;
    color: #a1b4c5;
    font: 11px Consolas, monospace;
}

.pair-code-bar button {
    width: 26px;
    min-height: 25px;
    padding: 3px;
}

.pair-code pre {
    max-height: 320px;
    margin: 0;
    padding: 10px;
    overflow: auto;
    tab-size: 4;
    text-align: left;
    white-space: pre;
    overflow-wrap: normal;
}

.project-chat-message .pair-code code,
.vgc-bubble .pair-code code {
    padding: 0;
    border: 0;
    border-radius: 0;
    color: inherit;
    background: transparent;
    font: 12px/1.65 "Cascadia Code", Consolas, monospace;
    white-space: pre;
}

.pair-code .tok-comment { color: #819797; }
.pair-code .tok-keyword, .pair-code .tok-tag { color: #ff9ba1; }
.pair-code .tok-string, .pair-code .tok-color { color: #a4dfb8; }
.pair-code .tok-number, .pair-code .tok-literal { color: #efc772; }
.pair-code .tok-attr, .pair-code .tok-property, .pair-code .tok-selector { color: #9ecbff; }

.pair-changes,
.pair-checks {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    font-size: 12px;
}

.pair-changes summary,
.pair-checks summary {
    color: #b4d6f6;
    cursor: pointer;
    font-weight: 600;
}

.pair-changes h4 {
    margin: 12px 0 6px;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.pair-changes section > p {
    margin: 6px 0;
    color: var(--muted);
    font-size: 11px;
}

.project-chat-input-shell,
.vgc-input-shell {
    position: relative;
}

.pair-stop {
    position: absolute;
    top: 5px;
    right: 6px;
    min-height: 24px;
    color: #ffd4bb;
    background: #302722;
}

.pair-stop i {
    width: 7px;
    height: 7px;
    background: currentColor;
}

.pair-stop[hidden] { display: none; }
.pair-text-action { margin-top: 6px; }
.project-chat-input-hint { display: none; }
.project-chat-form { padding: 10px; }
.project-chat-form textarea { min-height: 70px; }
.vgc-messages { min-height: 0; }
.vgc-composer { flex: 0 0 auto; }
.vgc-send:disabled { opacity: 0.45; cursor: default; }

.project-chat-form {
    grid-template-columns: minmax(0, 1fr) 40px;
    align-items: end;
    gap: 8px;
}
.project-chat-send {
    width: 40px;
    min-width: 40px;
    min-height: 42px;
    padding: 8px;
}
.project-chat-send span { display: none; }

@media (max-width: 920px) {
    .project-mobile-nav { top: var(--pair-header-height, 119px); }
    .project-partner-pane {
        height: calc(100svh - var(--pair-header-height, 119px) - 56px);
        min-height: 540px;
        scroll-margin-top: calc(var(--pair-header-height, 119px) + 56px);
    }
    .project-chat-log { flex: 1 1 auto; height: auto; min-height: 80px; }
}

@media (max-width: 600px) {
    .pair-modes button { min-height: 36px; }
    .pair-actions button { min-height: 34px; }
    .vgc-chat-window > .pair-modes { padding: 6px 9px; }
    .project-chat-message { max-width: 100%; }
}
