:root {
  --bg: #fff;
  --text: #202124;
  --snippet: #4d5156;
  --dim: #70757a;
  --border: #dfe1e5;
  --link: #1a0dab;
  --visited: #681da8;
  --url: #202124;
  --tab-active: #1a73e8;
  --panel: #f8f9fa;
  --shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: arial, sans-serif, "Noto Sans Bengali", system-ui;
  font-size: 14px;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== HOME (centered) ========== */
.page .header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 24px 20px 48px;
}

.page .logo {
  display: block;
  line-height: 0;
  text-decoration: none;
  margin: 0 0 32px;
}

.page .logo .logo-wordmark {
  display: block;
  width: min(400px, 92vw);
  height: auto;
  max-height: none;
  overflow: visible;
}

.page .search-form {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.search-disclaimer {
  margin: 10px 0 0;
  padding: 0 12px;
  max-width: 100%;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: #9aa0a6;
  text-align: center;
  background: none;
  border: none;
  box-shadow: none;
}

.page.has-results .search-disclaimer {
  display: none;
}

.page .search-inner .ico-search { display: none; }

.page .search-inner {
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 10px 0 22px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: #fff;
}

.page .search-inner:hover,
.page .search-inner:focus-within {
  border-color: transparent;
  box-shadow: var(--shadow);
}

.page .search-inner input {
  flex: 1;
  border: 0;
  outline: none;
  font-size: 18px;
  min-width: 0;
  font-family: inherit;
}

.page .search-trailing .vdiv { display: none; }

.page .home-actions {
  display: flex;
  gap: 12px;
  margin-top: 26px;
}

.page .tabs { display: none; }

.page .content { display: none; }

.btn {
  font-family: inherit;
  font-size: 14px;
  color: #3c4043;
  background: #f8f9fa;
  border: 1px solid #f8f9fa;
  border-radius: 4px;
  padding: 10px 16px;
  cursor: pointer;
}

.btn:hover {
  background: #f1f3f4;
  border-color: #dadce0;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

/* ========== SERP (results page) ========== */
.page.has-results .header {
  flex: 0;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 32px;
  padding: 12px 0 0;
  max-width: none;
  margin: 0;
  border-bottom: none;
}

.page.has-results .logo {
  margin: 0;
  padding: 6px 0 6px 20px;
  flex-shrink: 0;
}

.page.has-results .logo .logo-wordmark {
  width: auto;
  height: 30px;
  max-height: 30px;
}

.page.has-results .search-form {
  flex: 1;
  max-width: 690px;
  margin-right: 20px;
}

.page.has-results .search-inner {
  height: 44px;
  padding: 0 4px 0 14px;
  border-radius: 24px;
  box-shadow: none;
  border: 1px solid var(--border);
}

.page.has-results .search-inner:focus-within {
  box-shadow: var(--shadow);
  border-color: transparent;
}

.page.has-results .search-inner .ico-search {
  display: block;
  width: 20px;
  height: 20px;
  color: #9aa0a6;
  margin-right: 10px;
  flex-shrink: 0;
}

.page.has-results .home-actions { display: none; }

.page.has-results .tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 0 20px 0 168px;
  margin: 0;
  border-bottom: 1px solid #ebebeb;
  min-height: 40px;
}

.tab {
  font-size: 13px;
  color: #5f6368;
  text-decoration: none;
  padding: 8px 12px 10px;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.tab:hover { color: #202124; }

.tab.active {
  color: var(--tab-active);
  border-bottom-color: var(--tab-active);
  font-weight: 500;
}

.tab.dim { cursor: default; }

.page.has-results .content {
  display: block;
  flex: 1;
  padding: 8px 20px 48px 180px;
  max-width: 100%;
}

/* Search trailing icons */
.search-trailing {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.icon-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #70757a;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn svg { width: 20px; height: 20px; }

.icon-btn:hover { background: #f1f3f4; }

.vmotion {
  width: 1px;
  height: 28px;
  background: #dadce0;
  margin: 0 4px;
}

/* Fix typo vmotion -> vmotion - I meant vdiv */
.vdiv {
  width: 1px;
  height: 28px;
  background: #dadce0;
  margin: 0 4px;
}

/* Results */
.result-stats {
  color: var(--dim);
  font-size: 14px;
  margin: 4px 0 16px;
}

/* Hybrid: AI Overview first (like Google AI Overview) */
.ai-overview {
  max-width: 652px;
  margin: 8px 0 0;
  padding-bottom: 20px;
  border-bottom: 1px solid #ebebeb;
}

.ai-overview.loading .ai-overview-body {
  color: var(--dim);
}

.ai-overview-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-overview-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #4285f4;
}

.ai-overview-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.01em;
}

.ai-overview-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  margin: 0;
  white-space: pre-wrap;
}

.ai-overview-body mark,
.ai-overview-body .hl {
  background: #e8f0fe;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

.ai-overview-note {
  font-size: 12px;
  color: var(--dim);
  margin: 12px 0 0;
}

.web-results {
  max-width: 652px;
  padding-top: 8px;
}

.web-results .result-stats {
  margin: 0 0 20px;
}

.g-result {
  max-width: 600px;
  margin-bottom: 28px;
}

.g-result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.g-favicon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f1f3f4;
  flex-shrink: 0;
  object-fit: contain;
}

.g-favicon-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #5f6368;
  text-transform: uppercase;
}

.g-site-lines {
  min-width: 0;
  line-height: 1.3;
}

.g-site-name {
  display: block;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g-breadcrumb {
  display: block;
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g-title {
  display: inline-block;
  font-size: 20px;
  font-weight: 400;
  color: var(--link);
  text-decoration: none;
  line-height: 1.3;
  margin: 0 0 4px;
}

.g-result:visited .g-title { color: var(--visited); }

.g-title:hover { text-decoration: underline; }

.g-snippet {
  font-size: 14px;
  line-height: 1.58;
  color: var(--snippet);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.g-snippet mark {
  font-weight: 700;
  background: transparent;
  color: var(--text);
}

.google-fallback {
  max-width: 640px;
  padding: 24px 0 12px;
  border-top: 1px solid #ebebeb;
  margin-top: 8px;
}

.no-results-title {
  font-size: 18px;
  color: var(--text);
  margin: 0 0 6px;
  font-weight: 600;
}

.no-results-sub {
  color: var(--dim);
  margin: 0 0 16px;
  font-size: 14px;
}

.external-search-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ext-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #dadce0;
  background: #f8f9fa;
  color: #202124;
  transition: background 0.15s, box-shadow 0.15s;
}

.ext-btn:hover {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  text-decoration: none;
}

.ext-btn-google {
  border-color: #4285f4;
  color: #1a73e8;
}

.ext-btn-duck {
  border-color: #de5833;
  color: #c9481f;
}

.hidden { display: none !important; }

@media (max-width: 768px) {
  .page.has-results .header {
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
  }
  .page.has-results .logo {
    padding-left: 16px;
    font-size: 20px;
  }
  .page.has-results .search-form {
    width: 100%;
    order: 2;
    padding: 0 16px 8px;
    margin: 0;
  }
  .page.has-results .tabs {
    padding-left: 16px;
    overflow-x: auto;
    order: 3;
    width: 100%;
  }
  .page.has-results .content {
    padding: 8px 16px 40px;
  }
}
