/* ============================================================================
   Tree-Ripe — Sunny Customer Widget
   Matches 2-Prototypes/sunny/v14.html ("#3 Refined")
   ============================================================================ */

/* ─── Tokens (scoped to the widget; PHP pipes --tr-ai-primary inline) ────── */
/* .ss-cd-bubble--rich is the support-dashboard conversation transcript bubble.
   It renders the SAME tr-ai-* card HTML the customer saw, so it needs these
   tokens defined too — that lets the cards render EXACTLY like the live chat
   without dragging in the .tr-ai-chat panel layout. */
.tr-ai-chat,
.tr-ai-launcher,
.ss-cd-bubble--rich {
    --sunny-forest: var(--tr-ai-primary, #0F5E41);
    --sunny-forest-deep: #0A3A28;
    --sunny-black: #333333;        /* TEXT ONLY — never a fill, border, or scrim */
    --sunny-border: #E0E1E3; /* Canonical seaglass border for lines/strokes */
    --sunny-white: #FFFFFF;
    --sunny-fd: Georgia, 'Times New Roman', serif;
    --sunny-fb: 'Avenir', 'Avenir Next', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --sunny-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================================
   Floating launcher (closed state)
   ============================================================================ */
.tr-ai-launcher {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100000;
}

/* The launcher button is fixed-position outside the .tr-ai-chat panel,
   so it inherits the host theme's button defaults. Lock every property
   explicitly with !important so Kadence / WooCommerce / any other theme
   button styling cannot bleed through. */
button.tr-ai-launcher-btn,
.tr-ai-launcher .tr-ai-launcher-btn {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    border-radius: 50% !important;
    border: 0 !important;
    background: var(--tr-season-accent) !important;
    color: var(--tr-season-banner-text, #FFFFFF) !important;
    cursor: pointer !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    font-size: 20px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    transition: background 220ms var(--sunny-ease), transform 220ms var(--sunny-ease);
    font-family: var(--sunny-fb) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

button.tr-ai-launcher-btn:hover,
.tr-ai-launcher .tr-ai-launcher-btn:hover {
    background: var(--tr-season-accent-hover) !important;
    color: var(--tr-season-banner-text, #FFFFFF) !important;
    transform: translateY(-2px);
}

.tr-ai-launcher-mark,
.tr-ai-icon-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    font-size: 20px;
}

.tr-ai-launcher-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

/* ============================================================================
   Floating widget wrapper (positions the open panel above the launcher)
   ============================================================================ */
.tr-ai-widget {
    position: fixed;
    bottom: 96px;
    left: 24px;
    z-index: 100001;
}

/* ============================================================================
   Open chat panel — .tr-ai-chat = the prototype's .bot
   ============================================================================ */
.tr-ai-chat {
    width: min(380px, calc(100vw - 32px));
    height: min(520px, calc(100vh - 120px));
    background: var(--sunny-white);
    border: 1px solid var(--sunny-border);
    border-radius: 16px;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr auto auto auto;
    font-family: var(--sunny-fb);
    color: var(--sunny-black);
    -webkit-font-smoothing: antialiased;
    box-shadow: 0 18px 48px rgba(15, 94, 65, 0.18), 0 2px 6px rgba(0, 0, 0, 0.06);
    font-size: 16px;
    line-height: 1.5;
}

/* Embedded mode (used inside /sunny/test, [tr_ai_support] shortcode pages) */
.tr-ai-chat.tr-ai-embedded {
    width: 100%;
    height: var(--tr-ai-height, 520px);
    box-shadow: none;
}

/* Selection inside the widget */
.tr-ai-chat ::selection {
    background: var(--sunny-forest);
    color: var(--sunny-white);
}

/* Focus is signalled by the input's own border-color shift to forest,
   so suppress the chunky default outline that doubled up on top of it. */
.tr-ai-chat :focus,
.tr-ai-chat :focus-visible {
    outline: none;
}

/* ============================================================================
   Header (.tr-ai-header) — prototype .head
   ============================================================================ */
.tr-ai-header {
    background: var(--sunny-forest);
    color: var(--sunny-white);
    padding: 14px 18px;
    display: grid;
    grid-template-columns: 38px 1fr auto auto;
    gap: 10px;
    align-items: center;
}

.tr-ai-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tr-ai-avatar {
    width: 38px;
    height: 38px;
    background: var(--sunny-white);
    color: var(--sunny-forest);
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.tr-ai-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tr-ai-avatar-monogram {
    font-family: var(--sunny-fd);
    font-weight: 600;
    font-size: 16px;
    line-height: 1;
    color: var(--sunny-forest);
}

.tr-ai-name {
    font-family: var(--sunny-fb);
    font-weight: 600;
    font-size: 17px;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--sunny-white);
}

.tr-ai-tagline {
    font-family: var(--sunny-fb);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-top: 2px;
    font-weight: 600;
    color: var(--sunny-white);
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Lock every property with !important so Kadence / WooCommerce / any other
   theme button styling cannot bleed through and squash the circle. */
button.tr-ai-close,
.tr-ai-header button.tr-ai-close {
    background: transparent !important;
    border: 1px solid var(--sunny-white) !important;
    color: var(--sunny-white) !important;
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 12px !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    font-family: var(--sunny-fb) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-shadow: none !important;
    transition: background 220ms var(--sunny-ease), color 220ms var(--sunny-ease);
}

button.tr-ai-close:hover,
.tr-ai-header button.tr-ai-close:hover {
    background: var(--sunny-white) !important;
    color: var(--sunny-forest) !important;
}

.tr-ai-close .tr-ai-icon-close,
.tr-ai-close i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 12px;
}

/* "New chat" pill. Lock properties with !important so host theme button
   styling cannot bleed through. */
button.tr-ai-new-chat,
.tr-ai-header button.tr-ai-new-chat {
    background: transparent !important;
    border: 1px solid var(--sunny-white) !important;
    color: var(--sunny-white) !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    border-radius: 999px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    line-height: 1 !important;
    font-family: var(--sunny-fb) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    transition: background 220ms var(--sunny-ease), color 220ms var(--sunny-ease);
}

button.tr-ai-new-chat:hover,
.tr-ai-header button.tr-ai-new-chat:hover {
    background: var(--sunny-white) !important;
    color: var(--sunny-forest) !important;
}

.tr-ai-new-chat i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 12px;
}

/* ============================================================================
   Messages thread (.tr-ai-messages) — prototype .thread
   ============================================================================ */
.tr-ai-messages {
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--sunny-forest) transparent;
    background: var(--sunny-white);
}

.tr-ai-messages::-webkit-scrollbar {
    width: 4px;
}
.tr-ai-messages::-webkit-scrollbar-thumb {
    background: var(--sunny-forest-deep);
    border-radius: 2px;
}
.tr-ai-messages::-webkit-scrollbar-track {
    background: transparent;
}

/* "Picking up where you left off" note shown when a saved conversation
   restores after page navigation. Quiet, centered, self-fading. */
.tr-ai-resume-note {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 2px 0 4px;
    padding: 4px 12px;
    font-family: var(--sunny-fb);
    font-size: 12px;
    font-weight: 600;
    color: var(--sunny-forest);
    background: var(--sunny-white);
    border: 1px solid var(--sunny-border);
    border-radius: 999px;
    opacity: 1;
    transition: opacity 600ms var(--sunny-ease);
}

.tr-ai-resume-note i {
    font-size: 11px;
    line-height: 1;
}

.tr-ai-resume-note--fade {
    opacity: 0;
}

.tr-ai-message {
    display: flex;
    max-width: 86%;
}

.tr-ai-message.tr-ai-bot {
    align-self: flex-start;
}

.tr-ai-message.tr-ai-user {
    align-self: flex-end;
}

.tr-ai-message-wide {
    max-width: 100%;
    align-self: stretch;
}

.tr-ai-message-content {
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    font-family: var(--sunny-fb);
}

.tr-ai-message.tr-ai-bot .tr-ai-message-content {
    background: var(--sunny-white);
    border: 1px solid var(--sunny-border);
    border-radius: 14px 14px 14px 4px;
    color: var(--sunny-black);
}

.tr-ai-message.tr-ai-user .tr-ai-message-content {
    background: var(--sunny-forest);
    color: var(--sunny-white);
    border-radius: 14px 14px 4px 14px;
}

.tr-ai-message-content a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tr-ai-message.tr-ai-user .tr-ai-message-content a {
    color: var(--sunny-white);
}

.tr-ai-message-content strong {
    font-weight: 600;
}

/* Typing indicator (3 dots) */
.tr-ai-message-content.tr-ai-typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
}

.tr-ai-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sunny-forest);
    display: inline-block;
    animation: tr-ai-typing-dot 1.4s infinite ease-in-out;
}
.tr-ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.tr-ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes tr-ai-typing-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-3px); opacity: 1; }
}

