/* ==========================================================================
   Lightly Live Search
   Scoped to .lls-* classes so the rest of the theme is untouched.
   Change the accent colour in one place: --lls-accent.
   ========================================================================== */

.lls-form,
.lls-attached,
.lls-scope {
    --lls-accent: #c8202f;
    --lls-accent-soft: rgba(200, 32, 47, .12);
    --lls-text: #1d1d1f;
    --lls-muted: #8a8a8e;
    --lls-field: #f4f4f6;
    --lls-border: #d6d6db;
    --lls-line: #ececef;
    --lls-chip: #f1f1f4;
    --lls-chip-hover: #e5e5ea;
    --lls-hover: #f5f5f7;
    --lls-fire: #f0582a;
}

.lls-form *,
.lls-panel,
.lls-panel * {
    box-sizing: border-box;
}

.lls-sr {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ---------- search box ---------- */

.lls-form {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    float: none;
    font-family: inherit;
    text-align: left;
}

.lls-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.lls-form input.lls-input {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    float: none;
    width: 100% !important;
    max-width: none !important;
    height: 42px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 72px 0 40px !important;
    font-family: inherit;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 40px !important;
    color: var(--lls-text) !important;
    background: var(--lls-field) !important;
    border: 1px solid var(--lls-border) !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    outline: 0 !important;
    text-indent: 0 !important;
    box-sizing: border-box !important;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.lls-form input.lls-input::placeholder {
    color: var(--lls-muted);
    opacity: 1;
}

.lls-form input.lls-input::-webkit-search-cancel-button,
.lls-form input.lls-input::-webkit-search-decoration,
.lls-form input.lls-input::-webkit-search-results-button {
    -webkit-appearance: none;
    display: none;
}

.lls-form input.lls-input:focus {
    background: #fff !important;
    border-color: var(--lls-accent) !important;
    box-shadow: 0 0 0 3px var(--lls-accent-soft) !important;
}

.lls-form.has-value input.lls-input {
    padding-right: 42px !important;
}

.lls-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    color: #6e6e73;
    pointer-events: none;
    transition: color .15s ease;
}

.lls-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

.lls-form:focus-within .lls-icon {
    color: var(--lls-accent);
}

/* spinner while a request is running */
.lls-form.lls-busy .lls-icon svg {
    display: none;
}

.lls-form.lls-busy .lls-icon::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: lls-spin .6s linear infinite;
}

.lls-kbd {
    position: absolute;
    top: 50%;
    right: 10px;
    z-index: 2;
    padding: 3px 7px;
    margin-top: -11px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    line-height: 14px;
    letter-spacing: .04em;
    color: #555;
    background: #fff;
    border: 1px solid var(--lls-border);
    border-radius: 7px;
    box-shadow: none;
    pointer-events: none;
}

.lls-form:focus-within .lls-kbd,
.lls-form.has-value .lls-kbd {
    display: none;
}

.lls-form button.lls-clear {
    position: absolute;
    top: 50%;
    right: 8px;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-width: 0;
    height: 28px;
    padding: 0;
    margin: -14px 0 0;
    color: #a9a9ae;
    background: transparent;
    border: 0;
    border-radius: 50%;
    box-shadow: none;
    cursor: pointer;
    transition: color .15s ease;
}

.lls-form button.lls-clear:hover,
.lls-form button.lls-clear:focus-visible {
    color: #6e6e73;
    background: transparent;
}

.lls-form.has-value button.lls-clear {
    display: flex;
}

.lls-clear svg {
    display: block;
    width: 16px;
    height: 16px;
}

/* ---------- dropdown ---------- */

.lls-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 99999;
    max-height: 520px;
    padding: 4px 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    font-family: inherit;
    text-align: left;
    color: var(--lls-text);
    background: #fff;
    border: 1px solid #e3e3e8;
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .06);
    animation: lls-in .14s ease-out;
    scrollbar-width: thin;
    scrollbar-color: #c7c7cc transparent;
}

.lls-panel[hidden] {
    display: none !important;
}

.lls-panel::-webkit-scrollbar { width: 8px; }
.lls-panel::-webkit-scrollbar-thumb { background: #c7c7cc; border-radius: 8px; border: 2px solid #fff; }
.lls-panel::-webkit-scrollbar-track { background: transparent; }

.lls-section {
    position: relative;
    padding: 10px 14px;
}

.lls-section + .lls-section::before {
    content: "";
    position: absolute;
    top: 0;
    right: 8px;
    left: 8px;
    border-top: 1px solid var(--lls-line);
}

.lls-section--list {
    padding-right: 0;
    padding-left: 0;
    padding-bottom: 4px;
}

.lls-section--list .lls-head {
    padding: 0 14px;
}

.lls-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.lls-label {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lls-muted);
}

.lls-panel button.lls-link-btn {
    min-width: 0;
    padding: 2px 0;
    margin: 0;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: normal;
    text-transform: none;
    color: var(--lls-accent);
    background: none;
    border: 0;
    box-shadow: none;
    cursor: pointer;
}

.lls-panel button.lls-link-btn:hover {
    text-decoration: underline;
    background: none;
}

