/* ==========================================================================
   ROHN8 Auto & Smart — Global Cross-Hero Sticky Search Strip & XL Modal
   Shared across EVERY ROHN8 storefront page via layout.blade.php
   ========================================================================== */

.site-header {
    z-index: 40;
}

.icon-button.r8-bag-btn {
    position: relative;
}
.r8-bag-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding-inline: 5px;
    border-radius: 999px;
    background: var(--signal);
    color: #14240d;
    font-size: .68rem;
    font-weight: 860;
    line-height: 19px;
    text-align: center;
    box-shadow: 0 2px 8px #020805cc;
}
.r8-bag-badge[hidden] {
    display: none !important;
}

/* 1. STICKY CROSS-HERO SEARCH STRIP ATTACHED TO TOP MENU BAR */
.r8-gsearch-strip {
    position: relative;
    z-index: 38;
    border-block-start: 1px solid #233a2c88;
    background: linear-gradient(90deg, #07120df5 0%, #0b1c14f5 50%, #07120df5 100%);
    padding-block: 6px 8px;
    transition: padding-block .22s ease, background-color .22s ease;
}

.site-header.is-gsearch-compact .r8-gsearch-strip {
    padding-block: 5px 6px;
}

.r8-gsearch-strip-inner {
    display: grid;
    grid-template-columns: minmax(480px, 1.55fr) auto;
    align-items: center;
    gap: 8px 14px;
}

.site-header.is-gsearch-compact .r8-gsearch-hot-strip {
    display: none;
}
.site-header.is-gsearch-compact .r8-gsearch-strip-inner {
    grid-template-columns: minmax(0, 1fr);
}

.r8-gsearch-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 3px 5px 3px 12px;
    border-radius: 12px;
    border: 1px solid #355a44b8;
    background: linear-gradient(165deg, #0d2117f2 0%, #08150ef7 100%);
    box-shadow: 0 6px 18px #02090566, 0 0 0 1px #c7f7950e inset;
    transition: border-color .2s ease, box-shadow .2s ease, min-height .2s ease;
}
.site-header.is-gsearch-compact .r8-gsearch-bar {
    min-height: 40px;
}

.r8-gsearch-bar:hover {
    border-color: #639c79;
    box-shadow: 0 10px 28px #02090588, 0 0 22px #48d58c1c;
}

.r8-gsearch-bar:focus-within,
.r8-gsearch-bar.is-inline-direct {
    border-color: var(--signal);
    box-shadow: 0 12px 32px #020905a8, 0 0 0 2.5px #c7f79538, 0 0 28px #c7f79522;
}

.r8-gsearch-lead-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    color: var(--signal);
    opacity: .85;
}

.r8-gsearch-ai-pill {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #3b634b;
    background: #10261b;
    color: var(--signal);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    white-space: nowrap;
}

@media (max-width: 1500px) {
    .r8-gsearch-hot-pill:nth-of-type(n+3) {
        display: none;
    }
}

.r8-gsearch-bar input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: .96rem;
    font-weight: 560;
    outline: none;
    padding-inline: 4px;
}
.r8-gsearch-bar input[type="search"]::placeholder {
    color: #8eb09b;
    font-weight: 460;
}
.r8-gsearch-bar input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    display: none;
}

.r8-gsearch-inline-clear {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid #3a5d48;
    background: #12291d;
    color: #d6ecdc;
    display: inline-grid;
    place-items: center;
    padding: 0;
}
.r8-gsearch-inline-clear:hover {
    border-color: var(--signal);
    color: var(--signal);
}

.r8-gsearch-expand-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding-inline: 9px;
    border-radius: 9px;
    border: 1px solid #355642;
    background: #091810;
    color: #a4c3af;
    font-size: .72rem;
    font-weight: 700;
}
.r8-gsearch-expand-btn kbd {
    font: 700 .7rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
    color: #bfe0c9;
}
.r8-gsearch-expand-btn:hover {
    border-color: var(--signal);
    color: var(--signal);
    background: #122b1e;
}

.r8-gsearch-submit {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding-inline: 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--signal);
    color: #14240d;
    font-size: .86rem;
    font-weight: 820;
    white-space: nowrap;
    transition: background-color .18s ease, transform .18s ease;
}
.r8-gsearch-submit:hover {
    background: #e2ffbc;
}