/* ============================================================================
   Inline action buttons (lookup choice, ticket prompt, cancel choice)
   ============================================================================ */
.tr-ai-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

button.tr-ai-inline-btn,
a.tr-ai-inline-btn,
.tr-ai-inline-btn,
.tr-ai-message-content a.tr-ai-inline-btn,
.tr-ai-chat button.tr-ai-inline-btn,
.tr-ai-message.tr-ai-bot .tr-ai-message-content a.tr-ai-inline-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--sunny-forest) !important;
    color: var(--sunny-white) !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 6px 12px !important;
    margin: 0 !important;
    font-family: var(--sunny-fb) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    text-transform: none !important;
    cursor: pointer !important;
    text-decoration: none !important;
    box-shadow: none !important;
    line-height: 1 !important;
    transition: background 220ms var(--sunny-ease);
}

button.tr-ai-inline-btn:hover,
a.tr-ai-inline-btn:hover,
.tr-ai-inline-btn:hover,
.tr-ai-message-content a.tr-ai-inline-btn:hover {
    background: var(--sunny-forest-deep) !important;
    color: var(--sunny-white) !important;
    text-decoration: none !important;
}

/* ============================================================================
   Inline ticket form (rendered inside a bot bubble when showTicketPrompt
   fires). The customer fills name + email + description right in the
   chat we never redirect away to /submit-ticket/.
   ============================================================================ */