/* chips (recent + trending) */
.lls-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lls-chip,
.lls-panel button.lls-chip,
a.lls-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    height: 28px;
    min-width: 0;
    padding: 0 11px 0 9px;
    margin: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none !important;
    text-shadow: none;
    white-space: nowrap;
    color: var(--lls-text) !important;
    background: var(--lls-chip);
    border: 0;
    border-radius: 999px;
    box-shadow: none;
    cursor: pointer;
    transition: background-color .12s ease;
}

.lls-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.lls-chip:hover,
.lls-chip:focus-visible,
.lls-chip.is-active,
.lls-panel button.lls-chip:hover,
.lls-panel button.lls-chip.is-active {
    background: var(--lls-chip-hover);
}

.lls-chip svg {
    flex: none;
    width: 12px;
    height: 12px;
}

.lls-chip--recent svg { color: var(--lls-muted); }
.lls-chip--trend svg  { color: var(--lls-fire); }

/* result rows */
.lls-list {
    padding: 0 6px;
}

.lls-list--results {
    padding-top: 2px;
}

.lls-panel a.lls-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 6px 8px;
    margin: 0;
    color: var(--lls-text) !important;
    text-decoration: none !important;
    border: 0;
    border-radius: 10px;
    box-shadow: none;
    transition: background-color .1s ease;
}

.lls-panel a.lls-item:hover,
.lls-panel a.lls-item.is-active {
    background: var(--lls-hover);
}

.lls-thumb {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    overflow: hidden;
    border-radius: 7px;
    background: var(--lls-chip);
}

.lls-thumb img {
    display: block;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    padding: 0;
    margin: 0;
    object-fit: cover;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.lls-thumb--letter {
    font-size: 14px;
    font-weight: 400;
    color: #fff;
    background: linear-gradient(135deg, #d9343f, #a3182a);
}

.lls-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #2a2a2d;
}

.lls-title mark {
    padding: 0;
    font-weight: inherit;
    color: var(--lls-accent);
    background: none;
}

.lls-meta {
    flex: 0 0 auto;
    max-width: 34%;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--lls-muted);
}

/* "All results for ..." */
.lls-panel a.lls-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px 7px;
    margin: 4px 10px 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--lls-accent) !important;
    text-decoration: none !important;
    border-top: 1px solid var(--lls-line);
    box-shadow: none;
}

.lls-panel a.lls-footer span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.lls-panel a.lls-footer svg {
    flex: none;
    transition: transform .15s ease;
}

.lls-panel a.lls-footer:hover svg,
.lls-panel a.lls-footer.is-active svg {
    transform: translateX(3px);
}

.lls-panel a.lls-footer:hover span,
.lls-panel a.lls-footer.is-active span {
    text-decoration: underline;
}

/* empty / error */
.lls-empty {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 22px 16px 14px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    color: var(--lls-muted);
}

.lls-empty strong {
    font-size: 14px;
    font-weight: 400;
    color: var(--lls-text);
    word-break: break-word;
}

/* loading skeleton */
.lls-skel-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
}

.lls-skel-thumb,
.lls-skel-line {
    display: block;
    background: linear-gradient(90deg, #f0f0f3 25%, #e6e6ea 37%, #f0f0f3 63%);
    background-size: 400% 100%;
    animation: lls-shimmer 1.2s ease infinite;
}

.lls-skel-thumb {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 7px;
}

.lls-skel-line {
    height: 14px;
    border-radius: 7px;
}

/* trending chips on the "no results" page */
.lls-inline-trending {
    margin-top: 14px;
    text-align: left;
}

.lls-inline-trending .lls-label {
    display: block;
    margin-bottom: 10px;
}

/* ---------- responsive ---------- */

@media (max-width: 782px) {
    .lls-panel {
        max-height: 70vh;
    }
}

@media (max-width: 600px) {
    .lls-form input.lls-input {
        height: 40px !important;
        line-height: 38px !important;
        font-size: 16px !important; /* 16px stops iOS zooming into the field */
        padding-right: 14px !important;
    }

    .lls-form.has-value input.lls-input { padding-right: 40px !important; }

    .lls-kbd { display: none; }

    .lls-section { padding: 10px 12px; }
    .lls-section--list { padding-right: 0; padding-left: 0; }
    .lls-section--list .lls-head { padding: 0 12px; }
    .lls-list { padding: 0 4px; }

    .lls-panel a.lls-item { min-height: 46px; }
    .lls-meta { max-width: 36%; }

    .lls-chip,
    .lls-panel button.lls-chip,
    a.lls-chip {
        height: 30px;
    }
}

/* touch screens have no keyboard shortcut */
@media (hover: none) {
    .lls-kbd { display: none; }
    .lls-form input.lls-input { padding-right: 14px !important; }
    .lls-form.has-value input.lls-input { padding-right: 40px !important; }
}
@media (prefers-reduced-motion: reduce) {
    .lls-panel,
    .lls-skel-thumb,
    .lls-skel-line,
    .lls-form.lls-busy .lls-icon::after {
        animation: none;
    }
}

@keyframes lls-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes lls-spin {
    to { transform: rotate(360deg); }
}

@keyframes lls-shimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}