:root {
  --bg: #fff;
  --text: #1f1f1f;
  --muted: #70757a;
  --link: #1a0dab;
  --url: #006621;
  --border: #dfe1e5;
  --accent: #e8472b;
  --accent2: #ffcc00;
  --soft: #f5f5f7;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }

/* ---------- logo ---------- */
.logo { font-weight: 800; letter-spacing: -0.02em; user-select: none; white-space: nowrap; }
.logo .l1 { color: var(--accent); }
.logo .l2 { color: var(--text); }
.logo-big { font-size: clamp(44px, 10vw, 76px); }
.tagline { margin: 4px 0 26px; font-size: 16px; color: var(--muted); text-align: center; }
.logo-small { font-size: 26px; }

/* ---------- search box ---------- */
.search {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 640px;
  border: 2px solid var(--accent2);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  transition: box-shadow .2s;
}
.search:focus-within { box-shadow: 0 4px 18px rgba(0,0,0,.14); }
.search .ico { width: 22px; height: 22px; color: var(--muted); margin-left: 16px; flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 18px;
  padding: 14px 14px;
  background: transparent;
  color: var(--text);
}
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search button {
  border: 0;
  background: var(--accent2);
  color: #000;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  padding: 0 26px;
  align-self: stretch;
  cursor: pointer;
}
.search button:hover { filter: brightness(.95); }

/* ---------- home page ---------- */
.home-top { display: flex; justify-content: flex-end; padding: 14px 20px; }
.home-top nav { display: flex; gap: 18px; align-items: center; font-size: 14px; }
.home-top nav a:hover { text-decoration: underline; }
.btn-login { background: var(--text); color: #fff; padding: 8px 16px; border-radius: 10px; }
.btn-login:hover { text-decoration: none !important; opacity: .85; }

.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 16px 14vh;
}
.home-hints { margin-top: 22px; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; }
.home-hints a { color: var(--link); }
.home-hints a:hover { text-decoration: underline; }

.home-foot {
  display: flex; gap: 20px; flex-wrap: wrap;
  padding: 14px 20px; font-size: 13px; color: var(--muted);
  background: var(--soft); border-top: 1px solid var(--border);
}
.home-foot a:hover { text-decoration: underline; }

/* ---------- results page ---------- */
.serp-top, .tabs, .serp-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 680px) 220px;
  justify-content: center;
  column-gap: 36px;
  padding-left: 24px; padding-right: 24px;
  width: 100%;
}
.serp-top { align-items: center; padding-top: 18px; padding-bottom: 10px; }
.serp-top .logo { justify-self: end; }
.search-small { max-width: none; border-radius: 12px; }
.search-small input { font-size: 16px; padding: 11px 16px; }
.search-small button { padding: 0 18px; display: flex; align-items: center; }
.search-small button svg { width: 22px; height: 22px; }

.tabs { border-bottom: 1px solid var(--border); }
.tabs-in {
  grid-column: 2;
  display: flex; gap: 24px; font-size: 14px; color: var(--muted);
  padding-top: 4px; overflow-x: auto; white-space: nowrap;
}
.tabs a { padding: 10px 0; border-bottom: 3px solid transparent; cursor: pointer; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }

.serp-grid {
  flex: 1;
  row-gap: 18px;
  padding-top: 20px; padding-bottom: 40px;
}

.stats { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.results ol { list-style: none; margin: 0; padding: 0; }
.res { margin-bottom: 28px; }
.res-link { display: block; }
.res-src { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.fav {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  color: #fff; font-size: 14px; font-weight: 700;
}
.res-name { display: block; font-size: 14px; color: var(--text); line-height: 1.2; }
.res-url { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
.res h3 { margin: 0; font-size: 20px; font-weight: 400; color: var(--link); line-height: 1.3; }
.res-link:hover h3 { text-decoration: underline; }
.res p { margin: 5px 0 0; font-size: 14px; line-height: 1.55; color: #4d5156; }
.res p b { color: var(--text); }

.pager { display: flex; gap: 8px; align-items: center; margin: 10px 0 0; font-size: 15px; flex-wrap: wrap; }
.pager b, .pager a { min-width: 38px; height: 38px; padding: 0 12px; border-radius: 10px; display: grid; place-items: center; }
.pager b { background: var(--text); color: #fff; }
.pager a { color: var(--link); }
.pager a:hover { background: var(--soft); }

/* ---------- banners ---------- */
.ads { display: flex; flex-direction: column; gap: 18px; }
.ad {
  position: relative; display: block;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border);
  background: var(--soft);
  transition: transform .2s, box-shadow .2s;
}
.ad:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.14); }
.ad img { display: block; width: 100%; height: auto; }
.ad-label {
  position: absolute; top: 8px; left: 8px;
  font-size: 11px; background: rgba(255,255,255,.9); color: #333;
  padding: 2px 7px; border-radius: 6px;
}
.ad-inline { display: none; margin-bottom: 28px; }
.ad-inline .ad { max-width: 360px; margin: 0 auto; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  /* left column is hidden — its banners appear inline between results */
  .serp-top, .tabs, .serp-grid { grid-template-columns: 150px minmax(0, 680px) 220px; }
  .ads-left { display: none; }
  .results { grid-column: 2; }
  .ads-right { grid-column: 3; }
  .ad-inline { display: block; }
  .ad-phone { display: none; }
}
@media (max-width: 900px) {
  .ad-phone { display: block; }
  .ad-inline .ad { max-width: 280px; }
  .serp-top, .tabs, .serp-grid { grid-template-columns: minmax(0, 1fr); padding-left: 16px; padding-right: 16px; }
  .serp-top { row-gap: 12px; padding-top: 14px; padding-bottom: 8px; }
  .serp-top .logo { justify-self: start; font-size: 24px; }
  .tabs-in, .results { grid-column: 1; }
  .tabs-in { gap: 20px; }
  .serp-grid { padding-top: 16px; padding-bottom: 30px; }
  .ads { display: none !important; }
  .res h3 { font-size: 18px; }
}
@media (max-width: 480px) {
  .search button { padding: 0 16px; font-size: 16px; }
  .search input { font-size: 16px; padding: 13px 10px; }
  .search input::placeholder { font-size: 14px; }
}
