/* Nova Search: оформление. Акцент задаётся одной переменной --h (оттенок). */
:root {
  --h: 255;
  --radius: 18px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
  --bg: #0e0d17; --bg2: #151426; --surface: rgba(255, 255, 255, 0.055); --surface-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.09); --text: #ececf7; --soft: #c7c7da; --muted: #9a9ab4;
  --accent: hsl(var(--h) 92% 69%); --accent-2: hsl(calc(var(--h) + 45) 92% 64%);
  --on-accent: #0e0d17; --shadow: 0 16px 50px rgba(0, 0, 0, 0.45); --blob: 0.42;
}
:root[data-theme="light"] { color-scheme: light; --bg: #f4f4fb; --bg2: #ffffff; --surface: rgba(255, 255, 255, 0.78); --surface-2: rgba(30, 30, 80, 0.06); --border: rgba(30, 30, 80, 0.1); --text: #1a1a2b; --soft: #3d3d56; --muted: #6b6b86; --accent: hsl(var(--h) 76% 50%); --accent-2: hsl(calc(var(--h) + 45) 80% 52%); --on-accent: #fff; --shadow: 0 14px 40px rgba(40, 40, 110, 0.16); --blob: 0.3; }
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] { color-scheme: light; --bg: #f4f4fb; --bg2: #ffffff; --surface: rgba(255, 255, 255, 0.78); --surface-2: rgba(30, 30, 80, 0.06); --border: rgba(30, 30, 80, 0.1); --text: #1a1a2b; --soft: #3d3d56; --muted: #6b6b86; --accent: hsl(var(--h) 76% 50%); --accent-2: hsl(calc(var(--h) + 45) 80% 52%); --on-accent: #fff; --shadow: 0 14px 40px rgba(40, 40, 110, 0.16); --blob: 0.3; }
}
:root { --grad: linear-gradient(135deg, var(--accent), var(--accent-2)); }

* { box-sizing: border-box; }
html { scroll-padding-top: 90px; }
body { margin: 0; min-height: 100vh; font: 16px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
kbd { padding: 1px 7px; font: 12px var(--font); color: var(--soft); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; }

/* ---------- фон ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg i { position: absolute; width: 56vmax; height: 56vmax; border-radius: 50%; filter: blur(90px); opacity: var(--blob); animation: drift 26s ease-in-out infinite alternate; }
.bg i:nth-child(1) { background: var(--accent); left: -16vmax; top: -22vmax; }
.bg i:nth-child(2) { background: var(--accent-2); right: -20vmax; top: 6vmax; animation-duration: 32s; animation-delay: -7s; }
.bg i:nth-child(3) { background: hsl(calc(var(--h) - 60) 90% 60%); left: 14vmax; bottom: -34vmax; opacity: calc(var(--blob) * 0.55); animation-duration: 38s; animation-delay: -13s; }
body:not(.home) .bg i { opacity: calc(var(--blob) * 0.35); }
@keyframes drift { to { transform: translate(7vmax, 6vmax) scale(1.18) rotate(24deg); } }
.no-anim *, .no-anim *::before, .no-anim *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { .bg i { animation: none; } }

/* ---------- шапка ---------- */
#top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; height: 68px; padding: 0 22px; transition: background 0.3s, border-color 0.3s; border-bottom: 1px solid transparent; }
body:not(.home) #top { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-bottom-color: var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; letter-spacing: 0.01em; }
.brand b span { margin-left: 4px; font-weight: 500; color: var(--muted); }
body.home .brand { visibility: hidden; }
.logo { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 4px 14px color-mix(in srgb, var(--accent) 45%, transparent)); }
#slot-head { flex: 1; min-width: 0; max-width: 700px; }
body.home #slot-head { display: none; }
body.home #top { justify-content: flex-end; }
.icon-btn { display: grid; place-items: center; width: 42px; height: 42px; margin-left: auto; font-size: 26px; line-height: 1; color: var(--soft); background: transparent; border: 0; border-radius: 50%; transition: background 0.2s, color 0.2s, transform 0.3s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); transform: rotate(30deg); }