/* Hot Pills Beside Sticky Search Bar */
.r8-gsearch-hot-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}
.r8-gsearch-hot-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .72rem;
    font-weight: 800;
    color: #96b9a3;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}
.r8-gsearch-hot-pill {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #31503e;
    background: #0b1c14;
    color: #cde3d3;
    font-size: .76rem;
    font-weight: 650;
    white-space: nowrap;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
.r8-gsearch-hot-pill:hover {
    border-color: var(--signal);
    background: #173525;
    color: var(--signal);
}
.r8-gsearch-adv-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding-inline: 8px;
    color: var(--signal);
    font-size: .76rem;
    font-weight: 780;
    white-space: nowrap;
}
.r8-gsearch-adv-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Compact Inline Direct Live Popover (after Esc -> inline continuation) */
.r8-gsearch-inline-popover {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 65;
    border-radius: 16px;
    border: 1px solid #446f56;
    background: linear-gradient(175deg, #0b1c14fc 0%, #07120dfc 100%);
    box-shadow: 0 24px 60px #010704e6, 0 0 0 1px #c7f79518 inset;
    overflow: hidden;
    text-align: left;
}
.r8-gsearch-pop-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 14px;
    border-block-end: 1px solid #263f31;
    background: #08150f;
    font-size: .74rem;
    color: #c8e0cf;
}
.r8-gsearch-pop-head > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 650;
}
.r8-gsearch-pop-expand {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #3f6a50;
    background: #122a1e;
    color: var(--signal);
    font-size: .72rem;
    font-weight: 750;
}
.r8-gsearch-pop-expand:hover {
    background: var(--signal);
    color: var(--deep);
}
.r8-gsearch-pop-body {
    max-height: min(56vh, 380px);
    overflow-y: auto;
    padding: 8px;
    display: grid;
    gap: 6px;
}