.tr-ai-ticket-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.tr-ai-ticket-form input,
.tr-ai-ticket-form textarea,
.tr-ai-chat .tr-ai-ticket-form input,
.tr-ai-chat .tr-ai-ticket-form textarea {
    width: 100% !important;
    border: 1px solid var(--sunny-border) !important;
    background: var(--sunny-white) !important;
    color: var(--sunny-black) !important;
    font-family: var(--sunny-fb) !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    padding: 10px 14px !important;
    border-radius: 14px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    outline: none !important;
    resize: vertical;
    transition: border-color 220ms var(--sunny-ease);
}

.tr-ai-ticket-form input {
    border-radius: 999px !important;
}

.tr-ai-ticket-form textarea {
    min-height: 72px !important;
}

.tr-ai-ticket-form input:focus,
.tr-ai-ticket-form textarea:focus {
    border-color: var(--sunny-forest) !important;
}

.tr-ai-ticket-form input::placeholder,
.tr-ai-ticket-form textarea::placeholder {
    color: var(--sunny-black) !important;
    opacity: 0.6 !important;
}

.tr-ai-ticket-form button.tr-ai-inline-btn {
    align-self: flex-start;
}

.tr-ai-ticket-form-status {
    font-family: var(--sunny-fb);
    font-size: 13px;
    color: var(--sunny-black);
    min-height: 0;
}

.tr-ai-ticket-form-status:empty {
    display: none;
}

/* ============================================================================
   Inventory cards (rendered inside bot bubbles for in-stock product lists)
   ============================================================================ */
