/* ============================================
   LINSOFT SEARCH - BASE STYLES
   ============================================ */
:root {
    --bg: #0a0a0a;
    --bg-subtle: #0f0f0f;
    --bg-elevated: #161616;
    --bg-hover: #1f1f1f;
    --bg-active: #262626;
    --border: #242424;
    --border-strong: #333;
    --text: #ededed;
    --text-muted: #8f8f8f;
    --text-dim: #5a5a5a;
    --accent: #4f8fff;
    --accent-hover: #6ba0ff;
    --accent-soft: rgba(79,143,255,.12);
    --success: #22c55e;
    --success-soft: rgba(34,197,94,.12);
    --warning: #f59e0b;
    --warning-soft: rgba(245,158,11,.12);
    --danger: #ef4444;
    --danger-soft: rgba(239,68,68,.12);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-full: 999px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow: 0 4px 12px rgba(0,0,0,.35);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
    --ease: cubic-bezier(.4,0,.2,1);
    --ease-out: cubic-bezier(.16,1,.3,1);
}
[data-theme="light"] {
    --bg: #fdfdfd; --bg-subtle: #f8f8f8; --bg-elevated: #fff; --bg-hover: #f4f4f5; --bg-active: #ebebeb;
    --border: #ebebeb; --border-strong: #d4d4d4; --text: #171717; --text-muted: #737373; --text-dim: #a3a3a3;
    --accent: #2563eb; --accent-hover: #1d4ed8; --accent-soft: rgba(37,99,235,.08);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
    --shadow: 0 4px 12px rgba(0,0,0,.06);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    font-size: 14px; line-height: 1.55;
    color: var(--text); background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background-color .2s, color .2s;
    min-height: 100vh;
    font-feature-settings: 'cv11', 'ss01';
}
body::before {
    content: ''; position: fixed; inset: 0;
    background: radial-gradient(ellipse 800px 600px at 50% 0%, rgba(79,143,255,.05), transparent 70%);
    pointer-events: none; z-index: 0;
}
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font: inherit; color: inherit; outline: none; }
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-hover); }
::selection { background: var(--accent-soft); color: var(--text); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--bg); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); background-clip: padding-box; }
.hidden { display: none !important; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* TOPBAR */
.topbar {
    position: fixed; top: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; gap: 8px; z-index: 100; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar-search-slot { display: none; min-width: 0; }
.topbar-tabs-slot { display: none; min-width: 0; }
.topbar.has-results-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, min(660px, 58vw)) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}
.topbar.has-results-tabs {
    row-gap: 8px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}
.topbar.has-results-search .topbar-left { justify-self: start; width: max-content; }
.topbar.has-results-search .topbar-search-slot { display: block; grid-column: 2; width: 100%; }
.topbar.has-results-search .results-search { width: 100%; max-width: none; }
.topbar.has-results-search .results-search input { height: 42px; border-radius: 13px; }
.topbar.has-results-search .topbar-right { grid-column: 3; justify-self: end; }
.topbar.has-results-tabs .topbar-tabs-slot { display: block; grid-column: 1 / -1; grid-row: 2; width: 100%; }
.topbar.has-results-tabs .topbar-tabs-slot .results-tabs { width: fit-content; max-width: 100%; margin: 0; justify-self: start; }
.topbar.has-results-tabs .results-tabs { padding: 3px; border: 0; background: transparent; }
.topbar.has-results-tabs .results-tabs .tab { min-height: 36px; }
.topbar-left {
    opacity: 0; transform: translateX(-4px);
    transition: opacity .25s var(--ease), transform .25s var(--ease);
    font-size: 13.5px; font-weight: 500; cursor: pointer;
    padding: 6px 10px; border-radius: var(--radius-sm);
    color: var(--text);
}
.topbar-left.visible { opacity: 1; transform: translateX(0); }
.topbar-left:hover { background: var(--bg-hover); }
.topbar-left strong { font-weight: 700; color: var(--accent); margin-left: 3px; }
.topbar-right { display: flex; gap: 6px; align-items: center; }

.icon-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--text-muted); transition: all .15s; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn:active { transform: scale(.95); }
/* HOME */
.home { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 80px 24px 40px; }
.home-inner { width: 100%; max-width: 600px; display: flex; flex-direction: column; align-items: center; animation: fadeUp .5s var(--ease-out); }
.logo { font-size: 2.75rem; font-weight: 400; letter-spacing: -.035em; margin-bottom: 10px; line-height: 1; text-align: center; }
.logo strong { font-weight: 700; background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.tagline { font-size: .8125rem; color: var(--text-muted); margin-bottom: 36px; letter-spacing: .01em; }

.search-box { position: relative; width: 100%; margin-bottom: 16px; }
.search-input {
    width: 100%; height: 54px; padding: 0 46px;
    font-size: 15px; color: var(--text);
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-lg); transition: all .2s;
    box-shadow: var(--shadow-sm);
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:hover { border-color: var(--border-strong); }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; transition: color .2s; }
.search-input:focus ~ .search-icon { color: var(--accent); }
.clear-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--text-muted); transition: all .15s; }
.clear-btn:hover { color: var(--text); background: var(--bg-hover); }

/* SUGGESTIONS */
.suggestions {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 6px; max-height: 400px; overflow-y: auto; z-index: 30;
    animation: scaleIn .15s var(--ease-out); transform-origin: top center;
}
.suggestions-label { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 4px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }
.suggestions-label:not(:first-child) { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; }
.suggestions-clear { font-size: 10.5px; font-weight: 500; color: var(--text-muted); padding: 3px 8px; border-radius: 4px; transition: all .15s; text-transform: none; letter-spacing: 0; }
.suggestions-clear:hover { color: var(--danger); background: var(--danger-soft); }
.suggestion-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; transition: background .1s; }
.suggestion-item:hover { background: var(--bg-hover); }
.suggestion-item svg { width: 15px; height: 15px; color: var(--text-muted); }
.suggestion-item:hover svg { color: var(--text); }
.suggestion-item .text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-item .text mark { background: transparent; color: var(--accent); font-weight: 500; }
.suggestion-item .remove { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--text-dim); opacity: 0; transition: all .15s; }
.suggestion-item:hover .remove { opacity: 1; }
.suggestion-item .remove:hover { color: var(--danger); background: var(--danger-soft); }
.suggestion-item .remove svg { width: 12px; height: 12px; }

/* TABS */
.tabs { display: flex; gap: 2px; margin-bottom: 20px; padding: 3px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); }
.tab { padding: 7px 14px; font-size: 13px; font-weight: 500; color: var(--text-muted); border-radius: 7px; transition: all .15s; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--bg-elevated); box-shadow: var(--shadow-sm); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 40px; padding: 0 18px; font-size: 13px; font-weight: 500;
    color: var(--text); background: var(--bg-elevated);
    border: 1px solid var(--border); border-radius: var(--radius);
    transition: all .15s; box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; box-shadow: 0 4px 12px rgba(79,143,255,.4); }