/* 2. GLOBAL CENTER XL INSTANT SEARCH MODAL (Vuexy modal-xl grammar + ROHN8 living dark-emerald) */
.r8-gmodal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: clamp(12px, 2.6vh, 28px) clamp(10px, 2vw, 24px);
    background: radial-gradient(ellipse 70% 60% at 50% 35%, #0c2419d4 0%, #030906e8 100%);
    animation: r8-gm-fade .18s ease-out;
}
.r8-gmodal-backdrop[hidden],
.r8-gsearch-inline-popover[hidden],
.r8-gmodal-live[hidden],
.r8-gmodal-grid[hidden],
.r8-gmodal-history[hidden] {
    display: none !important;
}
@supports (backdrop-filter: blur(10px)) {
    .r8-gmodal-backdrop { backdrop-filter: blur(12px); }
}
@keyframes r8-gm-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.r8-gmodal-dialog {
    position: relative;
    width: min(1120px, 100%);
    max-height: min(90svh, 860px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border-radius: 24px;
    border: 1.5px solid #457257d4;
    background: linear-gradient(175deg, #0b1c14 0%, #07120d 100%);
    box-shadow:
        0 34px 96px #000000e6,
        0 0 0 1px #c7f79522 inset,
        0 0 64px #2f8b592c;
    overflow: hidden;
    animation: r8-gm-pop .22s cubic-bezier(.22, 1, .36, 1);
}
@keyframes r8-gm-pop {
    from { opacity: 0; transform: translateY(-14px) scale(.975); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Animated Living Hero Strip Inside XL Modal */
.r8-gmodal-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 18px 24px 16px;
    border-block-end: 1px solid #2b4737;
    display: grid;
    gap: 13px;
}

.r8-gmodal-hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
}
.r8-gmodal-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 45%;
    opacity: .72;
}
.r8-gmodal-hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 62% 85% at 50% 45%, #07130de8 0%, #07130dba 58%, #07120d7a 100%),
        linear-gradient(180deg, #07110d8c 0%, transparent 25%, #07110df2 100%);
}

.r8-gmodal-fx {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}
.r8-gmodal-arches,
.r8-gmodal-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.r8-gmodal-arches { mix-blend-mode: screen; opacity: .88; }

.r8-gmodal-orb {
    position: absolute;
    pointer-events: none;
    opacity: .72;
    filter: drop-shadow(0 12px 18px #020a06c0) drop-shadow(0 0 14px #c7f79538);
    animation: r8-gm-float 6.2s ease-in-out infinite;
}
.r8-gmodal-orb--left  { left: 10px; top: 68px; width: 72px; height: auto; }
.r8-gmodal-orb--right { right: 12px; top: 66px; width: 76px; height: auto; animation-delay: -2.9s; }
@keyframes r8-gm-float {
    0%, 100% { transform: translateY(0) rotate(-1.5deg); }
    50%      { transform: translateY(-8px) rotate(1.5deg); }
}

.r8-gmodal-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.r8-gmodal-brand-badge {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: .84rem;
    font-weight: 800;
    color: var(--signal);
    letter-spacing: .02em;
}
.r8-gmodal-brand-badge small {
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid #3a6049;
    background: #0a1b12cc;
    color: #cbe3d1;
    font-size: .72rem;
    font-weight: 650;
}

.r8-gmodal-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.r8-gmodal-esc-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .74rem;
    color: #b4cebc;
}
.r8-gmodal-esc-hint kbd,
.r8-gmodal-keys kbd {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 22px;
    padding-inline: 6px;
    border-radius: 6px;
    border: 1px solid #3f664f;
    background: #091911;
    color: var(--signal);
    font: 700 .7rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.r8-gmodal-close {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid #416952;
    background: #0d2117e6;
    color: var(--text);
    display: inline-grid;
    place-items: center;
    padding: 0;
}
.r8-gmodal-close:hover {
    border-color: var(--signal);
    color: var(--signal);
    background: #163324;
}

/* Modal Command Input */
.r8-gmodal-form {
    display: grid;
    gap: 10px;
    max-width: 920px;
    width: 100%;
    margin-inline: auto;
}

.r8-gmodal-input-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 7px 8px 7px 16px;
    border-radius: 17px;
    border: 1.5px solid #4f8465;
    background: linear-gradient(165deg, #0b1d14f5 0%, #06110cf7 100%);
    box-shadow: 0 18px 42px #020805c0, 0 0 0 2px #c7f79522;
}
.r8-gmodal-input-shell:focus-within {
    border-color: var(--signal);
    box-shadow: 0 20px 48px #020805d0, 0 0 0 3px #c7f79538, 0 0 38px #c7f79528;
}

.r8-gmodal-input-shell input[type="search"] {
    width: 100%;
    min-width: 0;
    height: 50px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: clamp(1rem, 1.3vw, 1.18rem);
    font-weight: 600;
    outline: none;
}
.r8-gmodal-input-shell input[type="search"]::placeholder {
    color: #8eb09b;
    font-weight: 460;
}
.r8-gmodal-input-shell input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    display: none;
}

.r8-gmodal-clear {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #3c604b;
    background: #12291d;
    color: #d7ecdc;
    display: inline-grid;
    place-items: center;
    padding: 0;
}
.r8-gmodal-clear:hover { border-color: var(--signal); color: var(--signal); }

.r8-gmodal-submit {
    min-height: 48px;
    padding-inline: 20px;
    border-radius: 12px;
    gap: 8px;
    font-size: .92rem;
    white-space: nowrap;
}

.r8-gmodal-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.r8-gmodal-scopes {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid #31503e;
    background: #06100be0;
}
.r8-gmodal-scope {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: #bdd5c4;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
}
.r8-gmodal-scope:hover { color: var(--text); }
.r8-gmodal-scope.is-active { background: var(--signal); color: var(--deep); }
.r8-gmodal-scope--history { position: relative; }
.r8-gmodal-history-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--signal);
    box-shadow: 0 0 8px var(--signal);
    flex: none;
}
.r8-gmodal-scope.is-active .r8-gmodal-history-dot {
    background: #14240d;
    box-shadow: none;
}

.r8-gmodal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.r8-gmodal-chip {
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #375a45cc;
    background: #0a1b13d6;
    color: #d3e7d8;
    font-size: .74rem;
    font-weight: 650;
}
.r8-gmodal-chip:hover {
    border-color: var(--signal);
    background: var(--signal);
    color: var(--deep);
}