.tr-ai-inventory-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tr-ai-inventory-title {
    font-family: var(--sunny-fb);
    font-size: 13px;
    font-weight: 600;
    color: var(--sunny-forest);
    letter-spacing: 0.04em;
}

.tr-ai-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.tr-ai-inventory-card,
.tr-ai-message-content a.tr-ai-inventory-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: var(--sunny-white);
    border: 1px solid var(--sunny-border);
    border-radius: 14px;
    text-decoration: none;
    color: var(--sunny-black);
    transition: border-color 220ms var(--sunny-ease), transform 220ms var(--sunny-ease);
}

.tr-ai-inventory-card:hover {
    border-color: var(--sunny-forest);
    transform: translateY(-2px);
}

.tr-ai-inventory-card,
.tr-ai-inventory-card * {
    text-decoration: none;
}

.tr-ai-inventory-thumb {
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--sunny-border);
    background: var(--sunny-white);
}

.tr-ai-inventory-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tr-ai-inventory-thumb--empty {
    background: var(--sunny-white);
}

.tr-ai-inventory-followup {
    margin-top: 10px;
    font-family: var(--sunny-fb);
    font-size: 13px;
    color: var(--sunny-black);
    line-height: 1.5;
}

.tr-ai-inventory-name {
    font-family: var(--sunny-fb);
    font-size: 13px;
    font-weight: 600;
    color: var(--sunny-black);
    line-height: 1.3;
}

.tr-ai-inventory-price {
    font-family: var(--sunny-fb);
    font-size: 13px;
    font-weight: 600;
    color: var(--sunny-forest);
    letter-spacing: 0.02em;
}

/* ============================================================================
   Resource cards (recipe / fruit info)
   ============================================================================ */
.tr-ai-resource-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tr-ai-resource-title {
    font-family: var(--sunny-fb);
    font-size: 13px;
    font-weight: 600;
    color: var(--sunny-forest);
    letter-spacing: 0.04em;
}

.tr-ai-resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}

.tr-ai-resource-card,
.tr-ai-message-content a.tr-ai-resource-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: var(--sunny-white);
    border: 1px solid var(--sunny-border);
    border-radius: 14px;
    text-decoration: none;
    color: var(--sunny-black);
    transition: border-color 220ms var(--sunny-ease), transform 220ms var(--sunny-ease);
}

.tr-ai-resource-card:hover {
    border-color: var(--sunny-forest);
    transform: translateY(-2px);
}

.tr-ai-resource-card,
.tr-ai-resource-card * {
    text-decoration: none;
}

.tr-ai-resource-thumb {
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--sunny-border);
    background: var(--sunny-white);
}

.tr-ai-resource-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tr-ai-resource-thumb--empty {
    background: var(--sunny-white);
}

.tr-ai-resource-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tr-ai-resource-type {
    font-family: var(--sunny-fb);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sunny-forest);
}

.tr-ai-resource-name {
    font-family: var(--sunny-fb);
    font-size: 13px;
    font-weight: 600;
    color: var(--sunny-black);
    line-height: 1.3;
}

.tr-ai-resource-excerpt {
    font-family: var(--sunny-fb);
    font-size: 12px;
    color: var(--sunny-black);
    line-height: 1.5;
}

.tr-ai-resource-footer {
    margin-top: 4px;
    font-family: var(--sunny-fb);
    font-size: 12px;
    font-weight: 600;
}

.tr-ai-resource-footer a {
    color: var(--sunny-forest);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================================================
   Gift card / store credit balance card (in-chat balance lookup)
   ============================================================================ */
.tr-ai-gc-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    background: var(--sunny-white);
    border: 1px solid var(--sunny-border);
    border-left: 4px solid var(--sunny-forest);
    border-radius: 14px;
}

.tr-ai-gc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tr-ai-gc-kind {
    font-family: var(--sunny-fb);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sunny-white);
    background: var(--sunny-forest);
    padding: 3px 9px;
    border-radius: 999px;
}

.tr-ai-gc-last4 {
    font-family: var(--sunny-fb);
    font-size: 13px;
    color: var(--sunny-black);
}