/* HISTORY TOGGLE */
.toggle-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-muted); cursor: pointer; user-select: none; padding: 8px 12px; border-radius: var(--radius-sm); transition: all .15s; }
.toggle-row:hover { color: var(--text); background: var(--bg-hover); }
.toggle-row input { display: none; }
.switch { position: relative; width: 32px; height: 18px; background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--radius-full); transition: all .2s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; background: var(--text-muted); border-radius: 50%; transition: all .2s var(--ease); }
.toggle-row input:checked ~ .switch { background: var(--accent); border-color: var(--accent); }
.toggle-row input:checked ~ .switch::after { transform: translateX(14px); background: #fff; }

/* HISTORY */
.history { width: 100%; margin-top: 20px; animation: fadeUp .3s var(--ease-out); }
.history-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }
.history-clear { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-muted); padding: 3px 8px; border-radius: 4px; font-size: 11px; transition: all .15s; }
.history-clear:hover { color: var(--danger); background: var(--danger-soft); }
.history-list { display: flex; flex-wrap: wrap; gap: 6px; }
.history-item { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 12.5px; color: var(--text-muted); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-full); cursor: pointer; transition: all .15s; max-width: 100%; }
.history-item:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-hover); transform: translateY(-1px); }
.history-item svg { width: 12px; height: 12px; }
.history-item span:not(.x) { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item .x { display: none; width: 14px; height: 14px; align-items: center; justify-content: center; border-radius: 50%; margin-left: 2px; }
.history-item:hover .x { display: flex; }
.history-item .x:hover { color: var(--danger); }
.history-item .x svg { width: 10px; height: 10px; }

/* RESULTS */
.results { max-width: 1080px; margin: 0 auto; padding: 76px 24px 80px; animation: fadeIn .25s var(--ease-out); }
.results-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.results-logo { display: flex; align-items: center; font-size: 15px; font-weight: 400; cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm); transition: background .15s; }
.results-logo:hover { background: var(--bg-hover); }
.results-logo strong { font-weight: 700; color: var(--accent); margin-left: 4px; }
.results-search { position: relative; flex: 1; max-width: 560px; }
.results-search input { width: 100%; height: 42px; padding: 0 42px; font-size: 13.5px; color: var(--text); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); transition: all .15s; }
.results-search input:hover { border-color: var(--border-strong); }
.results-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.results-search .search-icon { left: 14px; width: 16px; height: 16px; }

.results-tabs { display: flex; gap: 2px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.results-tabs .tab { padding: 6px 12px; font-size: 13px; background: transparent; border-radius: 6px; }
.results-tabs .tab.active { background: var(--bg-elevated); border: 1px solid var(--border); }

.results-info { font-size: 12px; color: var(--text-dim); margin-bottom: 24px; font-variant-numeric: tabular-nums; }

.result-list { display: flex; flex-direction: column; gap: 26px; }
.result { max-width: 720px; animation: fadeUp .35s var(--ease-out) backwards; }
.result:nth-child(1) { animation-delay: .02s; }
.result:nth-child(2) { animation-delay: .06s; }
.result:nth-child(3) { animation-delay: .1s; }
.result:nth-child(4) { animation-delay: .14s; }
.result:nth-child(5) { animation-delay: .18s; }
.result-url { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); margin-bottom: 5px; }
.result-url img { width: 16px; height: 16px; border-radius: 50%; background: var(--bg-elevated); padding: 2px; border: 1px solid var(--border); }
.result-url .fallback { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 600; }
.result-title { display: inline-block; font-size: 17px; font-weight: 500; color: var(--accent); margin-bottom: 5px; line-height: 1.35; transition: color .15s; }
.result-title:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
.result-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }
.result-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 8px; color: var(--text-dim); font-size: 11px; }
.result-feedback button { width: 30px; height: 28px; border: 1px solid var(--border); border-radius: 7px; color: var(--text-muted); background: var(--bg-elevated); cursor: pointer; }
.result-feedback button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.result-feedback button:disabled { cursor: default; opacity: .55; }
.result-feedback small { max-width: 250px; }
.result-feedback-status { color: var(--text-muted); }

