/* =============================================
   CSS Variables — Light & Dark Mode
   ============================================= */
:root {
  --bg:           #fff;
  --bg-secondary: #f8f9fa;
  --bg-header:    #fff;
  --text:         #202124;
  --text-muted:   #70757a;
  --text-desc:    #4d5156;
  --link:         #1a0dab;
  --link-visited: #6e329d;
  --url-color:    #006621;
  --border:       #ebebeb;
  --search-border:#dfe1e5;
  --search-shadow:rgba(32,33,36,.28);
  --btn-bg:       #f8f9fa;
  --btn-border:   #f8f9fa;
  --btn-hover:    #e8eaed;
  --badge-bg:     #f1f3f4;
  --badge-border: #dadce0;
  --favicon-bg:   #e8eaed;
  --favicon-color:#5f6368;
  --footer-bg:    #f2f2f2;
  --footer-border:#e4e4e4;
  --ac-bg:        #fff;
  --ac-hover:     #f8f9fa;
  --answer-bg:    #f0f7ff;
  --answer-border:#c4d8f5;
  --paa-bg:       #f8f9fa;
  --paa-border:   #ebebeb;
}

[data-theme="dark"] {
  --bg:           #202124;
  --bg-secondary: #303134;
  --bg-header:    #202124;
  --text:         #e8eaed;
  --text-muted:   #9aa0a6;
  --text-desc:    #bdc1c6;
  --link:         #8ab4f8;
  --link-visited: #c58af9;
  --url-color:    #81c995;
  --border:       #3c4043;
  --search-border:#5f6368;
  --search-shadow:rgba(0,0,0,.4);
  --btn-bg:       #303134;
  --btn-border:   #5f6368;
  --btn-hover:    #3c4043;
  --badge-bg:     #3c4043;
  --badge-border: #5f6368;
  --favicon-bg:   #3c4043;
  --favicon-color:#9aa0a6;
  --footer-bg:    #171717;
  --footer-border:#3c4043;
  --ac-bg:        #303134;
  --ac-hover:     #3c4043;
  --answer-bg:    #1e2a3a;
  --answer-border:#2d4a6e;
  --paa-bg:       #303134;
  --paa-border:   #3c4043;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Roboto', arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  transition: background .2s, color .2s;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Shared SVG icon class (sprite loaded via /js/icons.js) */
.icon {
  width: 16px; height: 16px;
  fill: currentColor;
  flex-shrink: 0;
  vertical-align: middle;
  display: inline-block;
}
.amp-badge .icon { width: 12px; height: 12px; }
.result-rotation-badge .icon { width: 12px; height: 12px; }

/* =============================================
   HOME PAGE
   ============================================= */
#home-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 28vh;
  min-height: 100vh;
  background: var(--bg);
}

/* Logo image — home page */
.logo-img {
  height: clamp(48px, 12vw, 92px);
  width: auto;
  margin-bottom: 28px;
  cursor: pointer;
  display: block;
  object-fit: contain;
}

/* Auto-swap logo per theme. Default (dark) pakai src asli. Light pakai logo-bgputih */
[data-theme="light"] .logo-img,
[data-theme="light"] .logo-small-img {
  content: url('/images/logo-bgputih.png');
}


/* Logo image — result header (size controlled in .header-top above) */
.logo-small-img {
  width: auto;
  cursor: pointer;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
}

/* Leading search icon inside the home pill */
.search-icon-leading {
  width: 20px; height: 20px;
  fill: #9aa0a6;
  flex-shrink: 0;
}
[data-theme="dark"] .search-icon-leading { fill: #9aa0a6; }

/* Trailing colorful Google mic-dots placeholder swapped for real magnifier */
.btn-search-trailing svg { width: 24px; height: 24px; }

.search-wrap-home {
  width: 100%;
  max-width: 584px;
  padding: 0 16px;
}

/* =============================================
   Autocomplete
   ============================================= */
.autocomplete-wrap        { position: relative; width: 100%; }
.autocomplete-wrap-result { max-width: 720px; min-width: 0; }

.autocomplete-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--ac-bg);
  border: 1px solid var(--search-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--search-shadow);
  z-index: 200;
  overflow: hidden;
}