/* Modal Scrollable Body */
.r8-gmodal-body {
    overflow-y: auto;
    padding: 16px 24px 20px;
    display: grid;
    gap: 14px;
    align-content: start;
}

.r8-gmodal-status-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-block-end: 10px;
    border-block-end: 1px solid #22382b;
    font-size: .78rem;
}
.r8-gmodal-status-text {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #cbe2d1;
    font-weight: 650;
}
.r8-gmodal-fullpage-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--signal);
    font-weight: 750;
}
.r8-gmodal-fullpage-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Two-Column Discovery & Marketing Grid */
.r8-gmodal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.38fr) minmax(0, .86fr);
    gap: 20px;
    align-items: start;
}

.r8-gmodal-main-col,
.r8-gmodal-side-col {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.r8-gmodal-sec {
    display: grid;
    gap: 10px;
}
.r8-gmodal-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #9ec0aa;
}
.r8-gmodal-sec-head > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.r8-gmodal-sec-head > span:last-child {
    white-space: nowrap;
    flex: none;
}
.r8-gmodal-sec-head a,
.r8-gmodal-inline-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--signal);
    text-transform: none;
    letter-spacing: 0;
    font-size: .76rem;
    font-weight: 750;
    white-space: nowrap;
    cursor: pointer;
}
.r8-gmodal-inline-action:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.r8-gmodal-recent-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.r8-gmodal-chip-group {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid #375a45cc;
    background: #0a1b13d6;
    overflow: hidden;
    transition: border-color .16s ease, background-color .16s ease;
}
.r8-gmodal-chip-group:hover {
    border-color: var(--signal);
    background: #122b1e;
}
.r8-gmodal-chip-fill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 8px 0 11px;
    border: 0;
    background: transparent;
    color: #d7ecdc;
    font-size: .75rem;
    font-weight: 660;
    cursor: pointer;
}
.r8-gmodal-chip-fill:hover { color: var(--signal); }
.r8-gmodal-chip-rm {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 30px;
    padding: 0;
    border: 0;
    border-inline-start: 1px solid #2b4837;
    background: transparent;
    color: #8eb09b;
    cursor: pointer;
}
.r8-gmodal-chip-rm:hover {
    background: #2b1a1a;
    color: #fca5a5;
}