.tr-ai-gc-balance {
    font-family: var(--sunny-fd);
    font-size: 30px;
    font-weight: 600;
    line-height: 1.1;
    color: var(--sunny-forest);
}

.tr-ai-gc-balance-label {
    font-family: var(--sunny-fb);
    font-size: 13px;
    color: var(--sunny-black);
}

.tr-ai-gc-expires {
    font-family: var(--sunny-fb);
    font-size: 13px;
    color: var(--sunny-black);
}

.tr-ai-gc-activity {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.tr-ai-gc-activity-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: baseline;
    font-family: var(--sunny-fb);
    font-size: 13px;
    color: var(--sunny-black);
}

.tr-ai-gc-activity-label {
    overflow-wrap: anywhere;
}

.tr-ai-gc-activity-amt {
    font-weight: 600;
    color: var(--sunny-forest);
    white-space: nowrap;
}

.tr-ai-gc-activity-date {
    color: var(--sunny-black);
    white-space: nowrap;
}

/* ============================================================================
   Fruit Stop / Pop-Up schedule cards (.tr-ai-stops-grid)
   Each upcoming stop renders as its own clickable card. Fruit Stops
   (reservable) read green; Pop-Ups (walk-up) read peach so the two
   kinds are visually distinct at a glance. Peach is an approved
   Tree-Ripe customer-facing brand accent.
   ============================================================================ */
.tr-ai-stops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin: 10px 0;
}

.tr-ai-stop-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--sunny-white);
    border: 1px solid var(--sunny-border);
    border-left: 4px solid var(--sunny-forest);
    border-radius: 14px;
    color: var(--sunny-black);
}

.tr-ai-stop-card--stop {
    border-left-color: var(--sunny-forest);
}

.tr-ai-stop-card--popup {
    border-left-color: #E08A5B; /* warm peach edge for walk-up Pop-Ups */
}

.tr-ai-stop-badge {
    align-self: flex-start;
    font-family: var(--sunny-fb);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
    color: var(--sunny-white);
}

.tr-ai-stop-badge--stop {
    background: var(--sunny-forest);
}

.tr-ai-stop-badge--popup {
    background: #E08A5B;
}

.tr-ai-stop-name {
    font-family: var(--sunny-fb);
    font-size: 14px;
    font-weight: 600;
    color: var(--sunny-black);
    line-height: 1.3;
}

.tr-ai-stop-distance {
    font-family: var(--sunny-fb);
    font-size: 13px;
    font-weight: 600;
    color: var(--sunny-forest);
    line-height: 1.3;
}

.tr-ai-stop-card--popup .tr-ai-stop-distance {
    color: #C56A3B;
}

.tr-ai-stop-date {
    font-family: var(--sunny-fb);
    font-size: 13px;
    font-weight: 600;
    color: var(--sunny-forest);
    letter-spacing: 0.02em;
}

.tr-ai-stop-card--popup .tr-ai-stop-date {
    color: #C56A3B;
}

.tr-ai-stop-time {
    font-family: var(--sunny-fb);
    font-size: 13px;
    color: var(--sunny-black);
    line-height: 1.4;
}

.tr-ai-stop-note {
    font-family: var(--sunny-fb);
    font-size: 12px;
    font-style: italic;
    color: var(--sunny-black);
    opacity: 0.75;
    line-height: 1.4;
}

/* Stop name as a link to its detail page. */
.tr-ai-message-content a.tr-ai-stop-name--link {
    color: var(--sunny-black);
    text-decoration: none;
}
.tr-ai-message-content a.tr-ai-stop-name--link:hover {
    color: var(--sunny-forest);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================================================
   Per-stop reminder capture ("Remind me about this stop" on each stop card)
   ============================================================================ */
/* Secondary action on the card: outlined so the solid green "Reserve a box"
   stays the primary CTA. */
.tr-ai-message-content button.tr-ai-stop-remind-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    background: transparent;
    color: var(--sunny-forest);
    font-family: var(--sunny-fb);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--sunny-forest);
    border-radius: 999px;
    cursor: pointer;
    line-height: 1.2;
    text-align: left;
    transition: background 220ms var(--sunny-ease), color 220ms var(--sunny-ease);
}
.tr-ai-message-content button.tr-ai-stop-remind-btn:hover {
    background: var(--sunny-forest);
    color: var(--sunny-white);
}

