/* PR review chat: stoplight colours and the few things the app's compiled utility classes don't cover. */
:root {
    --pr-red: #e5484d;
    --pr-yellow: #f0b429;
    --pr-green: #30a46c;
}

.pr-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 50%;
}

.pr-dot.is-red { background: var(--pr-red); }
.pr-dot.is-yellow { background: var(--pr-yellow); }
.pr-dot.is-green { background: var(--pr-green); }

.pr-term {
    width: 88px;
}

.pr-scroll {
    scrollbar-width: none;
}

.pr-finding + .pr-finding {
    border-top: 1px solid var(--color-line-soft);
}

/* the entrance chat replies use: fade from a slight blur, rising 6px. The delay is set inline, 45ms apart. */
.pr-in {
    animation: pr-in 0.28s cubic-bezier(0.5, 0, 0.1, 1) both;
}

@keyframes pr-in {
    from {
        opacity: 0;
        filter: blur(1.5px);
        transform: translateY(6px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pr-in {
        animation: none;
    }
}

/* the finding popup: wider than the Connect dialog so a line of code fits */
.pr-dialog {
    width: min(560px, calc(100vw - 48px));
}

/* suggested change: the one place the app shows code, so the one place with a mono font */
.pr-code {
    margin: 0;
    padding: 6px 0;
    overflow-x: auto;
    border-width: 1px;
    border-style: solid;
    background: var(--color-sunken);
    color: var(--color-ink);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 20px;
}

.pr-line {
    display: block;
    width: max-content;
    min-width: 100%;
    padding-right: 12px;
    white-space: pre;
}

.pr-line.is-del { background: color-mix(in oklab, var(--pr-red) 16%, transparent); }
.pr-line.is-add { background: color-mix(in oklab, var(--pr-green) 16%, transparent); }

.pr-num {
    display: inline-block;
    width: 36px;
    padding-right: 8px;
    color: var(--color-ink-subtle);
    text-align: right;
    user-select: none;
}

.pr-sign {
    display: inline-block;
    width: 16px;
    color: var(--color-ink-subtle);
    user-select: none;
}

/* an edited comment keeps its line breaks */
.pr-pre {
    white-space: pre-line;
}

.pr-edit {
    display: block;
    min-height: 88px;
    resize: vertical;
    line-height: 20px;
}

/* shortcut hints: a footer strip that runs to the edges of the popup */
.pr-keys {
    margin: 0 -20px -20px;
    padding: 12px 20px;
}

/* ---- other chats (assets/chats.js) ---- */
.pr-dot.is-orange { background: #f76b15; }
.pr-dot.is-gray { background: var(--color-ink-subtle); }

/* a chat with a preview window: the chat keeps a fixed column, the preview takes the rest */
.chat-side {
    width: 400px;
}

.chat-doc-wrap {
    max-width: 640px;
}

/* ---- the prep notes document ---- */
.chat-doc-wrap {
    max-width: 720px;
}

/* inline code and file paths: the mono font, on a quiet chip */
.chat-code {
    padding: 1px 5px;
    border: 1px solid var(--color-line-soft);
    border-radius: 5px;
    background: var(--color-sunken);
    color: var(--color-ink);
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: nowrap;
}

.chat-path {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 20px;
}

.chat-bullet {
    width: 4px;
    height: 4px;
    margin-top: 9px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--color-ink-subtle);
}

/* table-like rows: number, assumed answer, why */
.chat-cols {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr);
}

/* label on the left, text on the right */
.chat-pair {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
}

/* check, status, note */
.chat-check {
    display: grid;
    grid-template-columns: 200px 104px minmax(0, 1fr);
}

/* spacing between the document's sections (the compiled utilities have no gap this large) */
.chat-doc {
    gap: 32px;
}

.chat-doc > header {
    padding-bottom: 24px;
}

.chat-doc > section:last-child {
    padding-top: 24px;
}

/* ---- Today's chips inside chats: same colours and hover card, sized to sit in a line of text ---- */
.fe-chips {
    --td-green-bg: #eaf5e7;
    --td-green-ink: #3a8a3e;
    --td-blue-bg: #e9f0fd;
    --td-blue-ink: #2c5fcc;
    --td-warm-bg: #fdf1e2;
    --td-warm-ink: #6b4416;
    --td-neutral-bg: #f4f4f6;
}

:root[data-theme=dark] .fe-chips {
    --td-green-bg: #4ab45a26;
    --td-green-ink: #8fd694;
    --td-blue-bg: #4699fe26;
    --td-blue-ink: #89bdfc;
    --td-warm-bg: #f9b97d26;
    --td-warm-ink: #f9b97d;
    --td-neutral-bg: #303338;
}

.fe-chips .today-chip {
    gap: 5px;
    height: 20px;
    padding: 0 7px 0 3px;
    font-size: 12px;
    /* centred on the line of text it sits in: middle lands a touch low for this font, so lift it 1px */
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.fe-chips .today-chip img {
    width: 14px;
    height: 14px;
}

.fe-chips .today-chip svg {
    width: 12px;
    height: 12px;
    margin-left: 2px;
}

.fe-chips [data-tip] {
    cursor: pointer;
    outline: none;
}

.fe-chips [data-tip]:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

/* the last finding in a card: its hover and focus ring follow the card's rounded bottom corners */
.pr-finding:last-child > button {
    border-bottom-right-radius: calc(var(--radius-card) - 1px);
    border-bottom-left-radius: calc(var(--radius-card) - 1px);
}

/* a person with no photo: their initial on a solid disc, the size and place of an avatar in a chip */
.chat-initial {
    display: inline-grid;
    width: 14px;
    height: 14px;
    place-items: center;
    border-radius: 50%;
    background: var(--td-blue-ink);
    color: var(--color-page);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

/* hours field on a proposed subtask */
.chat-hours {
    width: 52px;
}

/* facts on one line, wrapping when there is no room */
.chat-facts {
    column-gap: 24px;
    row-gap: 4px;
}

/* command output under a check: the code block without line numbers */
.chat-out {
    padding-left: 12px;
}

/* the one link styled as the solid button: it opens the pipeline, it does not run it */
.chat-open {
    background: var(--color-solid);
    color: var(--color-page);
    font-weight: 500;
}

.chat-open:hover {
    background: var(--color-solid-hover);
}