/* Quick-Resume 3-Card Strip in Default Modal State */
.r8-gmodal-resume-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}
.r8-gmodal-resume-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid #2d4c3a;
    background: linear-gradient(160deg, #0e2318 0%, #09160f 100%);
    transition: border-color .16s ease, transform .16s ease;
}
.r8-gmodal-resume-card:hover {
    border-color: var(--signal);
    transform: translateY(-1px);
}
.r8-gmodal-resume-card img {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    background: #06100b;
}
.r8-gmodal-resume-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.r8-gmodal-resume-copy strong {
    font-size: .76rem;
    line-height: 1.28;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.r8-gmodal-resume-copy small {
    font-size: .7rem;
    font-weight: 760;
    color: var(--signal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* STATE C: Dedicated Lịch sử Tab Panel inside XL Modal */
.r8-gmodal-history {
    display: grid;
    gap: 14px;
}
.r8-gmodal-history-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.r8-gmodal-history-filters {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}
.r8-gmodal-hfilter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #32533f;
    background: #0a1a12;
    color: #c4dccb;
    font-size: .76rem;
    font-weight: 680;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
.r8-gmodal-hfilter:hover { border-color: #629f7a; color: var(--text); }
.r8-gmodal-hfilter.is-active {
    border-color: var(--signal);
    background: #173726;
    color: var(--signal);
}
.r8-gmodal-history-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #4a3535;
    background: #1a1111;
    color: #f3b4b4;
    font-size: .74rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease;
}
.r8-gmodal-history-clear:hover {
    border-color: #f87171;
    background: #2c1616;
    color: #fee2e2;
}
.r8-gmodal-history-body {
    display: grid;
    gap: 16px;
}
.r8-gmodal-history-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.r8-gmodal-hcard {
    position: relative;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    padding: 10px 36px 10px 10px;
    border-radius: 14px;
    border: 1px solid #2b4737;
    background: linear-gradient(165deg, #0d2117 0%, #08150e 100%);
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.r8-gmodal-hcard:hover {
    border-color: var(--signal);
    transform: translateY(-1px);
    box-shadow: 0 12px 26px #02080588;
}
.r8-gmodal-hcard-link {
    display: contents;
    color: inherit;
    text-decoration: none;
}
.r8-gmodal-hcard-thumb {
    width: 76px;
    height: 68px;
    border-radius: 10px;
    overflow: hidden;
    background: #06100b;
    border: 1px solid #274132;
    display: grid;
    place-items: center;
}
.r8-gmodal-hcard-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.r8-gmodal-hcard-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}
.r8-gmodal-hcard-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.r8-gmodal-hcard-via {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid #3c654d;
    background: #112a1d;
    color: var(--signal);
    font-size: .64rem;
    font-weight: 760;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.r8-gmodal-hcard-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .66rem;
    color: #8ba895;
    white-space: nowrap;
}
.r8-gmodal-hcard-copy strong {
    font-size: .84rem;
    line-height: 1.32;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.r8-gmodal-hcard-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-block-start: 1px;
}
.r8-gmodal-hcard-price {
    font-size: .78rem;
    font-weight: 820;
    color: var(--signal);
}
.r8-gmodal-hcard-sub {
    font-size: .71rem;
    color: #9ab5a3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.r8-gmodal-hcard-sku {
    font: 700 .66rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid #345642;
    background: #091810;
    color: #bfe6cc;
}
.r8-gmodal-hcard-rm {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid #304d3c;
    background: #0a1811;
    color: #93b39f;
    display: inline-grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
.r8-gmodal-hcard-rm:hover {
    border-color: #f87171;
    background: #2b1515;
    color: #fecaca;
}
.r8-gmodal-history-empty {
    padding: 28px 18px;
    border-radius: 16px;
    border: 1px dashed #345742;
    background: #08150e;
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 10px;
    color: #b4cebc;
}
.r8-gmodal-history-empty h4 {
    margin: 0;
    font-size: .96rem;
    color: var(--text);
}
.r8-gmodal-history-empty p {
    margin: 0;
    max-width: 48ch;
    font-size: .82rem;
    line-height: 1.5;
    color: #94b19e;
}

/* 4 Bestselling Merchandising Cards */
.r8-gmodal-promo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.r8-gmodal-promo-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
    border-radius: 15px;
    border: 1px solid #2d4a39;
    background: linear-gradient(165deg, #0e2218 0%, #09160f 100%);
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.r8-gmodal-promo-card:hover {
    border-color: var(--signal);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px #0208058c;
}
.r8-gmodal-promo-thumb {
    position: relative;
    width: 96px;
    height: 92px;
    border-radius: 11px;
    overflow: hidden;
    background: #06100b;
    display: grid;
    place-items: center;
}
.r8-gmodal-promo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.r8-gmodal-promo-rank {
    position: absolute;
    left: 5px;
    top: 5px;
    padding: 1px 6px;
    border-radius: 6px;
    background: #07130de8;
    border: 1px solid #48755a;
    color: var(--signal);
    font-size: .64rem;
    font-weight: 850;
}
.r8-gmodal-promo-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.r8-gmodal-promo-badge {
    font-size: .64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--signal);
}
.r8-gmodal-promo-copy h4 {
    margin: 0;
    font-size: .86rem;
    line-height: 1.32;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.r8-gmodal-promo-copy p {
    font-size: .74rem;
    line-height: 1.42;
    color: #9cb7a5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.r8-gmodal-promo-foot {
    margin-block-start: auto;
    padding-block-start: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.r8-gmodal-promo-foot strong {
    font-size: .79rem;
    line-height: 1.28;
    color: var(--signal);
    font-weight: 820;
}
.r8-gmodal-promo-cta {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .72rem;
    font-weight: 750;
    color: #d6ecdc;
    white-space: nowrap;
}

/* 4 Quick Need Jump Tiles */
.r8-gmodal-needs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.r8-gmodal-need-tile {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 13px;
    border: 1px solid #2b4636;
    background: #0a1811;
    transition: border-color .16s ease, background-color .16s ease;
}
.r8-gmodal-need-tile:hover {
    border-color: #5d9b76;
    background: #10251a;
}
.r8-gmodal-need-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(145deg, #c7f795 0%, #98df7e 100%);
    display: grid;
    place-items: center;
}
.r8-gmodal-need-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
}
.r8-gmodal-need-copy strong { font-size: .84rem; color: var(--text); }
.r8-gmodal-need-copy small {
    font-size: .72rem;
    color: #95b39f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.r8-gmodal-need-go { color: var(--signal); }

/* Human Advisor Conversion Spotlight Card (with Transparent RGBA Cutout!) */
.r8-gmodal-advisor-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(94px, .75fr);
    align-items: end;
    gap: 8px;
    padding: 16px 14px 0 16px;
    border-radius: 18px;
    border: 1px solid #416d53;
    background:
        radial-gradient(ellipse 68% 72% at 82% 58%, #21734d55 0%, transparent 72%),
        linear-gradient(155deg, #10281c 0%, #08150e 100%);
    overflow: hidden;
}
.r8-gmodal-advisor-copy {
    padding-block-end: 16px;
    display: grid;
    gap: 7px;
    z-index: 2;
}
.r8-gmodal-advisor-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--signal);
}
.r8-gmodal-advisor-copy h3 {
    margin: 0;
    font-size: .98rem;
    line-height: 1.32;
    color: var(--text);
}
.r8-gmodal-advisor-copy p {
    font-size: .76rem;
    line-height: 1.48;
    color: #b7cebe;
}
.r8-gmodal-advisor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-block-start: 4px;
}
.r8-gmodal-btn-lime,
.r8-gmodal-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding-inline: 11px;
    border-radius: 9px;
    font-size: .75rem;
    font-weight: 800;
    white-space: nowrap;
}
.r8-gmodal-btn-lime {
    background: var(--signal);
    color: #14240d;
}
.r8-gmodal-btn-lime:hover { background: #e2ffbc; }
.r8-gmodal-btn-ghost {
    border: 1px solid #3f6850;
    background: #0b1e14cc;
    color: #d7ecdc;
}
.r8-gmodal-btn-ghost:hover { border-color: var(--signal); color: var(--signal); }

.r8-gmodal-advisor-visual {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    align-self: end;
    margin-inline-end: -6px;
}
.r8-gmodal-advisor-visual img {
    width: 100%;
    max-width: 146px;
    height: auto;
    display: block;
    filter: drop-shadow(0 10px 22px #020805c8) drop-shadow(0 0 18px #c7f79526);
}

/* Top Guides List in Side Column */
.r8-gmodal-guide-list {
    display: grid;
    gap: 8px;
}
.r8-gmodal-guide-row {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 7px;
    border-radius: 12px;
    border: 1px solid #263f31;
    background: #091710;
    transition: border-color .16s ease, background-color .16s ease;
}
.r8-gmodal-guide-row:hover {
    border-color: #548e6c;
    background: #10251a;
}
.r8-gmodal-guide-row img {
    width: 84px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
}
.r8-gmodal-guide-row > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.r8-gmodal-guide-row span {
    font-size: .64rem;
    font-weight: 800;
    color: var(--signal);
    text-transform: uppercase;
}
.r8-gmodal-guide-row strong {
    font-size: .8rem;
    line-height: 1.32;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.r8-gmodal-guide-row small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .7rem;
    color: #8eab98;
}

/* STATE B: Live Semantic Results inside XL Modal + Inline Popover Shared Row Styles */
.r8-gmodal-live-cols {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr);
    gap: 18px;
    align-items: start;
}
.r8-gmodal-live-group {
    display: grid;
    gap: 6px;
}

.r8-gs-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 9px 11px;
    border-radius: 13px;
    border: 1px solid #233b2d;
    background: #091710;
    color: var(--text);
    text-decoration: none;
    transition: background-color .14s ease, border-color .14s ease;
}
.r8-gs-row:hover,
.r8-gs-row.is-active {
    background: #132d20;
    border-color: #56926e;
}
.r8-gs-row.is-active {
    box-shadow: inset 3px 0 0 var(--signal);
}
.r8-gs-thumb {
    width: 64px;
    height: 48px;
    border-radius: 9px;
    overflow: hidden;
    background: #06100b;
    border: 1px solid #2b4536;
    display: grid;
    place-items: center;
}
.r8-gs-thumb img { width: 100%; height: 100%; object-fit: cover; }
.r8-gs-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.r8-gs-title {
    font-size: .88rem;
    font-weight: 720;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.r8-gs-title mark {
    background: #c7f79530;
    color: var(--signal);
    border-radius: 3px;
    padding-inline: 2px;
}
.r8-gs-sub {
    font-size: .75rem;
    color: #9ab5a3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.r8-gs-meta {
    display: grid;
    justify-items: end;
    gap: 4px;
    text-align: right;
}
.r8-gs-price {
    font-size: .83rem;
    font-weight: 820;
    color: var(--signal);
    white-space: nowrap;
}
.r8-gs-badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 750;
    border: 1px solid #355844;
    background: #0d2117;
    color: #bfe0c9;
    white-space: nowrap;
}
.r8-gs-badge.is-semantic {
    border-color: #639c7a;
    background: #143625;
    color: var(--signal);
}
.r8-gs-empty {
    padding: 22px 16px;
    border-radius: 16px;
    border: 1px solid #2c4738;
    background: #091710;
    text-align: center;
    color: #b0cab8;
}
.r8-gs-empty strong { color: var(--signal); }

/* CONTEXTUAL UPGRADE COMBOS ("Gợi ý lắp đồng bộ") inside XL Modal */
.r8-gmodal-combo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.r8-gmodal-live-combo {
    display: grid;
    gap: 8px;
    margin-block-start: 14px;
    padding-block-start: 12px;
    border-block-start: 1px dashed #2e503d;
}
.r8-gmodal-combo-card {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 15px;
    border: 1px solid #3c6a50;
    background:
        radial-gradient(ellipse 64% 80% at 90% 10%, #20764e36 0%, transparent 72%),
        linear-gradient(160deg, #0d2318 0%, #08150e 100%);
}
.r8-gmodal-combo-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.r8-gmodal-combo-badge {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #4d8564;
    background: #133222;
    color: var(--signal);
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.r8-gmodal-combo-total {
    font-size: .78rem;
    font-weight: 820;
    color: var(--signal);
}
.r8-gmodal-combo-title {
    margin: 0;
    font-size: .88rem;
    line-height: 1.32;
    color: var(--text);
}
.r8-gmodal-combo-pitch {
    font-size: .74rem;
    line-height: 1.44;
    color: #9fbca9;
}
.r8-gmodal-combo-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}
.r8-gmodal-combo-card.is-compact .r8-gmodal-combo-pair {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}
.r8-gmodal-combo-card.is-compact .r8-gmodal-combo-plus {
    display: none;
}
.r8-gmodal-combo-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid #294435;
    background: #07140d;
    transition: border-color .16s ease, background-color .16s ease;
}
.r8-gmodal-combo-item:hover {
    border-color: var(--signal);
    background: #10261b;
}
.r8-gmodal-combo-thumb {
    width: 48px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    background: #050d09;
    display: grid;
    place-items: center;
}
.r8-gmodal-combo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.r8-gmodal-combo-item-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.r8-gmodal-combo-item-copy strong {
    font-size: .76rem;
    line-height: 1.28;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.r8-gmodal-combo-item-copy small {
    font-size: .71rem;
    font-weight: 760;
    color: var(--signal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.r8-gmodal-combo-plus {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid #4b8161;
    background: #122d1f;
    color: var(--signal);
    display: inline-grid;
    place-items: center;
    font-size: .86rem;
    font-weight: 850;
}
.r8-gmodal-combo-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-block-start: 2px;
}
.r8-gmodal-combo-guide {
    font-size: .73rem;
    font-weight: 700;
    color: #cbe3d2;
    margin-inline-end: auto;
}
.r8-gmodal-combo-guide:hover {
    color: var(--signal);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.r8-gmodal-combo-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding-inline: 12px;
    border-radius: 9px;
    background: var(--signal);
    color: #14240d;
    font-size: .74rem;
    font-weight: 820;
    white-space: nowrap;
}
.r8-gmodal-combo-cta:hover { background: #e2ffbc; }

/* Modal Footer */
.r8-gmodal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 24px;
    border-block-start: 1px solid #263f31;
    background: #06100b;
}
.r8-gmodal-keys {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: .74rem;
    color: #8dab98;
}
.r8-gmodal-keys > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.r8-gmodal-view-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding-inline: 16px;
    border-radius: 10px;
    border: 1px solid #446f56;
    background: #11281c;
    color: var(--signal);
    font-size: .82rem;
    font-weight: 780;
}
.r8-gmodal-view-all:hover {
    background: var(--signal);
    color: var(--deep);
    border-color: var(--signal);
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1180px) {
    .r8-gsearch-strip-inner { grid-template-columns: 1fr; }
    .r8-gsearch-hot-strip { display: none; }
    .r8-gmodal-orb { display: none; }
}

@media (max-width: 920px) {
    .r8-gmodal-grid,
    .r8-gmodal-live-cols,
    .r8-gmodal-combo-grid,
    .r8-gmodal-history-grid { grid-template-columns: 1fr; }
    .r8-gmodal-promo-grid { grid-template-columns: 1fr; }
    .r8-gmodal-resume-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .r8-gsearch-strip { padding-block: 7px 8px; }
    .r8-gsearch-bar { min-height: 44px; padding: 4px 5px 4px 8px; gap: 6px; border-radius: 12px; }
    .r8-gsearch-ai-pill span { display: none; }
    .r8-gsearch-ai-pill { padding: 5px 7px; }
    .r8-gsearch-bar input[type="search"] { font-size: .88rem; height: 34px; }
    .r8-gsearch-expand-btn kbd { display: none; }
    .r8-gsearch-expand-btn { padding-inline: 7px; height: 32px; }
    .r8-gsearch-submit { height: 34px; padding-inline: 11px; font-size: .8rem; }
    .r8-gsearch-submit span { display: none; }

    .r8-gmodal-backdrop { padding: 8px; }
    .r8-gmodal-dialog { max-height: 94svh; border-radius: 18px; }
    .r8-gmodal-hero { padding: 14px 14px 12px; min-width: 0; max-width: 100%; }
    .r8-gmodal-form { min-width: 0; max-width: 100%; grid-template-columns: minmax(0, 1fr); }
    .r8-gmodal-hero-top { flex-wrap: nowrap; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
    .r8-gmodal-brand-badge { font-size: .78rem; min-width: 0; overflow: hidden; }
    .r8-gmodal-brand-badge span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .r8-gmodal-brand-badge small { display: none; }
    .r8-gmodal-top-actions { flex: none; }
    .r8-gmodal-esc-hint { display: none; }
    .r8-gmodal-input-shell {
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding: 6px 8px 6px 12px;
        min-width: 0;
        max-width: 100%;
    }
    .r8-gmodal-submit { grid-column: 1 / -1; width: 100%; min-height: 42px; }
    .r8-gmodal-controls-row { flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; max-width: 100%; }
    .r8-gmodal-scopes {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        border-radius: 999px;
    }
    .r8-gmodal-scopes::-webkit-scrollbar { display: none; }
    .r8-gmodal-scope { flex: none; padding: 0 10px; font-size: .74rem; }
    .r8-gmodal-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding-block-end: 2px;
    }
    .r8-gmodal-chips::-webkit-scrollbar { display: none; }
    .r8-gmodal-chip { flex: none; }
    .r8-gmodal-body { padding: 12px 14px 16px; }
    .r8-gmodal-needs,
    .r8-gmodal-resume-grid { grid-template-columns: 1fr; }
    .r8-gmodal-hcard { grid-template-columns: 62px minmax(0, 1fr); }
    .r8-gmodal-hcard-thumb { width: 62px; height: 56px; }
    .r8-gmodal-advisor-card { grid-template-columns: 1fr; padding: 14px; }
    .r8-gmodal-advisor-visual { display: none; }
    .r8-gmodal-footer { padding: 10px 14px; }
    .r8-gmodal-keys { display: none; }
    .r8-gmodal-view-all { width: 100%; justify-content: center; }
    .r8-gs-row { grid-template-columns: 50px minmax(0, 1fr); }
    .r8-gs-meta { grid-column: 2; display: flex; flex-direction: row; align-items: center; gap: 8px; }
    .r8-gmodal-combo-pair { grid-template-columns: 1fr; }
    .r8-gmodal-combo-plus { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .r8-gmodal-backdrop, .r8-gmodal-dialog, .r8-gmodal-orb { animation: none !important; }
}
