/* SelectGo search portal (Pages/SearchPortal.cshtml). Self-contained: the page has no site layout. */
:root {
    --sp-bg: #fafaf9;
    --sp-surface: #ffffff;
    --sp-text: #18181b;
    --sp-muted: #71717a;
    --sp-faint: #a1a1aa;
    --sp-line: #e4e4e7;
    --sp-line-strong: #d4d4d8;
    --sp-accent: #2563eb;
    --sp-mark: #eef2ff;
    --sp-hover: #f4f4f5;
    --sp-radius: 14px;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

.sp-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--sp-bg);
    color: var(--sp-text);
    font: 400 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.sp { min-height: 100vh; min-height: 100dvh; display: flex; }
.sp__inner { width: 100%; max-width: 868px; margin: 0 auto; padding: 0 16px; }

/* Home: everything centred in the viewport. */
.sp--home {
    align-items: center;
    background: radial-gradient(circle at 50% 38%, #fff 0, #fff 32%, #fafaf9 72%);
}
.sp--home .sp__inner { display: flex; flex-direction: column; align-items: center; text-align: center; padding-bottom: 8vh; }
.sp--home .sp__form { width: min(100%, 820px); }

.sp__brand {
    display: inline-block;
    color: var(--sp-text);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.04em;
    text-decoration: none;
}
.sp__brand img { display: block; width: clamp(142px, 16vw, 90px); height: 52px; object-fit: contain; }

.sp__kicker { margin: 22px 0 0; color: var(--sp-muted); font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; }
.sp__title { margin: 18px 0 44px; font-size: clamp(34px, 4.4vw, 52px); line-height: 1.08; font-weight: 750; letter-spacing: -0.045em; }
.sp__lead { margin: 10px 0 10px; color: var(--sp-muted); font-size: 15px; }

/* Search box */
.sp__form { position: relative; text-align: left; }
.sp__box {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 66px;
    padding: 0 10px 0 20px;
    background: var(--sp-surface);
    border: 1px solid var(--sp-line);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(24, 24, 27, 0.08);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sp__box:focus-within { border-color: var(--sp-line-strong); box-shadow: 0 2px 10px rgba(24, 24, 27, 0.07); }

.sp__icon, .sp__clear svg, .sp__voice svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.sp__icon { flex: none; color: var(--sp-muted); }

.sp__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--sp-text);
    font: inherit;
    font-size: 17px;
}
.sp__input::placeholder { color: var(--sp-faint); }
.sp__input::-webkit-search-cancel-button { display: none; }

.sp__clear {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sp-muted);
    cursor: pointer;
}
.sp__clear:hover { background: var(--sp-hover); color: var(--sp-text); }

