/* PromptAffordances — the "Add elements / Highlight a place" control row under a prompt
   textarea. Colour-coded to match what each pill produces: purple = [asset] tags,
   teal = @{place} highlights. See prompt-affordances.js. */

/* The row is the last thing in the prompt body, and every layout draws a rule right under it
   to start the toolbar. Without the bottom margin the pills sit on that line and read as part
   of the toolbar rather than as the end of the prompt. */
.pa-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    width: 100%;
}

.pa-hidden {
    display: none !important;
}

.pa-bar-label {
    font-size: 0.75rem;
    color: var(--gray-400, #9ca3af);
    margin-right: 0.125rem;
}

.pa-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    background: transparent;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pa-pill i {
    font-size: 0.875rem;
}

/* Holds the token shape ("[…]", "@{…}"), so it has to be monospaced — braces and brackets
   are exactly the glyphs a proportional UI font renders ambiguously at 10px. */
.pa-pill kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.06);
    opacity: 0.8;
}

.pa-pill:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

/* [asset] tags — purple, matching .ati-* */
.pa-pill-assets {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.07);
    border-color: rgba(124, 58, 237, 0.16);
}

.pa-pill-assets:hover {
    background: rgba(124, 58, 237, 0.13);
    border-color: rgba(124, 58, 237, 0.3);
}

/* @{place} highlights — teal, matching .gpi-chip-fill */
.pa-pill-places {
    color: #0f766e;
    background: rgba(13, 148, 136, 0.08);
    border-color: rgba(13, 148, 136, 0.18);
}

.pa-pill-places:hover {
    background: rgba(13, 148, 136, 0.15);
    border-color: rgba(13, 148, 136, 0.32);
}

/* The landing/Video prompt card pads its own children; the row lives inside .ati-container
   so it needs the same inset as the asset tag strip. */
.prompt-card .pa-bar {
    padding: 0 12px;
}

/* The Projects floating prompt already reserves 0.5rem under the input section, so the row
   takes less of its own here — both layouts land on the same gap above the rule. */
.prompt-input-section .pa-bar {
    margin-bottom: 0.25rem;
}

@media (max-width: 640px) {
    /* The label is the first thing to go — the pills read fine on their own, and tap targets
       matter more than the preamble on a phone (where "[" and "@" are hardest to type). */
    .pa-bar-label,
    .pa-pill kbd {
        display: none;
    }

    .pa-pill {
        padding: 0.3rem 0.6rem;
    }
}

/* ── engine doc 06 §11 Part A — the templates / suggestions list (on <body>, placed by prompt-affordances.js `help`) ─────── */
.pa-help {
    position: absolute;
    z-index: 10050;
    display: flex;
    gap: 8px;
    max-height: 420px;
    font-family: Inter, system-ui, sans-serif;
}
.pa-help[hidden] { display: none; }
.pa-help-list {
    flex: 1 1 auto;
    min-width: 0;
    max-height: 420px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #e7e7ea;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 28px -12px rgba(22,22,26,.18), 0 2px 6px rgba(22,22,26,.05);
}
.pa-hl-head { margin: 6px 8px 4px; font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: #686973; }
.pa-hl-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.pa-hl-item.on { background: rgb(var(--color-action-soft, 239 246 255)); }
.pa-hl-thumb { flex: none; width: 52px; height: 36px; overflow: hidden; border-radius: 6px; background: #f2f2f4; display: inline-flex; align-items: center; justify-content: center; color: #9a9ba3; }
.pa-hl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pa-hl-ic { flex: none; width: 28px; height: 28px; border-radius: 8px; background: #f2f2f4; display: inline-flex; align-items: center; justify-content: center; color: #55565e; font-size: 15px; }
.pa-hl-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.pa-hl-title { font-size: 13.5px; font-weight: 550; color: #16161a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-hl-title b { font-weight: 750; }
.pa-hl-sub { font-size: 12px; color: #686973; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-hl-badge { flex: none; padding: 2px 6px; border-radius: 6px; background: #f2f2f4; font-size: 11px; font-weight: 600; color: #55565e; }

/* T3 — the side card: the bigger preview, the FULL prompt (matched words bold), how often it was used */
.pa-help-card { display: none; flex: none; width: 280px; max-height: 420px; overflow-y: auto; padding: 10px; border: 1px solid #e7e7ea; border-radius: 12px; background: #fff; box-shadow: 0 10px 28px -12px rgba(22,22,26,.18); }
.pa-help.has-card .pa-help-card { display: block; }
.pa-hc-media { overflow: hidden; border-radius: 8px; background: #f2f2f4; aspect-ratio: 16 / 9; }
.pa-hc-media[hidden] { display: none; }
.pa-hc-media img, .pa-hc-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pa-hc-title { margin: 8px 0 4px; font-size: 13.5px; font-weight: 650; color: #16161a; }
.pa-hc-prompt { margin: 0 0 6px; font-size: 12.5px; line-height: 1.45; color: #55565e; white-space: pre-wrap; }
.pa-hc-prompt b { color: #16161a; }
.pa-hc-meta { margin: 0; font-size: 11.5px; color: #686973; }
.pa-hc-meta kbd { padding: 0 4px; border: 1px solid #d8d8de; border-radius: 4px; font: 600 10.5px ui-monospace, Consolas, monospace; }

/* a narrow screen: the card would crowd the list — the list's own rows carry title + description */
@media (max-width: 760px) {
    .pa-help.has-card .pa-help-card { display: none; }
}

/* F3 / F4 — the "make it stronger" chips under the box */
.pa-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.pa-chips[hidden] { display: none; }
.pa-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 4px 10px; border: 1px dashed #d8d8de; border-radius: 999px; background: #fff; color: #55565e; font: 550 12px/1.3 Inter, system-ui, sans-serif; cursor: pointer; }
.pa-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-chip:hover { border-style: solid; color: #16161a; }
.pa-chip:focus-visible { outline: 2px solid rgb(var(--color-action, 37 99 235)); outline-offset: 2px; }
.pa-chip.story { border: 1px solid rgb(var(--color-action-line, 191 219 254)); background: rgb(var(--color-action-soft, 239 246 255)); color: rgb(var(--color-action-press, 30 64 175)); }