/* ---------- главная ---------- */
#home { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; min-height: calc(100vh - 68px - 70px); padding: 0 20px 40px; }
.hero { display: flex; flex-direction: column; align-items: center; width: min(720px, 100%); text-align: center; animation: rise 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.logo.big { width: 92px; height: 92px; margin-bottom: 14px; animation: float 6s ease-in-out infinite; filter: drop-shadow(0 12px 36px color-mix(in srgb, var(--accent) 55%, transparent)); }
.hero h1 { margin: 0; font-size: clamp(40px, 8vw, 64px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.hero h1 span { margin-left: 8px; font-weight: 300; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { margin: 14px 0 30px; color: var(--muted); font-size: 17px; }
#slot-home { width: 100%; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes float { 50% { transform: translateY(-8px) rotate(2deg); } }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.chip { padding: 7px 14px; font-size: 14px; color: var(--soft); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; transition: all 0.18s; backdrop-filter: blur(8px); }
.chip:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.chip.on { color: var(--on-accent); background: var(--grad); border-color: transparent; font-weight: 600; }
.chip[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.recent { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; min-height: 8px; }
.recent a { padding: 5px 12px; font-size: 13px; color: var(--muted); border-radius: 999px; background: var(--surface-2); transition: color 0.2s; }
.recent a:hover { color: var(--text); }
.hint { margin: 26px 0 0; max-width: 100%; font-size: 13px; color: var(--muted); }

/* ---------- строка поиска ---------- */
.searchbox { position: relative; z-index: 50; display: flex; align-items: center; width: 100%; height: 60px; padding: 0 8px 0 20px; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); transition: border-color 0.2s, box-shadow 0.2s; }
.searchbox:focus-within { border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--accent) 24%, transparent); }
body:not(.home) .searchbox { height: 46px; box-shadow: none; }
.searchbox .lens { flex: none; color: var(--muted); }
.searchbox input { flex: 1; min-width: 0; height: 100%; font-size: 17px; background: transparent; border: 0; outline: 0; }
.searchbox input::-webkit-search-cancel-button { display: none; }
.searchbox input::placeholder { color: var(--muted); }
.clear { width: 30px; height: 30px; font-size: 20px; line-height: 1; color: var(--muted); background: transparent; border: 0; border-radius: 50%; }
.clear:hover { color: var(--text); background: var(--surface-2); }
.go { display: grid; place-items: center; flex: none; width: 44px; height: 44px; color: var(--on-accent); background: var(--grad); border: 0; border-radius: 50%; transition: transform 0.2s, filter 0.2s; }
body:not(.home) .go { width: 36px; height: 36px; }
.go:hover { transform: scale(1.07); filter: brightness(1.08); }

.sug { position: absolute; z-index: 40; top: calc(100% + 8px); left: 0; right: 0; margin: 0; padding: 8px; list-style: none; text-align: left; background: var(--bg2); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
.sug li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; cursor: pointer; color: var(--soft); }
.sug li svg { flex: none; color: var(--muted); }
.sug li.sel, .sug li:hover { background: var(--surface-2); color: var(--text); }
.sug b { color: var(--text); font-weight: 600; }
.sug .hist-h { padding: 6px 14px 2px; font-size: 12px; color: var(--muted); cursor: default; }
.sug .hist-h:hover { background: none; }

/* ---------- вкладки и статус ---------- */
#results { max-width: 1160px; margin: 0 auto; padding: 0 24px 60px; animation: rise 0.4s ease both; }
.tabs { display: flex; gap: 4px; margin: 4px 0 0; border-bottom: 1px solid var(--border); }
.tabs button { position: relative; padding: 12px 16px; color: var(--muted); background: transparent; border: 0; font-weight: 500; transition: color 0.2s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--grad); }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 40px; padding: 10px 0; font-size: 13px; color: var(--muted); }
.pill { padding: 2px 9px; font-size: 12px; border-radius: 999px; background: var(--surface-2); }
.pill.ok::before { content: "✓ "; color: #4cd68a; }
.pill.bad { color: #ff7a8a; }
.pill.bad::before { content: "✕ "; }

.layout { display: grid; grid-template-columns: minmax(0, 700px) 340px; gap: 56px; align-items: start; }
.panel { position: sticky; top: 90px; display: grid; gap: 16px; }
.panel:empty { display: none; }

/* ---------- результаты ---------- */
.list { min-width: 0; }
.r { position: relative; padding: 14px 16px; margin: 0 -16px 6px; border-radius: 16px; animation: rise 0.45s ease both; animation-delay: calc(var(--i, 0) * 35ms); transition: background 0.18s; }
.r:hover, .r.active { background: var(--surface); }
.r.active::before { content: ""; position: absolute; left: 4px; top: 16px; bottom: 16px; width: 3px; border-radius: 3px; background: var(--grad); }
.site { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
.site .host { color: var(--soft); white-space: nowrap; }
.site .path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav { width: 20px; height: 20px; flex: none; border-radius: 6px; background: var(--surface-2); object-fit: cover; }
.fav.letter { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: hsl(var(--lh, 250) 55% 48%); }
.r .t { display: inline-block; font-size: 20px; line-height: 1.3; font-weight: 500; color: var(--accent); word-break: break-word; }
.r .t:hover { text-decoration: underline; text-underline-offset: 3px; }
.r .s { margin: 5px 0 0; color: var(--soft); font-size: 15px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.r mark { color: var(--text); font-weight: 600; background: none; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; font-size: 10.5px; font-weight: 700; border-radius: 6px; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.e-google { --c: #5b9bff; } .e-bing { --c: #19b5b7; } .e-ddg { --c: #ff7a4d; } .e-marginalia { --c: #7ad46a; } .e-brave { --c: #ff6a3d; }
.e-openverse { --c: #c58bff; } .e-gnews { --c: #5b9bff; } .e-bingnews { --c: #19b5b7; }
.multi { color: var(--accent); font-weight: 600; }
body.nobadges .b, body.nobadges .multi { display: none; }

.card { padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(12px); animation: rise 0.45s ease both; }
.card h3 { margin: 0 0 4px; font-size: 20px; line-height: 1.25; }
.card .sub { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.card p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--soft); }
.card img.cover { width: 100%; max-height: 200px; margin-bottom: 14px; object-fit: cover; border-radius: 12px; }
.card .src { display: inline-block; margin-top: 12px; font-size: 13px; color: var(--accent); }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 14px 0 0; font-size: 13px; }
.card dt { color: var(--muted); } .card dd { margin: 0; color: var(--soft); }
.answer { margin-bottom: 14px; border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.answer .big { margin: 0 0 6px; font-size: 30px; font-weight: 700; line-height: 1.2; }
.instant { margin-bottom: 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.instant .big { font-size: 34px; font-weight: 700; letter-spacing: -0.01em; }
.instant .lab { width: 100%; font-size: 12px; color: var(--muted); }
.instant .swatch { width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--border); }
.instant code { font-size: 22px; word-break: break-all; }
.btn { padding: 9px 16px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; transition: all 0.18s; }
.btn:hover { border-color: var(--accent); }
.btn.danger { color: #ff7a8a; }
.more { display: flex; justify-content: center; padding: 18px 0 6px; }
.more .btn { padding: 12px 28px; font-size: 15px; border-radius: 999px; }

.extras { margin-top: 28px; }
.extras h4 { margin: 18px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.extras .rel { display: flex; flex-wrap: wrap; gap: 8px; }
.extras .rel a { padding: 8px 14px; font-size: 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); transition: all 0.18s; }
.extras .rel a:hover { border-color: var(--accent); transform: translateY(-1px); }

.empty { padding: 60px 10px; text-align: center; color: var(--muted); }
.empty h3 { margin: 0 0 8px; font-size: 22px; color: var(--text); }

/* ---------- картинки ---------- */
body.t-images .layout { grid-template-columns: 1fr; }
body.t-images .panel { display: none; }
.grid { column-width: 220px; column-gap: 12px; }
.im { position: relative; margin: 0 0 12px; overflow: hidden; border-radius: 14px; background: var(--surface-2); break-inside: avoid; cursor: zoom-in; animation: rise 0.45s ease both; animation-delay: calc(var(--i, 0) * 22ms); }
.im img { display: block; width: 100%; height: auto; transition: transform 0.35s; }
.im:hover img { transform: scale(1.05); }
.im figcaption { position: absolute; inset: auto 0 0 0; padding: 26px 12px 10px; font-size: 12.5px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.72)); opacity: 0; transition: opacity 0.2s; }
.im:hover figcaption { opacity: 1; }
.im figcaption small { display: block; opacity: 0.75; }
#lightbox { position: fixed; inset: 0; z-index: 90; display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; background: rgba(5, 5, 12, 0.93); backdrop-filter: blur(10px); animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; } }
#lightbox figure { margin: 0; min-width: 0; text-align: center; }
#lightbox img { max-width: 100%; max-height: 80vh; border-radius: 12px; box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6); }
#lightbox figcaption { margin-top: 14px; color: #ddd; font-size: 14px; }
#lightbox figcaption a { margin: 0 8px; color: var(--accent); }
.lb-x { position: absolute; top: 16px; right: 20px; width: 44px; height: 44px; font-size: 30px; color: #fff; background: rgba(255, 255, 255, 0.1); border: 0; border-radius: 50%; }
.lb-n { height: 100%; font-size: 46px; color: #fff; background: transparent; border: 0; opacity: 0.6; }
.lb-n:hover { opacity: 1; }

/* ---------- новости ---------- */
body.t-news .layout { grid-template-columns: minmax(0, 760px); }
body.t-news .panel { display: none; }
.news { display: flex; gap: 16px; }
.news .body { flex: 1; min-width: 0; }
.news img { width: 128px; height: 96px; flex: none; object-fit: cover; border-radius: 12px; background: var(--surface-2); }

/* ---------- загрузка ---------- */
.sk { height: 14px; margin: 10px 0; border-radius: 7px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk.w1 { width: 36%; height: 11px; } .sk.w2 { width: 78%; height: 20px; } .sk.w3 { width: 96%; } .sk.w4 { width: 70%; }
.sk-img { margin: 0 0 12px; border-radius: 14px; background: var(--surface-2); animation: shimmer 1.3s linear infinite; background-image: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%); background-size: 200% 100%; break-inside: avoid; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- настройки ---------- */
#scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.45); animation: fade 0.2s ease; }
.drawer { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: min(390px, 100vw); padding: 20px 22px 40px; overflow-y: auto; background: var(--bg2); border-left: 1px solid var(--border); box-shadow: var(--shadow); animation: slide 0.28s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.d-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.d-head h2 { margin: 0; font-size: 22px; }
.drawer section { padding: 14px 0; border-bottom: 1px solid var(--border); }
.drawer h3 { margin: 14px 0 10px; font-size: 12px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.drawer h3:first-child { margin-top: 0; }
.seg { display: flex; padding: 4px; gap: 4px; background: var(--surface-2); border-radius: 14px; }
.seg button { flex: 1; padding: 8px 4px; font-size: 14px; color: var(--muted); background: transparent; border: 0; border-radius: 10px; transition: all 0.18s; }
.seg button.on { color: var(--on-accent); background: var(--grad); font-weight: 600; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 34px; height: 34px; border: 3px solid transparent; border-radius: 50%; background: hsl(var(--sw) 85% 60%); transition: transform 0.18s; }
.swatches button:hover { transform: scale(1.12); }
.swatches button.on { border-color: var(--text); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 15px; }
.row select { padding: 7px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; outline: 0; }
.row select option { background: var(--bg2); color: var(--text); }
.tg { appearance: none; position: relative; flex: none; width: 44px; height: 26px; margin: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; transition: background 0.2s; cursor: pointer; }
.tg::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform 0.2s, background 0.2s; }
.tg:checked { background: var(--grad); border-color: transparent; }
.tg:checked::after { transform: translateX(18px); background: #fff; }
.elist { display: grid; gap: 4px; }
.elist label { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 15px; }
.elist input { accent-color: var(--accent); width: 18px; height: 18px; }
.elist .lock { margin-left: auto; font-size: 12px; color: var(--muted); }
.note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.copy { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.copy code { flex: 1; min-width: 0; padding: 9px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; background: var(--surface-2); border-radius: 10px; }
#toast { position: fixed; left: 50%; bottom: 26px; z-index: 100; padding: 10px 18px; font-size: 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 14px); transition: all 0.25s; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
footer { padding: 26px 20px 34px; font-size: 12.5px; text-align: center; color: var(--muted); }
body.home footer { position: absolute; left: 0; right: 0; bottom: 0; }

/* ---------- мобильные ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .panel { position: static; order: -1; }
  .card img.cover { display: none; }
  .card p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  #results { padding: 0 16px 50px; }
  .brand b { display: none; }
  #top { padding: 0 14px; gap: 10px; }
  .r { margin: 0 -10px 4px; padding: 12px 10px; }
  .news img { width: 92px; height: 72px; }
  #lightbox { grid-template-columns: 38px 1fr 38px; }
  .grid { column-width: 150px; column-gap: 8px; }
}