.sp__voice { flex: none; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-left: 1px solid var(--sp-line); background: transparent; color: var(--sp-muted); cursor: pointer; }
.sp__voice:hover { color: var(--sp-text); }
.sp__voice.is-listening { color: #dc2626; animation: sp-pulse 1.2s ease-in-out infinite; }
.sp__voice[disabled] { opacity: .35; cursor: default; }
@keyframes sp-pulse { 50% { transform: scale(1.12); } }

.sp__kbd {
    flex: none;
    padding: 2px 7px;
    border: 1px solid var(--sp-line);
    border-radius: 5px;
    color: var(--sp-faint);
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.sp__submit {
    flex: none;
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: var(--sp-text);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}
.sp__submit:hover { background: #000; }
.sp__submit:focus-visible, .sp__clear:focus-visible, .sp__voice:focus-visible, .sp a:focus-visible, .sp-account :focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; }

/* Suggestions */
.sp__suggest {
    position: absolute;
    z-index: 10;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: min(60vh, 460px);
    overflow-y: auto;
    padding: 10px 0;
    background: var(--sp-surface);
    border: 1px solid var(--sp-line);
    border-radius: var(--sp-radius);
    box-shadow: 0 12px 32px rgba(24, 24, 27, 0.08);
}
.sp-suggest__label { margin: 8px 20px 6px; color: var(--sp-muted); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.sp-suggest__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    color: var(--sp-text);
    text-decoration: none;
    cursor: pointer;
}
.sp-suggest__item[aria-selected="true"], .sp-suggest__item:hover { background: var(--sp-hover); }
.sp-suggest__item svg { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--sp-faint); stroke-width: 1.8; stroke-linecap: round; }
.sp-suggest__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.sp-suggest__text strong { font-weight: 600; }
.sp-suggest__site { flex: none; color: var(--sp-faint); font-size: 12px; }

/* Topic chips */
.sp__topics { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 22px; margin-top: 22px; color: var(--sp-faint); font-size: 13px; }
.sp__topics a { color: #52525b; text-decoration: none; }
.sp__topics a:hover { color: var(--sp-text); text-decoration: underline; text-underline-offset: 3px; }
.sp__aggregate { margin: 30px 0 0; color: var(--sp-muted); font-size: 13px; }

/* Account navigation and dynamic application launcher. */
.sp-account { position: fixed; z-index: 30; top: 22px; right: 28px; display: flex; align-items: center; gap: 14px; font-size: 13px; }
.sp-account a { color: var(--sp-text); text-decoration: none; }
.sp-account__quick { display: flex; gap: 16px; }
.sp-signin { padding: 9px 17px; border-radius: 999px; background: #1d4ed8; color: #fff !important; font-weight: 600; }
.sp-popover { position: relative; }
.sp-popover summary { list-style: none; cursor: pointer; }
.sp-popover summary::-webkit-details-marker { display: none; }
.sp-apps > summary { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #52525b; }
.sp-apps > summary:hover { background: var(--sp-hover); }
.sp-apps > summary svg { width: 24px; height: 24px; }
.sp-popover__panel { position: absolute; top: calc(100% + 10px); right: 0; width: 260px; padding: 14px; border: 1px solid var(--sp-line); border-radius: 18px; background: #fff; box-shadow: 0 16px 46px rgba(24,24,27,.14); }
.sp-apps__panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sp-app { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 12px; text-align: center; }
.sp-app:hover { background: var(--sp-hover); }
.sp-app__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #f4f4f5; color: #3f3f46; font-weight: 700; }
.sp-app__icon img { width: 28px; height: 28px; object-fit: contain; }
.sp-app span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-user__avatar { display: grid; place-items: center; width: 38px; height: 38px; overflow: hidden; border-radius: 50%; background: #18181b; color: #fff; font-weight: 700; }
.sp-user__avatar img { width: 100%; height: 100%; object-fit: cover; }
.sp-user__panel { display: flex; flex-direction: column; gap: 2px; width: 245px; }
.sp-user__panel > strong, .sp-user__panel > span { padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-user__panel > span { margin-bottom: 9px; color: var(--sp-muted); font-size: 12px; }
.sp-user__panel a, .sp-user__panel button { padding: 9px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--sp-text); font: inherit; text-align: left; cursor: pointer; }
.sp-user__panel a:hover, .sp-user__panel button:hover { background: var(--sp-hover); }
.sp-user__panel hr { width: 100%; margin: 7px 0; border: 0; border-top: 1px solid var(--sp-line); }

/* Results layout */
.sp--results .sp__inner { padding-top: 64px; padding-bottom: 64px; }
.sp--results .sp__brand { margin-bottom: 12px; }
.sp--results .sp__box { height: 60px; }

.sp-results { margin-top: 40px; }
.sp-results__meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.sp-results__heading { margin: 0; font-size: 15px; font-weight: 600; }
.sp-results__count { color: var(--sp-muted); }
.sp-results__scope { margin-left: auto; color: var(--sp-faint); font-size: 13px; }

.sp-filters {
    display: flex;
    gap: 28px;
    margin-top: 16px;
    border-bottom: 1px solid var(--sp-line);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.sp-filters::-webkit-scrollbar { display: none; }
.sp-filters__item {
    flex: none;
    padding: 6px 0 12px;
    color: var(--sp-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}
.sp-filters__item:hover { color: var(--sp-text); }
.sp-filters__item[aria-current="page"] { color: var(--sp-text); font-weight: 600; border-bottom-color: var(--sp-text); }

.sp-list { list-style: none; margin: 0; padding: 0; }
.sp-hit { padding: 26px 0; border-bottom: 1px solid var(--sp-line); }
.sp-hit__source { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; }
.sp-hit__mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 20px;
    height: 20px;
    border: 1px solid var(--sp-line);
    border-radius: 5px;
    background: #f4f4f5;
    font-size: 10px;
    font-weight: 700;
}
.sp-hit__mark img { display: block; width: 16px; height: 16px; border-radius: 3px; object-fit: contain; }
.sp-hit__mark:has(img) { background: var(--sp-surface); }
.sp-hit__site { font-weight: 600; color: #3f3f46; }
.sp-results__notice { margin: 14px 0 0; color: var(--sp-faint); font-size: 13px; }
.sp-hit__domain { color: var(--sp-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-hit__domain::before { content: "·"; margin-right: 8px; }
.sp-hit__title { margin: 8px 0 0; font-size: 20px; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.sp-hit__title a { color: var(--sp-text); text-decoration: none; }
.sp-hit__title a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.sp-hit__title a:visited { color: #3f3f46; }
.sp-hit__snippet { margin: 6px 0 0; color: #52525b; font-size: 14px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sp-hit__facts { display: flex; gap: 14px; margin: 8px 0 0; color: var(--sp-faint); font-size: 12px; }
.sp mark { background: var(--sp-mark); color: inherit; border-radius: 3px; padding: 0 2px; }

.sp-more { padding: 28px 0 0; text-align: center; }
.sp-more__button {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--sp-line);
    border-radius: 999px;
    background: var(--sp-surface);
    color: var(--sp-text);
    font-size: 14px;
    text-decoration: none;
}
.sp-more__button:hover { border-color: var(--sp-line-strong); }

.sp-message { padding: 48px 0; color: var(--sp-muted); }
.sp-message p { margin: 0; }
.sp-message__title { margin-bottom: 6px !important; color: var(--sp-text); font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }

/* Loading: the current results dim and a few skeleton rows stand in for new ones. */
.sp-results.is-loading .sp-list, .sp-list.is-loading { opacity: 0.45; transition: opacity 0.15s ease; }
.sp-skeleton { padding: 26px 0; border-bottom: 1px solid var(--sp-line); }
.sp-skeleton span { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #f0f0f1 25%, #e7e7e9 50%, #f0f0f1 75%); background-size: 200% 100%; animation: sp-shimmer 1.2s infinite; }
.sp-skeleton span + span { margin-top: 12px; }
.sp-skeleton span:nth-child(1) { width: 22%; }
.sp-skeleton span:nth-child(2) { width: 68%; height: 18px; }
.sp-skeleton span:nth-child(3) { width: 92%; }
@keyframes sp-shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    .sp-skeleton span { animation: none; }
    .sp__box { transition: none; }
}

@media (max-width: 767px) {
    .sp-account { top: 12px; right: 12px; gap: 7px; }
    .sp-account__quick { display: none; }
    .sp-popover__panel { position: fixed; top: 62px; right: 12px; left: 12px; width: auto; max-height: calc(100dvh - 78px); overflow: auto; }
    .sp__inner { padding: 0 16px; }
    .sp--home .sp__inner { padding-top: 60px; padding-bottom: 5vh; }
    .sp__brand { font-size: 19px; }
    .sp__kicker { margin-top: 16px; font-size: 11px; }
    .sp__title { margin-bottom: 30px; }
    .sp__box, .sp--results .sp__box { height: 54px; padding: 0 7px 0 14px; gap: 8px; }
    .sp__kbd { display: none; }
    .sp__input { font-size: 16px; } /* 16px keeps iOS from zooming on focus */
    .sp__submit { height: 40px; padding: 0 13px; }
    .sp__voice { width: 32px; }
    .sp--results .sp__inner { padding-top: 24px; padding-bottom: 40px; }
    .sp--results .sp__brand { margin-bottom: 18px; }
    .sp-results { margin-top: 28px; }
    .sp-results__scope { display: none; }
    .sp-filters { gap: 22px; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
    .sp-hit { padding: 20px 0; }
    .sp-hit__title { font-size: 18px; }
    .sp__suggest { max-height: 52vh; }
    .sp-suggest__item { padding: 10px 14px; }
    .sp-suggest__label { margin-left: 14px; }
    .sp-suggest__site { display: none; }
}