.ac-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: background .1s;
}
.ac-item:hover, .ac-item.ac-selected { background: var(--ac-hover); }
.ac-icon-svg {
  width: 20px; height: 20px;
  fill: var(--text-muted);
  flex-shrink: 0;
}
.ac-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-del {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  width: 28px; height: 28px;
  padding: 0; border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s;
}
.ac-del:hover { background: var(--badge-bg); }
.ac-del svg { width: 16px; height: 16px; fill: currentColor; }

/* =============================================
   Home search box
   ============================================= */
.search-box-home {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--search-border);
  border-radius: 24px;
  padding: 0 14px 0 20px;
  height: 44px;
  gap: 8px;
  background: var(--bg);
  transition: box-shadow .2s, border-color .2s;
}
.search-box-home:hover,
.search-box-home:focus-within {
  box-shadow: 0 1px 6px var(--search-shadow);
  border-color: transparent;
}
.search-box-home input {
  flex: 1; border: none; outline: none;
  font-size: 16px; font-weight: 400;
  font-family: 'Roboto', arial, sans-serif;
  color: var(--text);
  background: transparent;
}
.search-box-home .btn-clear {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px; line-height: 1;
  padding: 4px; display: none;
}
.search-box-home input:not(:placeholder-shown) ~ .btn-clear { display: block; }
.search-box-home .btn-search { background: none; border: none; cursor: pointer; padding: 4px 6px; }
.search-box-home .btn-search svg { width: 20px; height: 20px; fill: #4285F4; }
.search-box-home .btn-mic,
.search-box-home .btn-lens {
  background: none; border: none; cursor: pointer;
  padding: 4px 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  transition: background .15s;
}
.search-box-home .btn-mic:hover,
.search-box-home .btn-lens:hover { background: var(--btn-hover); }
.search-box-home .btn-mic svg,
.search-box-home .btn-lens svg { width: 22px; height: 22px; }

.home-btns { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; justify-content: center; }
.home-btns button {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 4px; color: var(--text);
  cursor: pointer; font-size: 14px; font-weight: 500;
  padding: 9px 16px; font-family: 'Roboto', arial, sans-serif;
  transition: background .15s, border-color .15s;
  letter-spacing: .01em;
}
.home-btns button:hover { border-color: var(--badge-border); background: var(--btn-hover); }

.theme-toggle-home {
  position: fixed; top: 16px; right: 20px;
  background: var(--btn-bg); border: 1px solid var(--search-border);
  border-radius: 20px; padding: 6px 14px;
  cursor: pointer; font-size: 13px; color: var(--text);
  display: flex; align-items: center; gap: 6px;
  transition: background .2s;
}
.theme-toggle-home:hover { background: var(--btn-hover); }

.home-footer {
  position: fixed; bottom: 0; width: 100%;
  background: var(--footer-bg);
  border-top: 1px solid var(--footer-border);
  transition: background .2s;
}
.home-footer-inner {
  display: flex; justify-content: space-between;
  padding: 14px 24px; font-size: 13px; color: var(--text-muted);
}
.home-footer a { color: var(--text-muted); text-decoration: none; padding: 0 12px; }
.home-footer a:hover { text-decoration: underline; }

/* =============================================
   RESULT PAGE
   ============================================= */
#result-page { display: none; flex-direction: column; min-height: 100vh; background: var(--bg); }

/* Header */
.result-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  transition: background .2s;
}

.header-top {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) auto;
  align-items: center;
  padding: 16px 60px;
  column-gap: 0;
}
.header-top .logo-small-img {
  height: 42px;
  max-width: 180px;
  justify-self: end;
  margin-right: 24px;
}
.header-top .autocomplete-wrap-result {
  justify-self: start;
  width: 100%;
}

/* .logo-small replaced by .logo-small-img */