.tr-ai-remind-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tr-ai-remind-email {
    flex: 1 1 160px;
    min-width: 0;
    padding: 9px 12px;
    font-family: var(--sunny-fb);
    font-size: 14px;
    color: var(--sunny-black);
    background: var(--sunny-white);
    border: 1px solid var(--sunny-border);
    border-radius: 10px;
}
.tr-ai-remind-email:focus {
    outline: none;
    border-color: var(--sunny-forest);
    box-shadow: 0 0 0 3px rgba(15, 94, 65, 0.15);
}

.tr-ai-message-content button.tr-ai-remind-submit {
    padding: 9px 16px;
    background: var(--sunny-forest);
    color: var(--sunny-white);
    font-family: var(--sunny-fb);
    font-size: 13px;
    font-weight: 600;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    line-height: 1.2;
    transition: background 220ms var(--sunny-ease);
}
.tr-ai-message-content button.tr-ai-remind-submit:hover {
    background: var(--sunny-forest-deep);
}
.tr-ai-message-content button.tr-ai-remind-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

.tr-ai-remind-status {
    margin-top: 6px;
    font-family: var(--sunny-fb);
    font-size: 13px;
    color: var(--sunny-black);
}

.tr-ai-remind-done {
    margin-top: 6px;
    font-family: var(--sunny-fb);
    font-size: 14px;
    font-weight: 600;
    color: var(--sunny-forest);
    line-height: 1.4;
}

/* "Reserve a box" CTA on reservable Fruit Stop cards. */
.tr-ai-message-content a.tr-ai-stop-reserve {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    margin-top: 2px;
    padding: 7px 14px;
    background: var(--sunny-forest);
    color: var(--sunny-white);
    font-family: var(--sunny-fb);
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
    transition: background 220ms var(--sunny-ease), transform 220ms var(--sunny-ease);
}
.tr-ai-message-content a.tr-ai-stop-reserve:hover {
    background: var(--sunny-forest-deep);
    transform: translateY(-1px);
    text-decoration: none;
}

/* ============================================================================
   Quick action chips (.tr-ai-quick-actions) — prototype .quick row
   ============================================================================ */
/* Quick actions ALWAYS render — never collapse them after a flow. The four
   buttons are the primary nav row and must persist across every state. */
.tr-ai-quick-actions,
.tr-ai-chat .tr-ai-quick-actions {
    padding: 16px 14px !important;
    border-top: 1px solid var(--sunny-border) !important;
    display: flex !important;
    gap: 5px !important;
    flex-wrap: nowrap !important;
    background: var(--sunny-white) !important;
    visibility: visible !important;
}

/* Lock with !important so theme button styling cannot bleed through. */
.tr-ai-quick-actions button,
.tr-ai-chat .tr-ai-quick-actions button {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    background: var(--sunny-forest) !important;
    border: 0 !important;
    color: var(--sunny-white) !important;
    border-radius: 999px !important;
    padding: 8px 6px !important;
    margin: 0 !important;
    font-family: var(--sunny-fb) !important;
    font-size: 9px !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    line-height: 1.1 !important;
    box-shadow: none !important;
    transition: background 220ms var(--sunny-ease);
    text-align: center !important;
}

.tr-ai-quick-actions button:hover,
.tr-ai-chat .tr-ai-quick-actions button:hover {
    background: var(--sunny-forest-deep) !important;
    color: var(--sunny-white) !important;
}

.tr-ai-quick-actions button span {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tr-ai-quick-actions button i {
    font-size: 10px;
}

/* ============================================================================
   Email lookup bar + ticket bar (existing optional rows)
   ============================================================================ */
.tr-ai-email-bar,
.tr-ai-ticket-bar {
    padding: 10px 14px;
    border-top: 1px solid var(--sunny-border);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--sunny-white);
}

