/* ==========================================================================
   Tabs + chat panel — append to css/rs_searchbox8-2024.css
   Uses the existing palette: #F48020 / #E47010 orange, #757575 borders,
   #f5f5f5 panels, 4px radii, 3rem field heights, Arial/Helvetica.
   Nothing here overrides an existing rule.
   ========================================================================== */

/* ---------- tabs ----------
   Underline rather than filled, so the orange Search button stays the
   single dominant orange element in the card. */
.rs_tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 16px;
}
.rs_tab {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: bold;
    color: #757575;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 20px 9px;
    cursor: pointer;
    margin-bottom: -1px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.rs_tab:hover { color: #333; }
.rs_tab[aria-selected="true"] {
    color: #F48020;
    border-bottom-color: #F48020;
}
.rs_tab:focus-visible { outline: 2px solid #F48020; outline-offset: -2px; }

.rs_tab_new {
    background: #F48020;
    color: #ffffff;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
}

.rs_panel[hidden] { display: none; }

/* ---------- chat thread ----------
   Fixed height so switching tabs does not jump the page. Tuned to match
   the search form's height at desktop width. */
#crs-nl-thread {
    min-height: 246px;
    max-height: 246px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 4px 2px 6px;
}

.crs-nl-msg {
    max-width: 80%;
    padding: 9px 13px;
    font-size: 13.5px;
    line-height: 1.45;
    border-radius: 4px;
}
.crs-nl-bot {
    background: #f5f5f5;
    color: #333333;
    align-self: flex-start;
    border-left: 3px solid #dddddd;
}
.crs-nl-user {
    background: #F48020;
    color: #ffffff;
    align-self: flex-end;
}

.crs-nl-thinking { display: flex; gap: 4px; padding: 13px; }
.crs-nl-thinking span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #757575;
    opacity: .4;
    animation: crs-nl-blink 1.3s infinite;
}
.crs-nl-thinking span:nth-child(2) { animation-delay: .18s; }
.crs-nl-thinking span:nth-child(3) { animation-delay: .36s; }
@keyframes crs-nl-blink {
    0%, 60%, 100% { opacity: .25; }
    30%           { opacity: .8; }
}

/* ---------- tappable examples ---------- */
.crs-nl-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-self: flex-start;
    max-width: 96%;
}
/* Same pill shape and tint as the summary-card pills, so the examples and
   the result read as one system. A border appears on hover so they still
   feel tappable. */
.crs-nl-example {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12.5px;
    font-weight: bold;
    line-height: 1.3;
    color: #6B3200;
    background: #FDE7D3;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 6px 12px;
    cursor: pointer;
    text-align: left;
}
.crs-nl-example:hover { background: #FBD5B0; border-color: #F48020; color: #5A2A00; }
.crs-nl-example:focus-visible { outline: 2px solid #F48020; outline-offset: 1px; }

/* ---------- summary card ----------
   Anchored left with an orange edge so it reads as a result to act on,
   not as more conversation. */
.crs-nl-card {
    max-width: 92%;
    background: #ffffff;
    border: 1px solid #757575;
    border-left: 3px solid #F48020;
    padding: 13px 15px;
}
/* Pills: what Ask understood, one per detail. Tinted orange so the
   orange Find rates button stays the strongest element on the card. */
.crs-nl-chips {
    list-style: none;
    margin: 0 0 11px 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.crs-nl-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    box-sizing: border-box;
    padding: 6px 11px;
    border-radius: 14px;
    background: #FDE7D3;
    color: #6B3200;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: bold;
    line-height: 1.3;
}
.crs-nl-chip-k {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #8A4A12;
    margin-right: 2px;
}
.crs-nl-ico {
    width: 13px;
    height: 13px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.crs-nl-chip--deal { background: #333333; color: #ffffff; }
.crs-nl-chip--no {
    background: #ffffff;
    color: #757575;
    border: 1px dashed #757575;
    font-weight: normal;
}

.crs-nl-note {
    font-size: 12px;
    color: #757575;
    font-style: italic;
    margin: 0 0 10px 0;
}

.crs-nl-go {
    background: #E47010;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: bold;
    padding: 9px 22px;
    margin-right: 8px;
    cursor: pointer;
}
.crs-nl-go:hover { background: #F48020; }
.crs-nl-reset {
    background: none;
    border: none;
    color: #757575;
    font-family: inherit;
    font-size: 12.5px;
    text-decoration: underline;
    cursor: pointer;
}

/* ---------- composer ---------- */
.crs-nl-composer {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dddddd;
}
#crs-nl-input {
    flex: 1;
    min-width: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #333333;
    border: 1px solid #757575;
    border-radius: 4px;
    padding: 0 12px;
    height: 3rem;
}
#crs-nl-input:focus { border: 2px solid #F48020; outline: none; }
#crs-nl-input:disabled { background: #f5f5f5; color: #969696; }

#crs-nl-mic {
    flex: none;
    width: 3rem;
    height: 3rem;
    border: 1px solid #757575;
    background: #ffffff;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1;
    color: #757575;
    cursor: pointer;
}
#crs-nl-mic.crs-nl-listening {
    background: #be0000;
    border-color: #be0000;
    color: #ffffff;
    animation: crs-nl-pulse 1.2s ease-in-out infinite;
}
@keyframes crs-nl-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(190, 0, 0, .5); }
    50%      { box-shadow: 0 0 0 7px rgba(190, 0, 0, 0); }
}

#crs-nl-submit {
    flex: none;
    background: #E47010;
    border: none;
    border-radius: 4px;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: bold;
    padding: 0 26px;
    height: 3rem;
    cursor: pointer;
}
#crs-nl-submit:hover { background: #F48020; }

/* ---------- breakpoints, matching the existing ones ---------- */
@media only screen and (max-width: 695px) {
    .rs_tab { padding: 10px 14px; font-size: 14px; }
    #crs-nl-thread { min-height: 210px; max-height: 210px; }
    .crs-nl-msg { max-width: 90%; }
    .crs-nl-card { max-width: 100%; }
    .crs-nl-chip { font-size: 12.5px; padding: 5px 10px; }
    #crs-nl-submit { padding: 0 18px; }
    #crs-nl-input, #crs-nl-mic, #crs-nl-submit { height: 48px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .crs-nl-thinking span { animation: none; opacity: .5; }
    #crs-nl-mic.crs-nl-listening { animation: none; }
}