/* Desktop: fixed-width search box; mobile override below */
.search-box-result {
  display: flex; align-items: center;
  width: 100%;
  border: 1px solid var(--search-border);
  border-radius: 24px;
  padding: 0 8px 0 20px;
  height: 44px; gap: 4px;
  background: var(--bg);
  transition: box-shadow .2s;
}
.search-box-result:hover,
.search-box-result:focus-within {
  box-shadow: 0 1px 6px var(--search-shadow);
  border-color: transparent;
}
.search-box-result input {
  flex: 1; border: none; outline: none;
  font-size: 16px; font-weight: 400;
  font-family: 'Roboto', arial, sans-serif;
  color: var(--text); background: transparent;
}
.search-box-result .btn-search { background: none; border: none; cursor: pointer; padding: 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background .15s; color: #4285F4; }
.search-box-result .btn-search:hover { background: var(--btn-hover); }
.search-box-result .btn-search svg { width: 20px; height: 20px; fill: currentColor; }
[data-theme="dark"] .search-box-result .btn-search { color: #8ab4f8; }

.search-box-result .btn-clear-result,
.search-box-result .btn-mic-result,
.search-box-result .btn-lens-result {
  background: none; border: none; cursor: pointer;
  padding: 8px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.search-box-result .btn-clear-result { display: none; }
.search-box-result input:not(:placeholder-shown) ~ .btn-clear-result { display: flex; }
.search-box-result input:placeholder-shown ~ .search-divider:first-of-type { display: none; }
.search-box-result .btn-clear-result:hover,
.search-box-result .btn-mic-result:hover,
.search-box-result .btn-lens-result:hover {
  background: var(--btn-hover);
  color: var(--text);
}
.search-box-result .btn-clear-result svg { width: 18px; height: 18px; fill: currentColor; }
.search-box-result .btn-mic-result svg,
.search-box-result .btn-lens-result svg { width: 20px; height: 20px; fill: currentColor; }

.search-divider {
  width: 1px; height: 24px;
  background: var(--search-border);
  flex-shrink: 0;
  margin: 0 4px;
}

/* Dark mode toggle — result header (icon only) */
.theme-toggle-result {
  margin-left: auto;
  background: none; border: 1px solid var(--search-border);
  border-radius: 50%;
  width: 36px; height: 36px;
  cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
  line-height: 1;
}
.theme-toggle-result:hover { background: var(--btn-hover); }

/* Tabs */
.header-tabs {
  padding: 0 0 0 270px;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.header-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 14px 16px;
  border: none; background: none; cursor: pointer;
  font-size: 14px; font-weight: 400;
  font-family: 'Roboto', arial, sans-serif;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .1s, background .1s;
  flex-shrink: 0;
  letter-spacing: 0;
}
.tab-icon-emoji { display: none; }
.tab-btn:hover {
  color: var(--text);
  background: var(--btn-hover);
  border-radius: 4px 4px 0 0;
}
.tab-btn.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
  font-weight: 600;
}
[data-theme="dark"] .tab-btn.active {
  color: #8ab4f8;
  border-bottom-color: #8ab4f8;
}

/* Body */
.result-body { display: flex; padding: 0 0 0 270px; flex: 1; }
.results-container { width: 652px; padding: 20px 0; }

.result-stats { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }

/* =============================================
   Skeleton Loading
   ============================================= */
@keyframes sk-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton-item {
  display: flex; gap: 12px; margin-bottom: 32px;
}
.sk {
  border-radius: 4px;
  background: linear-gradient(90deg, var(--badge-bg) 25%, var(--btn-hover) 50%, var(--badge-bg) 75%);
  background-size: 600px 100%;
  animation: sk-shimmer 1.4s infinite linear;
}
.sk-favicon { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; margin-top: 2px; }
.sk-line    { display: block; }

/* =============================================
   Result item (Google-style)
   ============================================= */
.result-item {
  padding: 0 0 28px 0;
  border-bottom: none;
}
.result-item:last-child { padding-bottom: 16px; }

.result-site-line {
  display: flex; align-items: center;
  gap: 10px; margin-bottom: 6px;
}

.result-favicon {
  width: 20px; height: 20px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  background: var(--favicon-bg);
}
.result-favicon-fb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--favicon-bg);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  color: var(--favicon-color); flex-shrink: 0;
}