.tr-ai-email-bar input {
    flex: 1;
    border: 1px solid var(--sunny-border);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-family: var(--sunny-fb);
    color: var(--sunny-black);
    outline: none;
    background: var(--sunny-white);
    transition: border-color 220ms var(--sunny-ease);
}

.tr-ai-email-bar input:focus {
    border-color: var(--sunny-forest);
}

.tr-ai-email-bar input::placeholder {
    color: var(--sunny-black);
    opacity: 0.6;
}

.tr-ai-email-bar button,
.tr-ai-ticket-bar button,
.tr-ai-chat .tr-ai-email-bar button,
.tr-ai-chat .tr-ai-ticket-bar button {
    background: var(--sunny-forest) !important;
    color: var(--sunny-white) !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 8px 14px !important;
    margin: 0 !important;
    font-family: var(--sunny-fb) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    text-transform: none !important;
    cursor: pointer !important;
    box-shadow: none !important;
    line-height: 1 !important;
    transition: background 220ms var(--sunny-ease);
}

.tr-ai-email-bar button:hover,
.tr-ai-ticket-bar button:hover,
.tr-ai-chat .tr-ai-email-bar button:hover,
.tr-ai-chat .tr-ai-ticket-bar button:hover {
    background: var(--sunny-forest-deep) !important;
    color: var(--sunny-white) !important;
}

.tr-ai-ticket-bar span {
    font-family: var(--sunny-fb);
    font-size: 13px;
    color: var(--sunny-black);
    flex: 1;
}

/* ============================================================================
   Input row (.tr-ai-input-area) — prototype .input
   ============================================================================ */
.tr-ai-input-area {
    padding: 10px 14px 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    background: var(--sunny-white);
}

.tr-ai-input-area textarea {
    border: 1px solid var(--sunny-border);
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    font-family: var(--sunny-fb);
    color: var(--sunny-black);
    background: var(--sunny-white);
    resize: none;
    line-height: 1.4;
    min-height: 40px;
    max-height: 100px;
    transition: border-color 220ms var(--sunny-ease);
    /* Hide the scrollbar that the browser drops in when the JS auto-resize
       hits max-height. Content still scrolls invisibly so the caret stays
       in view; just no chunky vertical bar between the pill and the send. */
    scrollbar-width: none;
}

.tr-ai-input-area textarea::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.tr-ai-input-area textarea:focus {
    border-color: var(--sunny-forest);
}

.tr-ai-input-area textarea::placeholder {
    color: var(--sunny-black);
    opacity: 0.6;
}

/* Lock every property with !important so Kadence / WooCommerce / any other
   theme button styling cannot bleed through and squash the send circle. */
.tr-ai-input-area button,
.tr-ai-chat .tr-ai-input-area button {
    background: var(--sunny-forest) !important;
    color: var(--sunny-white) !important;
    border: 0 !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 13px !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    font-family: var(--sunny-fb) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-shadow: none !important;
    transition: background 220ms var(--sunny-ease);
}

.tr-ai-input-area button:hover,
.tr-ai-chat .tr-ai-input-area button:hover {
    background: var(--sunny-forest-deep) !important;
}

.tr-ai-input-area button:disabled,
.tr-ai-chat .tr-ai-input-area button:disabled {
    background: var(--sunny-forest-deep) !important;
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

.tr-ai-input-area button i,
.tr-ai-input-area button svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 13px;
}

/* ============================================================================
   Disclaimer (always visible)
   ============================================================================ */
.tr-ai-disclaimer {
    padding: 0 14px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    font-family: var(--sunny-fb);
    font-size: 11px;
    line-height: 1.4;
    color: var(--sunny-black);
    text-align: center;
    background: var(--sunny-white);
    opacity: 0.7;
}

.tr-ai-disclaimer i {
    font-size: 11px;
    margin-top: 2px;
}