/* All-results knowledge panel */
body.search-app .web-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); align-items: start; gap: clamp(24px, 3vw, 40px); }
body.search-app .web-layout-single { grid-template-columns: minmax(0, 820px); }
body.search-app .web-main { min-width: 0; }
body.search-app .web-knowledge { position: sticky; top: 140px; display: grid; gap: 14px; min-width: 0; max-height: calc(100vh - 158px); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-right: 3px; }
body.search-app .web-knowledge > section { min-width: 0; padding: 18px; border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border)); border-radius: 18px; background: linear-gradient(160deg, color-mix(in srgb, var(--bg-elevated) 98%, var(--accent)), var(--bg-elevated) 62%); box-shadow: 0 10px 26px rgba(0,0,0,.055); }
body.search-app .web-knowledge-heading { display: flex; align-items: center; gap: 11px; margin: 0 0 15px; }
body.search-app .web-knowledge-heading > div { min-width: 0; }
body.search-app .web-knowledge h2 { margin: 1px 0 0; font-size: .98rem; letter-spacing: -.015em; }
body.search-app .web-knowledge-eyebrow { display: block; color: var(--text-dim); font-size: .68rem; font-weight: 600; letter-spacing: .07em; line-height: 1.3; text-transform: uppercase; }
body.search-app .web-wiki-mark, body.search-app .web-links-mark, body.search-app .web-original-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); border-radius: 12px; color: var(--accent); background: var(--accent-soft); font-family: Georgia, serif; font-size: 1.12rem; font-weight: 700; }
body.search-app .web-links-mark svg { width: 18px; height: 18px; }
body.search-app .web-wikipedia h3 { margin: 0 0 9px; font-size: 1.04rem; line-height: 1.4; letter-spacing: -.015em; }
body.search-app .web-wiki-image { display: block; width: 100%; max-height: 170px; margin: 0 0 14px; border: 1px solid var(--border); border-radius: 12px; object-fit: cover; }
body.search-app .web-wiki-extract, body.search-app .web-knowledge-muted, body.search-app .web-wiki-status { margin: 0 0 12px; color: var(--text-muted); font-size: .82rem; line-height: 1.7; }
body.search-app .web-wiki-extract { max-width: 62ch; }
body.search-app .web-wiki-search-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
body.search-app .web-wiki-search-links a { display: inline-flex; min-height: 38px; align-items: center; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; color: var(--accent); font-size: .76rem; font-weight: 600; text-decoration: none; }
body.search-app .web-wiki-search-links a:hover, body.search-app .web-wiki-search-links a:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
body.search-app .web-wiki-more { margin: -4px 0 10px; color: var(--text-muted); font-size: .78rem; line-height: 1.65; }
body.search-app .web-wiki-more summary { width: fit-content; min-height: 36px; display: flex; align-items: center; color: var(--accent); cursor: pointer; font-weight: 600; }
body.search-app .web-wiki-more summary:hover { text-decoration: underline; text-underline-offset: 3px; }
body.search-app .web-wiki-more p { margin: 4px 0 8px; }
body.search-app .web-wiki-link { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border)); border-radius: 11px; color: var(--accent-hover); background: color-mix(in srgb, var(--accent) 4%, transparent); font-size: .79rem; font-weight: 650; text-decoration: none; transition: background .15s, border-color .15s; }
body.search-app .web-wiki-link:hover { border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, transparent); }
body.search-app .web-wiki-link:hover, body.search-app .web-wiki-status a:hover { text-decoration: underline; text-underline-offset: 3px; }
body.search-app .web-original-list { display: grid; gap: 4px; }
body.search-app .web-original-link { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 9px 7px; border: 1px solid transparent; border-radius: 12px; color: var(--text); text-decoration: none; transition: background .15s, border-color .15s; }
body.search-app .web-original-link:hover, body.search-app .web-original-link:focus-visible { border-color: color-mix(in srgb, var(--accent) 14%, var(--border)); background: color-mix(in srgb, var(--bg-hover) 90%, var(--accent)); outline: none; }
body.search-app .web-original-icon { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; font-family: inherit; font-size: .82rem; }
body.search-app .web-original-copy { display: grid; min-width: 0; flex: 1; gap: 3px; }
body.search-app .web-original-copy > span { overflow: hidden; font-size: .81rem; font-weight: 600; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
body.search-app .web-original-link small { overflow: hidden; color: var(--text-muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
body.search-app .web-original-arrow { width: 15px; height: 15px; color: var(--text-dim); }
body.search-app .web-wiki-status a { color: var(--accent); }

/* IMAGES */
.image-provider-link { margin: 0 0 16px; }
.image-provider-link a { text-decoration: none; }
.image-provider-link p { margin-top: 8px; color: var(--text-muted); }
.images-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.image-card { display: block; color: inherit; text-decoration: none; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: all .2s; animation: fadeUp .35s var(--ease-out) backwards; }
.image-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.image-thumb { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.35); font-weight: 600; font-size: 13px; letter-spacing: .06em; }
.image-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.image-fallback { max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-load-status { min-height: 1.5em; margin: 0 0 12px; text-align: center; }
.image-load-button { margin-left: 8px; }
.image-load-sentinel { height: 1px; }
.image-meta { padding: 10px 12px; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* VIDEOS */
.videos-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 22px; }
.video-card { display: flex; min-width: 0; height: 100%; flex-direction: column; color: inherit; text-decoration: none; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 17px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .2s, transform .2s, box-shadow .2s; animation: fadeUp .35s var(--ease-out) backwards; }
.video-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); transform: translateY(-3px); box-shadow: var(--shadow); }
.video-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.video-thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, #17233d, #253761); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; isolation: isolate; }
.video-thumb::after { position: absolute; z-index: 0; inset: 45% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.25)); content: ""; pointer-events: none; }
.video-thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.video-card:hover .video-thumb > img { transform: scale(1.035); }
.video-play { position: relative; z-index: 1; display: flex; width: 50px; height: 50px; align-items: center; justify-content: center; color: #fff; background: rgba(10,15,25,.72); border: 1px solid rgba(255,255,255,.48); border-radius: 50%; box-shadow: 0 4px 18px rgba(0,0,0,.28); backdrop-filter: blur(8px); transition: background .2s, transform .2s; }
.video-card:hover .video-play { background: #e11d48; transform: scale(1.08); }
.video-play svg { width: 19px; height: 19px; fill: currentColor; stroke: none; margin-left: 2px; }
.video-time { position: absolute; z-index: 1; right: 10px; bottom: 10px; padding: 3px 7px; color: #fff; background: rgba(0,0,0,.78); border: 1px solid rgba(255,255,255,.16); border-radius: 6px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.video-info { display: flex; min-height: 94px; align-items: flex-start; gap: 12px; padding: 15px; }
.video-avatar { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 50%; font-size: .85rem; font-weight: 700; }
.video-copy { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.video-title { display: -webkit-box; overflow: hidden; color: var(--text); font-size: .91rem; font-weight: 600; line-height: 1.45; text-wrap: pretty; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.video-author { overflow: hidden; color: var(--text-muted); font-size: .78rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.video-results-heading { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.video-results-summary { overflow: hidden; margin: 0; color: var(--text-muted); font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.video-page-indicator { flex: 0 0 auto; padding: 6px 10px; color: var(--text-muted); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 999px; font-size: .76rem; font-weight: 600; }
.video-page-status { min-height: 0; margin: 8px 0 0; }
.video-pagination { margin-top: 14px; }

/* NEWS */
.news-featured { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24px; cursor: pointer; transition: all .2s; animation: fadeUp .35s var(--ease-out); }
.news-featured:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
@media (min-width: 700px) { .news-featured { display: grid; grid-template-columns: 1fr 1fr; } }
.news-featured-img { min-height: 200px; background: linear-gradient(135deg, #1e3a8a, #4338ca); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.18); font-size: 22px; font-weight: 700; letter-spacing: .1em; }
.news-featured-img img, .news-card-img img { width: 100%; height: 100%; object-fit: cover; }
.news-featured-body { padding: 24px; }
.news-source { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.news-source .name { color: var(--accent); font-weight: 500; }
.news-featured-title { display: block; color: inherit; text-decoration: none; font-size: 20px; font-weight: 600; line-height: 1.3; margin-bottom: 8px; letter-spacing: -.01em; }
.news-featured-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.news-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: all .2s; display: flex; flex-direction: column; animation: fadeUp .35s var(--ease-out) backwards; }
.news-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.news-card-img { height: 140px; background: linear-gradient(135deg, #7c2d12, #9a3412); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.18); font-size: 16px; font-weight: 700; letter-spacing: .1em; }
.news-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.news-card-title { color: inherit; text-decoration: none; font-size: 13.5px; font-weight: 500; line-height: 1.45; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-card-desc { font-size: 12px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: auto; line-height: 1.5; }

/* SKELETON */
.skeleton { max-width: 720px; }
.skeleton-row { margin-bottom: 26px; }
.skeleton-line { height: 12px; background: linear-gradient(90deg, var(--bg-elevated) 0%, var(--bg-hover) 50%, var(--bg-elevated) 100%); background-size: 200% 100%; border-radius: 4px; margin-bottom: 8px; animation: shimmer 1.6s ease-in-out infinite; }
.skeleton-line.title { height: 16px; width: 55%; margin-bottom: 10px; }
.skeleton-line.desc { width: 90%; }
.skeleton-line.desc-2 { width: 72%; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* TOAST */
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; pointer-events: none; max-width: 340px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: var(--bg-elevated); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); font-size: 13px; color: var(--text); box-shadow: var(--shadow-lg); animation: slideInRight .25s var(--ease-out); pointer-events: auto; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast svg { width: 16px; height: 16px; }
.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }

/* EMPTY */
.empty { text-align: center; padding: 100px 20px; color: var(--text-muted); animation: fadeUp .4s var(--ease-out); }
.empty svg { width: 44px; height: 44px; margin-bottom: 20px; color: var(--text-dim); stroke-width: 1.5; }
.empty h2 { font-size: 15px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.empty p { font-size: 13.5px; }

/* LOGIN */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px 32px; box-shadow: var(--shadow-lg); animation: scaleIn .4s var(--ease-out); }
.login-logo { text-align: center; font-size: 24px; font-weight: 400; letter-spacing: -.02em; margin-bottom: 6px; }
.login-logo strong { font-weight: 700; color: var(--accent); }
.login-sub { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 6px; }
.login-input { width: 100%; height: 42px; padding: 0 12px; font-size: 13.5px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: all .15s; }
.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-error { padding: 10px 12px; background: var(--danger-soft); border: 1px solid rgba(239,68,68,.3); border-radius: var(--radius-sm); color: var(--danger); font-size: 12.5px; margin-bottom: 16px; }
.login-btn { width: 100%; height: 42px; background: var(--accent); color: #fff; border-radius: var(--radius-sm); font-weight: 600; font-size: 13.5px; transition: all .15s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.login-btn:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(79,143,255,.4); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.login-hint { text-align: center; font-size: 11.5px; color: var(--text-muted); margin-top: 20px; }
.login-hint code { padding: 2px 6px; background: var(--bg); border-radius: 4px; color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 11px; }

/* RESPONSIVE */
@media (max-width: 640px) {
    .home { padding: 60px 16px 40px; }
    .logo { font-size: 2.25rem; }
    .tagline { margin-bottom: 28px; font-size: .75rem; }
    .search-input { height: 50px; font-size: 14px; }
    .results { padding: 68px 16px 40px; }
    .results-header { flex-direction: column; align-items: stretch; gap: 12px; }
    .results-search { max-width: 100%; }
    .result-title { font-size: 16px; }
    .tabs { overflow-x: auto; }
    .tabs::-webkit-scrollbar { display: none; }
}

/* Linsoft Search refresh */
html:has(body.search-app) { color-scheme: dark; }
html:has(body.search-app)[data-theme="light"] { color-scheme: light; }
body.search-app {
    --bg: #0b1220;
    --bg-subtle: #0e1728;
    --bg-elevated: #111c2e;
    --bg-hover: #1a2940;
    --bg-active: #20334d;
    --border: #25344a;
    --border-strong: #3b5270;
    --text: #eef4ff;
    --text-muted: #9aaac0;
    --text-dim: #71829a;
    --accent: #8ab4ff;
    --accent-hover: #b1ceff;
    --accent-soft: rgba(138,180,255,.14);
    --radius-sm: 9px;
    --radius: 13px;
    --radius-lg: 18px;
    --shadow-sm: 0 3px 12px rgba(0,0,0,.18);
    --shadow: 0 12px 32px rgba(0,0,0,.24);
    --shadow-lg: 0 24px 64px rgba(0,0,0,.36);
    min-height: 100svh;
    background:
        radial-gradient(ellipse at 12% 2%, rgba(64,105,177,.14), transparent 34rem),
        radial-gradient(ellipse at 88% 58%, rgba(51,126,158,.08), transparent 38rem),
        var(--bg);
}
html[data-theme="light"] body.search-app {
    --bg: #f6f8fc;
    --bg-subtle: #f0f4fa;
    --bg-elevated: #fff;
    --bg-hover: #edf2fa;
    --bg-active: #e4ecf8;
    --border: #dce4f0;
    --border-strong: #b8c7dc;
    --text: #18243a;
    --text-muted: #68778e;
    --text-dim: #8997ab;
    --accent: #315fba;
    --accent-hover: #234b9b;
    --accent-soft: rgba(49,95,186,.11);
    --shadow-sm: 0 3px 12px rgba(22,40,72,.05);
    --shadow: 0 12px 32px rgba(22,40,72,.08);
    --shadow-lg: 0 24px 64px rgba(22,40,72,.14);
}
body.search-app::before { display: none; }
body.search-app :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
body.search-app .topbar { padding: 14px clamp(16px, 3vw, 34px); }
body.search-app .topbar-left {
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: .9rem;
    font-weight: 650;
    letter-spacing: -.025em;
}
body.search-app .topbar-left:hover { border-color: var(--border); background: var(--bg-elevated); }
body.search-app .topbar-right { gap: 8px; }
body.search-app .icon-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg-elevated) 80%, transparent);
    box-shadow: var(--shadow-sm);
}
body.search-app .icon-btn:hover { border-color: var(--accent); background: var(--bg-hover); }
body.search-app .home {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 100svh;
    padding: clamp(80px, 12vh, 130px) 20px 54px;
    background: none;
}
body.search-app .home::before {
    position: absolute;
    z-index: -1;
    top: 43%;
    left: 50%;
    width: min(90vw, 820px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(77,124,203,.13), rgba(53,111,148,.05) 43%, transparent 70%);
    content: "";
    pointer-events: none;
    transform: translate(-50%, -50%);
}
html[data-theme="light"] body.search-app .home::before {
    background: radial-gradient(circle, rgba(105,148,219,.14), rgba(89,150,176,.05) 43%, transparent 70%);
}
body.search-app .home-inner { max-width: 700px; }
body.search-app {
    --logo-word-color: #f1f6ff;
    --logo-accent-start: #78aaff;
    --logo-accent-end: #53dfd0;
    --logo-glow: drop-shadow(0 5px 16px rgba(74, 156, 255, .18));
}
html[data-theme="light"] body.search-app {
    --logo-word-color: #38516f;
    --logo-accent-start: #285fdb;
    --logo-accent-end: #087f78;
    --logo-glow: none;
}
body.search-app .logo { margin-bottom: 14px; color: var(--logo-word-color); font-size: clamp(2.8rem, 6vw, 4.2rem); font-weight: 700; letter-spacing: -.075em; }
body.search-app .logo strong {
    background: linear-gradient(112deg, var(--logo-accent-start) 8%, #568dff 52%, var(--logo-accent-end) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: var(--logo-glow);
}
body.search-app .topbar-left strong {
    background: linear-gradient(112deg, var(--logo-accent-start) 8%, #568dff 52%, var(--logo-accent-end) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
body.search-app .tagline { margin-bottom: 32px; color: var(--text-muted); font-size: .98rem; }
body.search-app .search-box { margin-bottom: 14px; }
body.search-app .search-input {
    height: 62px;
    padding: 0 56px;
    border-color: color-mix(in srgb, var(--border) 78%, var(--accent));
    border-radius: 17px;
    background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
    box-shadow: 0 12px 34px rgba(0,0,0,.16), inset 0 1px rgba(255,255,255,.025);
    font-size: 1rem;
}
body.search-app .search-input::placeholder { color: var(--text-muted); opacity: .85; }
body.search-app .search-input:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
body.search-app .search-input:focus { background: var(--bg-elevated); box-shadow: 0 0 0 4px var(--accent-soft), 0 14px 38px rgba(0,0,0,.2); }
body.search-app .search-icon { left: 20px; width: 20px; height: 20px; }
body.search-app .clear-btn { right: 14px; width: 36px; height: 36px; }
body.search-app .suggestions { top: calc(100% + 8px); padding: 8px; border-radius: 16px; }
body.search-app .home .suggestions:not(.hidden) {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    max-height: min(240px, 40vh);
    margin-top: 8px;
}
body.search-app .suggestion-item { min-height: 44px; border-radius: 10px; }
body.search-app .tabs,
body.search-app .results-tabs {
    display: flex;
    width: fit-content;
    max-width: 100%;
    gap: 4px;
    margin: 8px 0 18px;
    padding: 5px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg-elevated) 78%, transparent);
    scrollbar-width: none;
}
body.search-app .tabs::-webkit-scrollbar,
body.search-app .results-tabs::-webkit-scrollbar { display: none; }
body.search-app .tab {
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: .86rem;
    font-weight: 550;
}
body.search-app .tab:hover { background: var(--bg-hover); }
body.search-app .tab.active {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
    background: color-mix(in srgb, var(--accent) 13%, var(--bg-elevated));
    color: var(--text);
    box-shadow: none;
}
body.search-app .btn {
    min-height: 44px;
    height: auto;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: .88rem;
}
body.search-app .btn-primary { color: #081426; }
html[data-theme="light"] body.search-app .btn-primary { color: #fff; }
body.search-app .toggle-row { min-height: 42px; padding: 8px 12px; border-radius: 10px; }
body.search-app .history { max-width: 600px; margin-top: 22px; padding: 15px; border: 1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--bg-elevated) 78%, transparent); }
body.search-app .history-item { min-height: 36px; }
body.search-app .results {
    width: 100%;
    max-width: 1240px;
    min-height: 100svh;
    padding: 86px clamp(16px, 4vw, 48px) 72px;
}
body.search-app .results-header {
    display: none;
}
body.search-app .results-logo { display: none; }
body.search-app .results-search { width: 100%; max-width: 700px; }
body.search-app .results-search input { height: 48px; border-radius: 13px; font-size: .92rem; }
body.search-app .results-tabs { width: fit-content; margin: 0 0 18px; padding-bottom: 5px; }
body.search-app .results-info { margin-bottom: 20px; color: var(--text-muted); font-size: .82rem; }
body.search-app .result-list { max-width: 820px; gap: 0; }
body.search-app .result { max-width: 100%; padding: 19px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent); }
body.search-app .result:first-child { padding-top: 4px; }
body.search-app .result-title { font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; }
body.search-app .result-desc { max-width: 78ch; font-size: .92rem; line-height: 1.7; }
body.search-app .result-url { font-size: .78rem; }
body.search-app .result-url .result-domain { color: var(--text); font-weight: 550; }
body.search-app .result-url .result-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.search-app .result-actions { display: flex; gap: 8px; margin-top: 8px; }
body.search-app .result-copy { min-height: 40px; padding: 5px 10px; color: var(--text-muted); background: transparent; border: 1px solid transparent; border-radius: 8px; font: inherit; font-size: .78rem; cursor: pointer; }
body.search-app .result-copy:hover, body.search-app .result-copy:focus-visible { color: var(--accent); border-color: var(--border); background: var(--bg-elevated); }
body.search-app .web-load-status { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; min-height: 60px; margin: 18px 0 28px; color: var(--text-muted); font-size: .84rem; }
body.search-app .web-load-button { min-height: 40px; }
body.search-app .web-pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin: 8px 0 36px; }
body.search-app .web-page-button { min-width: 40px; min-height: 40px; padding: 0 10px; color: var(--text); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; font: inherit; cursor: pointer; }
body.search-app .web-page-button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
body.search-app .web-page-button.active { color: #fff; background: var(--accent); border-color: var(--accent); font-weight: 600; }
body.search-app .web-page-button:disabled { opacity: .55; cursor: wait; }
body.search-app .web-page-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.search-app .web-page-step { font-size: 1.15rem; }
body.search-app .web-pagination:empty { display: none; }
body.search-app .images-grid { grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 14px; }
body.search-app .image-card,
body.search-app .video-card,
body.search-app .news-card,
body.search-app .news-featured { border-color: var(--border); border-radius: 16px; background: var(--bg-elevated); }
body.search-app .image-card:hover,
body.search-app .video-card:hover,
body.search-app .news-card:hover,
body.search-app .news-featured:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
body.search-app .image-meta,
body.search-app .video-info,
body.search-app .news-card-body { padding: 14px; }
body.search-app .image-provider-link a { display: inline-flex; min-height: 44px; align-items: center; padding: 0 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg-elevated); }
body.search-app .image-provider-link p { font-size: .84rem; }
body.search-app .video-results-summary { margin: 0; color: var(--text-muted); font-size: .84rem; }
body.search-app .video-results-summary { margin: 0 0 14px; }
body.search-app .video-results-heading .video-results-summary { margin: 0; font-size: .88rem; }
body.search-app .video-page-status { min-height: 0; margin: 8px 0 0; font-size: .8rem; }
body.search-app .video-pagination { margin-top: 14px; }
body.search-app .skeleton-row { padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elevated); }
body.search-app .empty { padding: 80px 20px; }
body.search-app .toast { border-radius: 13px; }
@media (max-width: 640px) {
    body.search-app .home { padding: 78px 16px 36px; }
    body.search-app .home-inner { max-width: 520px; }
    body.search-app .logo { font-size: clamp(2.4rem, 10vw, 3.2rem); }
    body.search-app .tagline { margin-bottom: 24px; font-size: .9rem; }
    body.search-app .search-input { height: 58px; padding: 0 48px; font-size: .95rem; }
    body.search-app .tabs { width: 100%; justify-content: flex-start; }
    body.search-app .tab { min-height: 42px; padding: 8px 12px; }
    body.search-app .results { padding: 126px 16px 42px; }
    .topbar.has-results-search {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
        padding: 8px 12px;
    }
    .topbar.has-results-search .topbar-left { display: none; }
    .topbar.has-results-search .topbar-search-slot { grid-column: 1 / -1; grid-row: 2; }
    .topbar.has-results-search .topbar-right { grid-column: 1 / -1; grid-row: 1; gap: 2px; }
    .topbar.has-results-tabs .topbar-tabs-slot { grid-column: 1 / -1; grid-row: 3; overflow: hidden; }
    .topbar.has-results-tabs .topbar-tabs-slot .results-tabs { width: 100%; }
    .topbar.has-results-tabs .results-tabs { gap: 2px; }
    .topbar.has-results-tabs .results-tabs .tab { min-width: 0; min-height: 36px; flex: 1 0 auto; padding: 7px 9px; font-size: .78rem; }
    .topbar.has-results-search .icon-btn { width: 34px; height: 36px; }
    .topbar.has-results-search .results-search input { height: 40px; padding-right: 10px; padding-left: 38px; font-size: .84rem; }
    .topbar.has-results-search .results-search .search-icon { left: 12px; }
    body.search-app .results-tabs { width: 100%; }
    body.search-app .results-tabs .tab { padding: 8px 12px; font-size: .82rem; }
    body.search-app .result { padding: 16px 0; }
    body.search-app .result-title { font-size: 1.08rem; }
    body.search-app .web-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    body.search-app .web-knowledge { position: static; grid-row: 2; max-height: none; overflow: visible; padding-right: 0; }
    body.search-app .images-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    body.search-app .image-meta { padding: 10px; }
    body.search-app .videos-grid,
    body.search-app .news-grid { grid-template-columns: minmax(0, 1fr); }
    body.search-app .news-featured-body { padding: 18px; }
    body.search-app #toasts { right: 12px; bottom: 12px; left: 12px; max-width: none; }
}
@media (min-width: 641px) and (max-width: 920px) {
    body.search-app .web-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    body.search-app .web-knowledge { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; max-height: none; overflow: visible; padding-right: 0; }
    body.search-app .videos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    body.search-app *, body.search-app *::before, body.search-app *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* Refined search experience */
body.search-app {
    background:
        radial-gradient(ellipse 54rem 38rem at 50% 8%, rgba(57, 103, 174, .14), transparent 72%),
        radial-gradient(ellipse 42rem 34rem at 92% 82%, rgba(35, 112, 121, .07), transparent 75%),
        var(--bg);
}
body.search-app .home::before {
    top: 46%;
    width: min(94vw, 900px);
    background: radial-gradient(circle, rgba(74, 126, 207, .12), rgba(53, 142, 151, .045) 46%, transparent 72%);
    filter: blur(8px);
}
html[data-theme="light"] body.search-app {
    background:
        radial-gradient(ellipse 56rem 40rem at 50% 6%, rgba(91, 139, 216, .11), transparent 72%),
        radial-gradient(ellipse 44rem 34rem at 90% 82%, rgba(47, 150, 146, .055), transparent 75%),
        var(--bg);
}
html[data-theme="light"] body.search-app .home::before {
    background: radial-gradient(circle, rgba(102, 151, 224, .12), rgba(74, 158, 162, .045) 46%, transparent 72%);
}
body.search-app .home-inner {
    max-width: 720px;
}
body.search-app .logo {
    text-shadow: 0 10px 42px rgba(68, 128, 214, .12);
}
body.search-app .tagline {
    margin-bottom: 30px;
    letter-spacing: .005em;
}
body.search-app .tagline::after {
    display: block;
    margin-top: 17px;
    color: var(--text-dim);
    content: "WEB  ·  OBRÁZKY  ·  VIDEÁ  ·  SPRÁVY";
    font-size: .66rem;
    font-weight: 650;
    letter-spacing: .14em;
}
body.search-app .search-input {
    height: 66px;
    border-color: color-mix(in srgb, var(--accent) 16%, var(--border));
    border-radius: 19px;
    background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
    box-shadow: 0 18px 46px rgba(0, 0, 0, .17), inset 0 1px rgba(255, 255, 255, .035);
    backdrop-filter: blur(16px);
}
body.search-app .search-input:hover {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
    box-shadow: 0 20px 48px rgba(0, 0, 0, .19), inset 0 1px rgba(255, 255, 255, .04);
}
body.search-app .search-input:focus {
    border-color: color-mix(in srgb, var(--accent) 62%, var(--border));
    box-shadow: 0 0 0 4px var(--accent-soft), 0 22px 54px rgba(0, 0, 0, .2);
}
body.search-app .tabs,
body.search-app .results-tabs {
    border-color: color-mix(in srgb, var(--border) 82%, var(--accent));
    border-radius: 16px;
    background: color-mix(in srgb, var(--bg-elevated) 72%, transparent);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .08), inset 0 1px rgba(255, 255, 255, .025);
    backdrop-filter: blur(14px);
}
body.search-app .tab {
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
body.search-app .tab:hover {
    transform: translateY(-1px);
}
body.search-app .tab.active {
    border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 17%, var(--bg-elevated)), color-mix(in srgb, #35c7b5 8%, var(--bg-elevated)));
    box-shadow: 0 3px 12px rgba(0, 0, 0, .09), inset 0 1px rgba(255, 255, 255, .045);
}
body.search-app .toggle-row {
    color: var(--text-muted);
}
body.search-app .history {
    border-color: color-mix(in srgb, var(--accent) 10%, var(--border));
    background: color-mix(in srgb, var(--bg-elevated) 72%, transparent);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .08);
    backdrop-filter: blur(14px);
}
body.search-app .topbar.has-results-tabs {
    border-bottom-color: color-mix(in srgb, var(--border) 82%, var(--accent));
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    box-shadow: 0 10px 32px rgba(0, 0, 0, .1);
}
body.search-app .result {
    border-bottom-color: color-mix(in srgb, var(--border) 78%, transparent);
    border-radius: 14px;
    transition: background-color .18s ease, padding .18s ease, border-color .18s ease;
}
body.search-app .result:hover {
    padding-right: 14px;
    padding-left: 14px;
    border-bottom-color: transparent;
    background: color-mix(in srgb, var(--bg-elevated) 58%, transparent);
}
body.search-app .web-knowledge > section {
    border-color: color-mix(in srgb, var(--accent) 10%, var(--border));
    box-shadow: 0 14px 34px rgba(0, 0, 0, .07);
}
html[data-theme="light"] body.search-app .search-input {
    box-shadow: 0 18px 46px rgba(35, 58, 91, .075), inset 0 1px #fff;
}
html[data-theme="light"] body.search-app .tabs,
html[data-theme="light"] body.search-app .results-tabs {
    box-shadow: 0 10px 28px rgba(35, 58, 91, .045), inset 0 1px #fff;
}
@media (max-width: 640px) {
    body.search-app .home::before {
        top: 42%;
        width: 125vw;
    }
    body.search-app .tagline::after {
        margin-top: 14px;
        font-size: .6rem;
        letter-spacing: .11em;
    }
    body.search-app .search-input {
        height: 60px;
        border-radius: 17px;
    }
    body.search-app .result:hover {
        padding-right: 8px;
        padding-left: 8px;
    }
}
@media (prefers-reduced-motion: reduce) {
    body.search-app .tab,
    body.search-app .result {
        transition: none;
    }
}

/* Deep teal results layout */
body.search-app {
    --bg: #102b3b;
    --bg-subtle: #123145;
    --bg-elevated: #15364a;
    --bg-hover: #1a4054;
    --bg-active: #20516a;
    --border: #204154;
    --border-strong: #2e5b70;
    --text: #e4eef3;
    --text-muted: #a6bbc6;
    --text-dim: #7f9aa8;
    --accent: #79c3e2;
    --accent-hover: #a0d9ee;
    --accent-soft: rgba(104, 190, 222, .14);
    --logo-word-color: #e4eef3;
    --logo-accent-start: #83d3ec;
    --logo-accent-end: #48a4cf;
    --logo-glow: drop-shadow(0 5px 16px rgba(78, 173, 213, .15));
    background:
        radial-gradient(ellipse 64rem 42rem at 14% 0%, rgba(39, 119, 153, .16), transparent 72%),
        radial-gradient(ellipse 48rem 36rem at 92% 80%, rgba(27, 105, 127, .08), transparent 75%),
        var(--bg);
}
html[data-theme="light"] body.search-app {
    --bg: #f4f8fa;
    --bg-subtle: #edf4f7;
    --bg-elevated: #fff;
    --bg-hover: #eaf3f7;
    --bg-active: #dcecf3;
    --border: #d7e5eb;
    --border-strong: #b7d0dc;
    --text: #203743;
    --text-muted: #5e7784;
    --text-dim: #8299a4;
    --accent: #247c9d;
    --accent-hover: #176783;
    --accent-soft: rgba(36, 124, 157, .12);
    --logo-word-color: #284451;
    --logo-accent-start: #167b9c;
    --logo-accent-end: #315fba;
    --logo-glow: none;
    background:
        radial-gradient(ellipse 64rem 42rem at 14% 0%, rgba(79, 157, 183, .12), transparent 72%),
        radial-gradient(ellipse 48rem 36rem at 92% 80%, rgba(59, 145, 157, .055), transparent 75%),
        var(--bg);
}
body.search-app .topbar.has-results-search {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: clamp(48px, 4.8vw, 88px);
    padding: 10px clamp(16px, 1.1vw, 20px);
}
body.search-app .topbar.has-results-search .topbar-left {
    padding: 6px 0;
}
body.search-app .topbar.has-results-search .topbar-left strong {
    display: none;
}
body.search-app .topbar.has-results-search .topbar-right {
    position: absolute;
    top: 10px;
    left: calc(clamp(16px, 1.1vw, 20px) + 58px + 8px);
    grid-column: auto;
    justify-self: auto;
}
body.search-app .topbar.has-results-search:has(.topbar-right a[href="admin.php"]) {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    gap: 16px;
}
body.search-app .topbar.has-results-search:has(.topbar-right a[href="admin.php"]) .topbar-left {
    padding: 6px 10px;
}
body.search-app .topbar.has-results-search:has(.topbar-right a[href="admin.php"]) .topbar-left strong {
    display: inline;
}
body.search-app .topbar.has-results-search:has(.topbar-right a[href="admin.php"]) .topbar-right {
    position: static;
    grid-column: 3;
    justify-self: end;
}
body.search-app .topbar.has-results-search .results-search {
    width: 100%;
    max-width: none;
}
body.search-app .topbar.has-results-search .results-search input {
    height: 40px;
    border-radius: 7px;
    background: color-mix(in srgb, var(--bg-elevated) 88%, var(--bg));
    box-shadow: none;
}
body.search-app .topbar.has-results-tabs {
    border-bottom-color: var(--border);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    box-shadow: none;
    backdrop-filter: blur(12px);
}
body.search-app .topbar.has-results-tabs .topbar-tabs-slot .results-tabs {
    gap: 18px;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}
body.search-app .topbar.has-results-tabs .results-tabs .tab {
    min-height: 34px;
    padding: 5px 1px 7px;
    border: 0;
    border-radius: 0;
    color: var(--text-muted);
    font-size: .8rem;
}
body.search-app .topbar.has-results-tabs .results-tabs .tab:hover {
    color: var(--text);
    background: transparent;
    transform: none;
}
body.search-app .topbar.has-results-tabs .results-tabs .tab.active {
    border-bottom: 2px solid var(--accent);
    background: transparent;
    color: var(--accent-hover);
    box-shadow: none;
}
body.search-app .results {
    max-width: none;
    padding: 80px clamp(24px, 8.55vw, 156px) 72px;
}
body.search-app .results-tabs {
    width: 100%;
    gap: 18px;
    margin: 0 0 36px;
    padding: 0;
    overflow-x: auto;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
body.search-app .results-tabs .tab {
    min-height: 34px;
    padding: 5px 1px 7px;
    border: 0;
    border-radius: 0;
    color: var(--text-muted);
    font-size: .8rem;
}
body.search-app .results-tabs .tab:hover {
    color: var(--text);
    background: transparent;
}
body.search-app .results-tabs .tab.active {
    border-bottom: 2px solid var(--accent);
    background: transparent;
    color: var(--accent-hover);
}
body.search-app .results-tabs .tab:hover {
    transform: none;
}
body.search-app .results-info {
    margin-bottom: 14px;
    font-size: .75rem;
}
body.search-app .result-list {
    max-width: none;
}
body.search-app .result {
    padding: 12px 0;
    border-radius: 0;
}
body.search-app .result-title {
    margin-bottom: 3px;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0;
}
body.search-app .result-desc {
    font-size: .82rem;
    line-height: 1.55;
}
body.search-app .result-url {
    gap: 6px;
    margin-bottom: 3px;
    font-size: .7rem;
}
body.search-app .result:hover {
    padding-right: 0;
    padding-left: 0;
    border-bottom-color: color-mix(in srgb, var(--accent) 24%, var(--border));
    background: transparent;
}
body.search-app .result-feedback {
    margin-top: 5px;
    font-size: .68rem;
}
body.search-app .result-feedback button {
    width: 26px;
    height: 24px;
    border-radius: 5px;
}
body.search-app .web-layout {
    grid-template-columns: minmax(0, 520px) minmax(245px, 270px);
    gap: 16px;
    justify-content: start;
}
body.search-app .web-knowledge {
    top: 142px;
    max-height: calc(100vh - 154px);
    gap: 10px;
}
body.search-app .web-knowledge > section {
    padding: 13px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-elevated) 78%, transparent);
    box-shadow: none;
}
body.search-app .web-knowledge-heading {
    gap: 8px;
    margin-bottom: 10px;
}
body.search-app .web-knowledge h2 {
    font-size: .88rem;
}
body.search-app .web-knowledge-eyebrow {
    font-size: .62rem;
}
body.search-app .web-wiki-mark,
body.search-app .web-links-mark,
body.search-app .web-original-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    border-radius: 8px;
}
body.search-app .web-wikipedia h3 {
    margin-bottom: 7px;
    font-size: .95rem;
}
body.search-app .web-wiki-image {
    max-height: 150px;
    margin-bottom: 10px;
    border-radius: 7px;
}
body.search-app .web-wiki-extract,
body.search-app .web-knowledge-muted,
body.search-app .web-wiki-status {
    margin-bottom: 9px;
    font-size: .75rem;
    line-height: 1.55;
}
body.search-app .web-wiki-link {
    min-height: 36px;
    margin-top: 8px;
    padding: 0 9px;
    border-radius: 7px;
}
body.search-app .logo strong,
body.search-app .topbar-left strong {
    background: linear-gradient(112deg, var(--logo-accent-start) 8%, #69c1df 52%, var(--logo-accent-end) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}
body.search-app .home::before {
    background: radial-gradient(circle, rgba(52, 152, 185, .14), rgba(63, 145, 164, .045) 46%, transparent 72%);
}
@media (min-width: 641px) {
    body.search-app .topbar.has-results-tabs .topbar-tabs-slot .results-tabs {
        margin-left: clamp(96px, 7.4vw, 136px);
    }
}
@media (max-width: 920px) {
    body.search-app .web-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }
    body.search-app .web-knowledge {
        position: static;
        grid-row: 1;
        order: -1;
        max-height: none;
        overflow: visible;
    }
    body.search-app .web-main {
        grid-row: 2;
    }
    body.search-app .results {
        padding-top: 132px;
    }
}
@media (max-width: 640px) {
    body.search-app .topbar.has-results-search {
        grid-template-columns: minmax(0, 1fr) max-content;
        gap: 8px;
        padding: 8px 12px;
    }
    body.search-app .topbar.has-results-search .topbar-right {
        position: static;
        left: auto;
        justify-self: end;
        width: max-content;
    }
    body.search-app .topbar.has-results-search .topbar-left {
        display: none;
    }
    body.search-app .topbar.has-results-search:has(.topbar-right a[href="admin.php"]) .topbar-right {
        position: static;
    }
    body.search-app .topbar.has-results-tabs .topbar-tabs-slot .results-tabs {
        gap: 12px;
        margin-left: 0;
    }
    body.search-app .topbar.has-results-tabs .results-tabs .tab {
        min-height: 32px;
        padding-right: 0;
        padding-left: 0;
        font-size: .74rem;
    }
    body.search-app .results {
        padding: 112px 16px 42px;
    }
    body.search-app .results-tabs {
        gap: 12px;
        margin-bottom: 16px;
        border-bottom: 1px solid var(--border);
    }
    body.search-app .web-knowledge {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Solid surfaces, without the glass effect */
body.search-app .topbar.has-results-tabs {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
body.search-app .topbar.has-results-search .results-search input,
body.search-app .search-input {
    background: var(--bg-elevated);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
body.search-app .tabs,
body.search-app .results-tabs {
    background: var(--bg-elevated);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
body.search-app .results-tabs,
body.search-app .topbar.has-results-tabs .topbar-tabs-slot .results-tabs {
    background: transparent;
}
body.search-app .topbar.has-results-tabs .topbar-tabs-slot .results-tabs .tab,
body.search-app .results-tabs .tab {
    background: transparent;
}
body.search-app .web-knowledge > section,
body.search-app .history,
body.search-app .icon-btn {
    background: var(--bg-elevated);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* One consistent teal-blue color family */
body.search-app {
    --bg: #102b3b;
    --bg-subtle: #123145;
    --bg-elevated: #15364a;
    --bg-hover: #1a4054;
    --bg-active: #20516a;
    --border: #204154;
    --border-strong: #2e5b70;
    --text: #e4eef3;
    --text-muted: #a6bbc6;
    --text-dim: #7f9aa8;
    --accent: #79c3e2;
    --accent-hover: #a0d9ee;
    --accent-soft: rgba(104, 190, 222, .14);
    --logo-word-color: #e4eef3;
    --logo-accent-start: #79c3e2;
    --logo-accent-end: #79c3e2;
    --logo-glow: none;
    background: var(--bg);
}
html[data-theme="light"] body.search-app {
    --bg: #f4f8fa;
    --bg-subtle: #edf4f7;
    --bg-elevated: #fff;
    --bg-hover: #eaf3f7;
    --bg-active: #dcecf3;
    --border: #d7e5eb;
    --border-strong: #b7d0dc;
    --text: #203743;
    --text-muted: #5e7784;
    --text-dim: #8299a4;
    --accent: #247c9d;
    --accent-hover: #176783;
    --accent-soft: rgba(36, 124, 157, .12);
    --logo-word-color: #284451;
    --logo-accent-start: #247c9d;
    --logo-accent-end: #247c9d;
    --logo-glow: none;
    background: var(--bg);
}
body.search-app .home::before {
    display: none;
}
body.search-app .logo strong,
body.search-app .topbar-left strong {
    background: none;
    color: var(--accent);
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: currentColor;
    filter: none;
}
body.search-app .tab.active,
body.search-app .results-tabs .tab.active,
body.search-app .topbar.has-results-tabs .results-tabs .tab.active,
body.search-app .web-page-button.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
    box-shadow: none;
}
body.search-app .topbar.has-results-tabs .results-tabs .tab.active,
body.search-app .results-tabs .tab.active {
    background: transparent;
    color: var(--accent);
}

/* Modern, crisp finish in the existing single-color palette */
body.search-app .topbar-left {
    font-size: .94rem;
    letter-spacing: -.035em;
}
body.search-app .icon-btn {
    border-radius: 10px;
    background: var(--bg-elevated);
    box-shadow: none;
}
body.search-app .icon-btn:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
    color: var(--accent);
}
body.search-app .logo {
    margin-bottom: 16px;
    letter-spacing: -.065em;
}
body.search-app .tagline {
    line-height: 1.6;
}
body.search-app .search-input {
    border-color: var(--border-strong);
    border-radius: 14px;
    box-shadow: none;
}
body.search-app .search-input:hover {
    border-color: var(--accent);
}
body.search-app .search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
body.search-app .suggestions {
    border-color: var(--border-strong);
    border-radius: 12px;
    background: var(--bg-elevated);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .2);
}
body.search-app .tabs {
    padding: 4px;
    border-radius: 11px;
    background: var(--bg-subtle);
    box-shadow: none;
}
body.search-app .tabs .tab {
    min-height: 38px;
    padding-right: 13px;
    padding-left: 13px;
}
body.search-app .tabs .tab.active {
    border-color: var(--border-strong);
    background: var(--bg-active);
    color: var(--accent);
    box-shadow: none;
}
body.search-app .results-search input {
    border-color: var(--border);
    background: var(--bg-elevated);
    box-shadow: none;
}
body.search-app .results-search input:hover,
body.search-app .results-search input:focus {
    border-color: var(--accent);
}
body.search-app .results-search input:focus {
    box-shadow: 0 0 0 2px var(--accent-soft);
}
body.search-app .results-tabs {
    margin-bottom: 28px;
}
body.search-app .results-tabs .tab.active {
    font-weight: 650;
}
body.search-app .results-info {
    margin-bottom: 12px;
    color: var(--text-dim);
    letter-spacing: .015em;
}
body.search-app .result {
    padding: 14px 0;
    border-bottom-color: var(--border);
}
body.search-app .result-title {
    color: var(--accent);
    font-size: 1.04rem;
    font-weight: 600;
    line-height: 1.45;
}
body.search-app .result-desc {
    max-width: 68ch;
    color: var(--text-muted);
    font-size: .84rem;
    line-height: 1.65;
}
body.search-app .result-url {
    color: var(--text-muted);
}
body.search-app .result-feedback button {
    border-color: var(--border);
    background: var(--bg-elevated);
}
body.search-app .result-feedback button:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--bg-active);
    color: var(--accent);
}
body.search-app .result-copy {
    min-height: 34px;
    padding: 4px 9px;
    border-radius: 7px;
}
body.search-app .web-knowledge > section {
    border-color: var(--border);
    border-radius: 12px;
    background: var(--bg-elevated);
    box-shadow: none;
}
body.search-app .web-wiki-mark,
body.search-app .web-links-mark,
body.search-app .web-original-icon {
    border-color: var(--border-strong);
    border-radius: 9px;
    background: var(--bg-active);
    color: var(--accent);
}
body.search-app .web-wiki-image {
    border-color: var(--border);
    border-radius: 9px;
}
body.search-app .web-wiki-link {
    border-color: var(--border-strong);
    background: var(--bg-subtle);
    color: var(--accent);
}
body.search-app .web-wiki-link:hover {
    border-color: var(--accent);
    background: var(--bg-active);
}
body.search-app :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
@media (max-width: 640px) {
    body.search-app .results-tabs {
        margin-bottom: 16px;
    }
    body.search-app .result {
        padding: 14px 0;
    }
    body.search-app .result-desc {
        font-size: .82rem;
    }
}

@media (min-width: 641px) {
    body.search-app .topbar.has-results-search .topbar-search-slot {
        position: fixed;
        top: 10px;
        left: 50%;
        width: min(760px, calc(100vw - 240px));
        transform: translateX(-50%);
    }
    body.search-app .topbar.has-results-search .topbar-right {
        right: clamp(16px, 1.1vw, 20px);
        left: auto;
    }
}

/* Use the available screen width for search results */
body.search-app .results {
    padding-right: clamp(20px, 3vw, 52px);
    padding-left: clamp(20px, 3vw, 52px);
}
body.search-app .web-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, min(30vw, 360px));
    gap: clamp(24px, 3vw, 48px);
    justify-content: stretch;
}
body.search-app .web-main,
body.search-app .result-list,
body.search-app .result {
    min-width: 0;
    max-width: none;
    width: 100%;
}
body.search-app .result-desc {
    max-width: 78ch;
}
body.search-app .web-knowledge {
    min-width: 0;
    width: 100%;
}
@media (min-width: 641px) {
    body.search-app .topbar.has-results-tabs .topbar-tabs-slot .results-tabs {
        margin-left: 0;
    }
}
@media (max-width: 920px) {
    body.search-app .web-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }
}
@media (max-width: 640px) {
    body.search-app .results {
        padding-right: 16px;
        padding-left: 16px;
    }
}

/* Final responsive polish */
body.search-app .brand-mark {
    display: inline-grid;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    place-items: center;
    margin-right: 8px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--bg-active);
    color: var(--accent);
    font-size: .88rem;
    font-weight: 800;
    line-height: 1;
}
body.search-app .topbar-left,
body.search-app .results-logo {
    align-items: center;
}
body.search-app .topbar.has-results-search .topbar-left {
    display: inline-flex;
}
body.search-app .topbar.has-results-search .topbar-search-slot {
    width: min(760px, calc(100vw - 260px));
}
body.search-app .topbar.has-results-search .results-search input {
    height: 42px;
    border-radius: 9px;
}
body.search-app .topbar.has-results-search #theme-toggle {
    width: 42px;
    height: 42px;
}
body.search-app .web-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, min(26vw, 320px));
}
body.search-app .result-desc {
    font-size: .92rem;
    line-height: 1.68;
}
body.search-app .result-title {
    font-size: 1.08rem;
}
body.search-app .result {
    padding-top: 17px;
    padding-bottom: 17px;
}
body.search-app .result-actions,
body.search-app .result-feedback {
    opacity: .78;
    transition: opacity .16s ease;
}
body.search-app .result:hover .result-actions,
body.search-app .result:hover .result-feedback,
body.search-app .result:focus-within .result-actions,
body.search-app .result:focus-within .result-feedback {
    opacity: 1;
}
body.search-app .result-copy {
    min-height: 32px;
    color: var(--text-dim);
    font-size: .74rem;
}
body.search-app .result-copy:hover,
body.search-app .result-copy:focus-visible {
    color: var(--accent);
}
body.search-app .web-wiki-toggle {
    display: none;
}
body.search-app .web-wiki-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform .18s ease;
}
body.search-app .web-wikipedia.is-expanded .web-wiki-toggle svg {
    transform: rotate(180deg);
}
@media (max-width: 920px) {
    body.search-app .web-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    body.search-app .web-knowledge {
        grid-template-columns: minmax(0, 1fr);
    }
    body.search-app .web-wiki-toggle {
        display: inline-flex;
        min-height: 36px;
        align-items: center;
        justify-content: center;
        gap: 7px;
        margin-left: auto;
        padding: 0 10px;
        border: 1px solid var(--border-strong);
        border-radius: 8px;
        background: var(--bg-subtle);
        color: var(--accent);
        font: inherit;
        font-size: .76rem;
        font-weight: 600;
        cursor: pointer;
    }
    body.search-app .web-wiki-toggle:hover,
    body.search-app .web-wiki-toggle:focus-visible {
        border-color: var(--accent);
        background: var(--bg-active);
    }
    body.search-app .web-wikipedia:not(.is-expanded) .web-wikipedia-content {
        display: none;
    }
    body.search-app .web-wikipedia .web-knowledge-heading {
        margin-bottom: 0;
    }
    body.search-app .web-wikipedia.is-expanded .web-knowledge-heading {
        margin-bottom: 12px;
    }
}
@media (max-width: 640px) {
    body.search-app .topbar.has-results-search {
        display: block;
        min-height: 58px;
        padding: 8px 12px;
    }
    body.search-app .topbar.has-results-search .topbar-left {
        display: none;
    }
    body.search-app .topbar.has-results-search .topbar-search-slot {
        position: fixed;
        top: 8px;
        left: 12px;
        width: calc(100vw - 132px);
        transform: none;
    }
    body.search-app .topbar.has-results-search .results-search {
        width: 100%;
        max-width: none;
    }
    body.search-app .topbar.has-results-search .topbar-right {
        position: fixed;
        top: 8px;
        right: 12px;
        display: flex;
    }
    body.search-app .results-tabs {
        margin-bottom: 14px;
    }
    body.search-app .result {
        padding-top: 14px;
        padding-bottom: 14px;
    }
    body.search-app .result-desc {
        font-size: .88rem;
        line-height: 1.62;
    }
}

/* Accessible, solid finish */
body.search-app .topbar-left,
body.search-app .results-logo {
    border: 0;
    font-family: inherit;
}
body.search-app .topbar-left:focus-visible,
body.search-app .results-logo:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}
body.search-app .search-shortcut {
    position: absolute;
    top: 50%;
    right: 14px;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    transform: translateY(-50%);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--text-dim);
    font: 500 .78rem/1 'Inter', -apple-system, system-ui, sans-serif;
    pointer-events: none;
}
body.search-app .search-box:focus-within .search-shortcut,
body.search-app .search-input:not(:placeholder-shown) ~ .search-shortcut {
    display: none;
}
body.search-app .tagline::after {
    display: none;
}
body.search-app .topbar.has-results-tabs {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
body.search-app .search-input,
body.search-app .results-search input,
body.search-app .tabs,
body.search-app .history,
body.search-app .web-knowledge > section {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
body.search-app .search-input,
body.search-app .results-search input,
body.search-app .tabs,
body.search-app .history,
body.search-app .web-knowledge > section {
    background-color: var(--bg-elevated);
}
body.search-app .tabs .tab:focus-visible,
body.search-app .results-tabs .tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}