.result-site-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.result-site-name {
  font-size: 14px; font-weight: 500;
  font-family: 'Roboto', arial, sans-serif;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-site-url  {
  font-size: 12px; font-weight: 400;
  font-family: 'Roboto', arial, sans-serif;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.result-title {
  font-size: 22px; line-height: 1.3;
  font-family: 'Roboto', arial, sans-serif;
  font-weight: 400;
  color: var(--link); text-decoration: none;
  display: block; margin-bottom: 5px;
}
.result-title:hover { text-decoration: underline; }
.result-title:visited { color: var(--link-visited); }

.result-desc {
  font-size: 14px; font-weight: 400;
  font-family: 'Roboto', arial, sans-serif;
  color: var(--text-desc);
  line-height: 1.58; max-width: 600px;
  /* Google-style: clamp 2 lines + ellipsis */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-meta {
  display: flex; align-items: center;
  gap: 6px; margin-top: 8px; flex-wrap: wrap;
}
.result-rank-badge {
  font-size: 10px; color: var(--text-muted);
  border: 1px solid var(--badge-border);
  border-radius: 3px; padding: 1px 5px;
  opacity: .75;
}
.result-tag          { font-size: 11px; color: var(--text-muted); }
.result-google-badge {
  font-size: 10px; color: var(--text-muted);
  border: 1px solid var(--badge-border);
  border-radius: 3px; padding: 1px 5px;
}
.amp-badge { font-size: 10px; color: #1a73e8; font-weight: 600; vertical-align: middle; }
[data-theme="dark"] .amp-badge { color: #8ab4f8; }
.result-rotation-badge { font-size: 11px; color: #c5221f; }
[data-theme="dark"] .result-rotation-badge { color: #f28b82; }

/* =============================================
   Answer Box (Featured Snippet)
   ============================================= */
.answer-box {
  background: var(--answer-bg);
  border: 1px solid var(--answer-border);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 28px;
}
.answer-box-label  { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.answer-box-title  { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.answer-box-snippet{ font-size: 14px; color: var(--text-desc); line-height: 1.6; }
.answer-box-link   { display: block; margin-top: 10px; font-size: 12px; color: var(--url-color); word-break: break-all; text-decoration: none; }
.answer-box-link:hover { text-decoration: underline; }

/* =============================================
   People Also Ask (PAA)
   ============================================= */
.paa-section { margin: 32px 0; }
.paa-title   { font-size: 18px; font-weight: 400; color: var(--text); margin-bottom: 12px; }

.paa-item { border: 1px solid var(--paa-border); border-radius: 8px; margin-bottom: 6px; overflow: hidden; }

.paa-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: var(--paa-bg); border: none; cursor: pointer;
  padding: 14px 16px; font-size: 14px; font-weight: 500; color: var(--text);
  text-align: left; font-family: inherit; gap: 12px;
  transition: background .15s;
}
.paa-q:hover  { background: var(--btn-hover); }
.paa-arrow    { font-size: 11px; flex-shrink: 0; color: var(--text-muted); }
.paa-a        { padding: 12px 16px; font-size: 14px; color: var(--text-desc); line-height: 1.6; background: var(--bg); }

/* =============================================
   Related Searches
   ============================================= */
.related-section { margin: 32px 0; }
.related-title   { font-size: 18px; font-weight: 400; color: var(--text); margin-bottom: 14px; }
.related-pills   { display: flex; flex-wrap: wrap; gap: 8px; }
.related-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--badge-border);
  border-radius: 20px; padding: 8px 16px;
  font-size: 13px; color: var(--text);
  cursor: pointer; font-family: inherit;
  transition: background .15s, border-color .15s;
}
.related-pill:hover { background: var(--btn-hover); border-color: var(--text-muted); }

/* =============================================
   Pagination (Google-style numbered)
   ============================================= */
.pagination { margin: 32px 0 48px; }
.pagination-inner {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.page-numbers { display: flex; align-items: center; gap: 2px; }
.page-num, .page-nav {
  background: none; border: none;
  font-size: 14px; color: var(--link);
  cursor: pointer; padding: 8px 10px;
  border-radius: 4px;
  font-family: inherit;
  min-width: 32px; text-align: center;
  line-height: 1;
}
.page-num:hover, .page-nav:hover { text-decoration: underline; }
.page-num-active {
  color: var(--text);
  font-weight: 700; cursor: default;
}
.page-num-active:hover { text-decoration: none; }
.page-nav { font-size: 18px; color: var(--link); }

/* =============================================
   3-dots "About this result"
   ============================================= */
.result-site-line { position: relative; }
.result-more {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0; transition: opacity .15s, background .15s;
}
.result-item:hover .result-more { opacity: 1; }
.result-more:hover { background: var(--btn-hover); }
.result-more:focus { opacity: 1; outline: none; }
.result-more svg { width: 16px; height: 16px; fill: currentColor; }

/* Info popup card */
.result-info-card {
  width: 320px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--search-shadow);
  padding: 16px;
  z-index: 500;
  font-family: 'Roboto', arial, sans-serif;
  color: var(--text);
  font-size: 13px;
}
.ric-header {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 12px;
}
.ric-favicon { width: 32px; height: 32px; border-radius: 50%; background: var(--favicon-bg); }
.ric-domain { font-size: 14px; font-weight: 500; }
.ric-sub { font-size: 12px; color: var(--text-muted); }
.ric-close {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.ric-close:hover { background: var(--btn-hover); }
.ric-close svg { width: 18px; height: 18px; fill: currentColor; }
.ric-body p { margin-bottom: 8px; line-height: 1.5; color: var(--text-desc); }
.ric-url { font-size: 12px; color: var(--url-color); word-break: break-all; }
.ric-actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.ric-visit { color: var(--link); text-decoration: none; font-weight: 500; font-size: 13px; }
.ric-visit:hover { text-decoration: underline; }

/* =============================================
   Tools bar (time/region filter)
   ============================================= */
.tools-bar {
  padding: 8px 24px 8px 270px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
}
.tools-wrap { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-dropdown { position: relative; }
.tool-btn {
  background: none; border: 1px solid var(--search-border);
  border-radius: 18px; padding: 6px 12px;
  font-size: 13px; color: var(--text);
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 4px;
  transition: background .15s, border-color .15s;
}
.tool-btn:hover { background: var(--btn-hover); }
.tool-btn.tool-btn-active {
  background: #e8f0fe;
  border-color: #1a73e8;
  color: #1a73e8;
}
[data-theme="dark"] .tool-btn.tool-btn-active {
  background: #1f2a3e;
  border-color: #8ab4f8;
  color: #8ab4f8;
}
.tool-arrow { font-size: 10px; }
.tool-menu {
  position: absolute; top: calc(100% + 4px); left: 0;
  background: var(--ac-bg);
  border: 1px solid var(--search-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--search-shadow);
  min-width: 180px;
  z-index: 100;
  padding: 4px 0;
  overflow: hidden;
}
.tool-menu button {
  width: 100%;
  background: none; border: none; cursor: pointer;
  padding: 8px 14px;
  font-size: 13px; color: var(--text);
  text-align: left; font-family: inherit;
}
.tool-menu button:hover { background: var(--ac-hover); }

/* =============================================
   No result / Footer
   ============================================= */
.no-result { padding: 40px 0; }
.no-result p { margin-bottom: 8px; color: var(--text-desc); }
.no-result a { color: var(--link); }

.result-footer {
  padding: 16px 0 16px 270px;
  border-top: 1px solid var(--border);
  background: var(--footer-bg);
  font-size: 13px; color: var(--text-muted);
  display: flex; gap: 24px;
  transition: background .2s;
}
.result-footer a { color: var(--text-muted); text-decoration: none; }
.result-footer a:hover { text-decoration: underline; }

/* =============================================
   RESPONSIVE — Tablet (≤860px)
   ============================================= */
@media (max-width: 860px) {
  /* Override desktop grid layout */
  .header-top {
    display: flex;
    grid-template-columns: none;
    padding: 10px 14px;
    gap: 12px;
    align-items: center;
  }
  .header-top .logo-small-img {
    height: 32px;
    max-width: 130px;
    justify-self: auto;
    margin-right: 0;
  }
  .header-top .autocomplete-wrap-result {
    flex: 1 1 auto;
    justify-self: auto;
    width: auto;
    max-width: 100%;
    min-width: 0;
  }
  .search-box-result { width: 100%; padding: 0 6px 0 16px; }
  /* Hide mic + lens on tablet/mobile to save space */
  .search-box-result .btn-mic-result,
  .search-box-result .btn-lens-result,
  .search-box-result .search-divider { display: none; }

  .header-tabs { padding: 0 0 0 14px; }
  .tools-bar   { padding: 6px 14px; }
  .tools-bar .tools-wrap { flex-wrap: wrap; gap: 6px; }
  .result-body { padding: 0; }
  .results-container { width: 100%; max-width: 100%; padding: 12px 14px 20px; }
  .result-footer { padding: 12px 14px; flex-wrap: wrap; gap: 12px; }
  .tab-btn { padding: 12px 12px; font-size: 13px; }
}

/* =============================================
   RESPONSIVE — Mobile (≤480px)
   ============================================= */
@media (max-width: 480px) {
  /* Home */
  #home-page { padding-top: 18vh; }
  .logo { letter-spacing: -1px; margin-bottom: 20px; }
  .search-wrap-home { padding: 0 16px; }
  .home-btns { padding: 0 16px; gap: 8px; }
  .home-btns button { font-size: 13px; padding: 8px 12px; }
  .theme-toggle-home { top: 12px; right: 12px; padding: 5px 10px; font-size: 12px; }
  .home-footer-inner { flex-direction: column; align-items: center; gap: 8px; padding: 12px 16px; }

  /* Result header — 2 baris: (logo kiri + toggle kanan) lalu (search) */
  .header-top {
    display: flex;
    grid-template-columns: none;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 12px;
    gap: 0;
    row-gap: 8px;
  }

  .header-top .logo-small-img {
    order: 1;
    height: 28px;
    max-width: 110px;
    margin-right: auto;
    justify-self: auto;
  }

  .theme-toggle-result {
    order: 2;
    margin-left: 0;
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  /* Baris 2: search full width */
  .header-top .autocomplete-wrap-result {
    order: 3;
    flex: 0 0 100%;
    max-width: 100%;
    min-width: 0;
    justify-self: auto;
    width: 100%;
  }
  .search-box-result {
    width: 100%;
    height: 42px;
    padding: 0 4px 0 14px;
  }
  .search-box-result input { font-size: 15px; }
  .search-box-result .btn-search { padding: 6px; }
  .search-box-result .btn-search svg { width: 18px; height: 18px; }

  /* Tabs & tools tighter */
  .header-tabs { padding: 0 0 0 8px; }
  .tab-btn { padding: 11px 10px; font-size: 13px; gap: 3px; letter-spacing: 0; }
  .tools-bar { padding: 6px 12px; }
  .tool-btn { padding: 5px 10px; font-size: 12px; }

  /* Results — tighter mobile spacing */
  .results-container { padding: 12px; }
  .result-item { padding: 0 0 22px 0; }
  .result-title { font-size: 18px; line-height: 1.3; }
  .result-desc { font-size: 13px; line-height: 1.55; }
  .result-stats { font-size: 12px; margin-bottom: 16px; }
  .result-favicon, .result-favicon-fb { width: 18px; height: 18px; }
  .result-site-name { font-size: 13px; }
  .result-site-url  { font-size: 11px; }

  /* Result info popup card needs to stay on screen */
  .result-info-card { width: calc(100vw - 24px); max-width: 320px; }

  /* PAA & related more compact */
  .paa-title, .related-title { font-size: 16px; }
  .paa-q { padding: 12px 14px; font-size: 13px; }
  .related-pill { padding: 7px 12px; font-size: 12px; }

  /* Pagination centered */
  .pagination-inner { justify-content: center; }

  /* Footer */
  .result-footer { padding: 12px 14px; font-size: 12px; }
  .result-footer a { padding: 0; }
}

/* =============================================
   Install App Banner (sticky top)
   ============================================= */
.install-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(90deg, #4285f4 0%, #1a73e8 100%);
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}
.install-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
}
.install-banner-icon img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: block;
}
.install-banner-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
}
.install-banner-text strong { font-weight: 600; }
.install-banner-text span { font-size: 12px; opacity: .9; }
.install-banner-btn {
  background: #fff;
  color: #1a73e8;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 20px;
  text-decoration: none;
  flex-shrink: 0;
  transition: background .15s;
}
.install-banner-btn:hover { background: #f0f4ff; }
.install-banner-close {
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  opacity: .8;
}
.install-banner-close:hover { opacity: 1; }

@media (max-width: 640px) {
  .install-banner-inner { padding: 8px 10px; gap: 10px; }
  .install-banner-text span { display: none; }
  .install-banner-btn { padding: 6px 14px; font-size: 12px; }
}
