/* ============================================================
   SPIRIT v2 — Full search engine for the Spark ecosystem
   ============================================================ */

:root {
  --bg: #0a0a0f;
  --bg-2: #10101a;
  --bg-3: #161622;
  --surface: #12121c;
  --surface-hi: #1a1a28;
  --text: #ffffff;
  --text-2: #a9a9c0;
  --text-3: #6a6a85;
  --text-link: #b197fc;
  --text-link-visited: #d0bfff;
  --accent: #845ef7;
  --accent-2: #da77f2;
  --accent-3: #5d4af5;
  --accent-glow: rgba(132, 94, 247, 0.35);
  --green: #51cf66;
  --yellow: #ffd43b;
  --red: #ff6b6b;
  --border: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 28px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: 'Tektur', system-ui, sans-serif;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --max-serp: 980px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*, *::before, *::after { font-family: var(--font-body); }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body {
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(132,94,247,0.14), transparent 70%),
    radial-gradient(800px 450px at -10% 40%, rgba(218,119,242,0.08), transparent 70%),
    var(--bg);
}
body[data-view="serp"] .orb { opacity: 0.25; }

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; color: inherit; border: none; background: none; }
input, button { font-family: var(--font-body); }

/* ============================================================
   Ambient backdrop
   ============================================================ */
.grid-bg {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 75%);
  pointer-events: none;
  z-index: -2;
}
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.55;
  transition: opacity .4s ease;
}
.orb-a { top: -140px; left: -80px;  width: 460px; height: 460px; background: radial-gradient(circle, rgba(132,94,247,0.6) 0%, transparent 70%); animation: float1 16s ease-in-out infinite; }
.orb-b { right: -140px; top: 18%;   width: 540px; height: 540px; background: radial-gradient(circle, rgba(218,119,242,0.45) 0%, transparent 70%); animation: float2 20s ease-in-out infinite; }
.orb-c { bottom: -180px; left: 22%; width: 580px; height: 580px; background: radial-gradient(circle, rgba(93,74,245,0.35) 0%, transparent 70%); animation: float3 24s ease-in-out infinite; }

@keyframes float1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(60px,40px); } }
@keyframes float2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-60px,60px); } }
@keyframes float3 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(40px,-40px); } }

/* ============================================================
   Shared logo
   ============================================================ */
.logo, .serp-brand, .modal-logo {
  font-family: var(--font);
  font-weight: 900;
  letter-spacing: -0.02em;
  user-select: none;
}
.logo { font-size: clamp(64px, 13vw, 118px); line-height: 1; display: inline-flex; }
.modal-logo { font-size: 46px; margin-bottom: 14px; display: inline-flex; }
.serp-brand { font-size: 28px; display: inline-flex; }

.logo-s { color: #845ef7; }
.logo-p { color: #9775fa; }
.logo-i { color: #ff8cc8; }
.logo-r { color: #da77f2; }
.logo-i2{ color: #f783ac; }
.logo-t { color: #fab005; }

/* ============================================================
   HOME VIEW
   ============================================================ */
.home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.home-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  font-size: 13px;
}
.home-back {
  color: var(--text-2);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  transition: color .2s;
}
.home-back:hover { color: var(--text); }

.home-top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.home-top-link {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-2);
  font-weight: 500;
  transition: all .2s;
}
.home-top-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.home-top-auth {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-2);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  transition: all .2s;
  margin-left: 6px;
}
.home-top-auth:hover { background: rgba(255,255,255,0.1); color: var(--text); transform: scale(1.05); }
.home-top-auth img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.home-core {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 60px;
  text-align: center;
}

.logo-tag {
  margin-top: 8px;
  margin-bottom: 38px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
}

.hsearch {
  width: 100%;
  max-width: 620px;
  position: relative;
}

.hsearch-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 4px 22px;
  background: linear-gradient(180deg, rgba(26,26,40,0.9), rgba(18,18,28,0.9));
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.5),
    0 0 0 1px rgba(132,94,247,0.08),
    inset 0 1px 0 rgba(255,255,255,0.04);
  transition: all .25s var(--ease);
  position: relative;
}
.hsearch-box:focus-within {
  border-color: rgba(132,94,247,0.45);
  box-shadow:
    0 25px 70px rgba(0,0,0,0.5),
    0 0 0 4px rgba(132,94,247,0.15),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.hsearch-icon { color: var(--text-3); flex-shrink: 0; }
.hsearch-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
  padding: 16px 0;
  min-width: 0;
  font-family: var(--font-body);
}
.hsearch-input::placeholder { color: var(--text-3); }
.hsearch-input::-webkit-search-cancel-button { display: none; }

.hsearch-mic {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  color: var(--text-3);
  transition: all .15s;
}
.hsearch-mic:hover { background: rgba(255,255,255,0.06); color: var(--text); }

.hbtns {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
}
.hbtn {
  padding: 12px 24px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.03em;
  transition: all .2s var(--ease);
  box-shadow: 0 10px 24px rgba(132,94,247,0.4);
}
.hbtn:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(132,94,247,0.55); }
.hbtn:active { transform: translateY(0); }
.hbtn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid var(--border-hi);
  box-shadow: none;
}
.hbtn-ghost:hover { background: rgba(255,255,255,0.08); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }

.home-bullets {
  margin-top: 30px;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.dot-green { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulseGreen 1.6s ease-in-out infinite; }
@keyframes pulseGreen { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.home-foot {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  background: rgba(10,10,15,0.6);
  backdrop-filter: blur(10px);
  font-size: 12px;
  color: var(--text-3);
}
.home-foot-row { display: flex; gap: 22px; padding: 6px 0; flex-wrap: wrap; }
.home-foot-row a { color: var(--text-2); transition: color .2s; }
.home-foot-row a:hover { color: var(--text); }

/* ============================================================
   Suggestions dropdown
   ============================================================ */
.suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(26,26,40,0.98), rgba(18,18,28,0.98));
  border: 1px solid var(--border-hi);
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  list-style: none;
  z-index: 30;
  max-height: 360px;
  overflow-y: auto;
}
.suggest li {
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s;
}
.suggest li:hover, .suggest li.is-active {
  background: rgba(132,94,247,0.12);
  color: var(--text);
}
.suggest li svg { color: var(--text-3); flex-shrink: 0; }
.suggest li .s-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest li .s-hint { font-size: 11px; color: var(--text-3); letter-spacing: 0.1em; text-transform: uppercase; }

/* ============================================================
   SERP VIEW
   ============================================================ */
.serp { min-height: 100vh; }

.serp-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 14px 28px 10px;
  background: rgba(10,10,15,0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.serp-brand { flex-shrink: 0; cursor: pointer; }

.serp-form {
  max-width: 620px;
  width: 100%;
  justify-self: start;
  margin-left: 6px;
  position: relative;
}
.serp-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 18px;
  background: rgba(26,26,40,0.8);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  transition: all .2s;
  position: relative;
}
.serp-box:focus-within {
  border-color: rgba(132,94,247,0.5);
  box-shadow: 0 0 0 4px rgba(132,94,247,0.12);
  background: rgba(26,26,40,1);
}
.serp-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  padding: 10px 0;
  min-width: 0;
}
.serp-input::-webkit-search-cancel-button { display: none; }
.serp-clear {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-3);
  transition: all .15s;
}
.serp-clear:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.serp-go {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  transition: all .2s;
}
.serp-go:hover { transform: scale(1.05); box-shadow: 0 6px 16px rgba(132,94,247,0.5); }

.serp-auth {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-2);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  transition: all .2s;
}
.serp-auth:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.serp-auth img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* Tabs */
.serp-tabs {
  display: flex;
  gap: 2px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 75px;
  z-index: 30;
  background: rgba(10,10,15,0.82);
  backdrop-filter: blur(16px);
}
.serp-tabs::-webkit-scrollbar { display: none; }
.serp-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  white-space: nowrap;
  transition: color .2s;
}
.serp-tab:hover { color: var(--text-2); }
.serp-tab.is-active { color: var(--text); }
.serp-tab.is-active::after {
  content: '';
  position: absolute;
  left: 16px; right: 16px; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px 2px 0 0;
}

.serp-stats {
  padding: 14px 28px 4px;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.serp-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 40px;
  padding: 10px 28px 60px;
  max-width: 1240px;
  margin: 0 auto;
  align-items: start;
}
.serp-col { min-width: 0; }
.serp-side { position: sticky; top: 130px; }
@media (max-width: 980px) {
  .serp-main { grid-template-columns: 1fr; }
  .serp-side { position: static; }
}

/* ============================================================
   Result items — web list
   ============================================================ */
.res {
  padding: 14px 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  opacity: 0;
  transform: translateY(6px);
  animation: resIn .35s var(--ease) forwards;
}
@keyframes resIn { to { opacity: 1; transform: translateY(0); } }

.res-url {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 4px;
}
.res-favicon {
  width: 18px; height: 18px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-2);
  overflow: hidden;
}
.res-favicon img { width: 14px; height: 14px; }
.res-domain { color: var(--text-2); }
.res-path { color: var(--text-3); }

.res-title {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--text-link);
  margin-bottom: 4px;
  display: inline-block;
  transition: color .15s;
}
.res-title:hover { text-decoration: underline; text-decoration-color: var(--accent-2); text-underline-offset: 3px; }
.res-title:visited { color: var(--text-link-visited); }

.res-snippet {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.55;
}
.res-snippet em { color: var(--text); font-style: normal; font-weight: 700; }

.res-badges {
  display: inline-flex;
  gap: 6px;
  margin-left: 8px;
  vertical-align: middle;
}
.res-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text-2);
}
.res-tag.res-tag-music { background: rgba(132,94,247,0.18); color: var(--accent-2); }
.res-tag.res-tag-anime { background: rgba(255,140,80,0.18); color: #ffa55c; }
.res-tag.res-tag-spark { background: rgba(81,207,102,0.18); color: var(--green); }
.res-tag.res-tag-news  { background: rgba(255,204,0,0.18); color: var(--yellow); }

/* Loading shimmer rows */
.shimmer-row {
  height: 82px;
  border-radius: 10px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  background-size: 400% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0%; } 100% { background-position: -200% 0%; } }

/* ============================================================
   Knowledge panel (sidebar)
   ============================================================ */
.kp {
  background: linear-gradient(180deg, rgba(26,26,40,0.8), rgba(18,18,28,0.8));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.kp-hero {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
}
.kp-body { padding: 16px 18px 18px; }
.kp-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; line-height: 1.2; }
.kp-sub   { font-size: 12px; color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 12px; }
.kp-text  { font-size: 14px; color: var(--text-2); line-height: 1.55; }
.kp-source {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.kp-source a { color: var(--text-link); }
.kp-source a:hover { text-decoration: underline; }

/* Side quick ecosystem card */
.kp-eco {
  margin-top: 14px;
  background: linear-gradient(120deg, rgba(132,94,247,0.08), rgba(218,119,242,0.06));
  border: 1px solid rgba(132,94,247,0.2);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.kp-eco h4 { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 8px; }
.kp-eco-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; font-size: 13px; color: var(--text-2); border-top: 1px dashed rgba(255,255,255,0.05); transition: color .15s; }
.kp-eco-row:first-of-type { border-top: 0; }
.kp-eco-row:hover { color: var(--text); }
.kp-eco-row .k-logo { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; font-size: 14px; font-weight: 700; }
.kp-eco-spak   .k-logo { background: linear-gradient(135deg,#845ef7,#da77f2); }
.kp-eco-sunset .k-logo { background: linear-gradient(135deg,#ff9966,#ff5e62); }
.kp-eco-spark  .k-logo { background: linear-gradient(135deg,#51cf66,#339af0); }

/* ============================================================
   Image grid
   ============================================================ */
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.img-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(26,26,40,0.5);
  border: 1px solid var(--border);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transition: all .2s;
  opacity: 0;
  animation: resIn .4s var(--ease) forwards;
}
.img-card:hover { border-color: var(--accent); transform: scale(1.02); box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.img-card img { width: 100%; height: 100%; object-fit: cover; }
.img-card figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 8px 10px 8px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.9));
  font-size: 11px;
  color: #fff;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   Music + anime rich cards
   ============================================================ */
.rich-list { display: grid; gap: 10px; }
.rich-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: rgba(26,26,40,0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all .2s;
  opacity: 0;
  animation: resIn .4s var(--ease) forwards;
}
.rich-item:hover { background: rgba(36,36,54,0.7); border-color: var(--border-hi); transform: translateX(4px); }
.rich-thumb {
  width: 56px; height: 56px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  display: grid; place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 22px;
}
.rich-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rich-body { flex: 1; min-width: 0; }
.rich-title { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rich-meta  { font-size: 12px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rich-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; flex-shrink: 0;
}

/* Empty / error */
.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-3);
}
.empty-big { font-size: 42px; margin-bottom: 10px; opacity: 0.6; }
.empty h3 { font-size: 18px; color: var(--text-2); margin-bottom: 6px; }

/* ============================================================
   Modal (account)
   ============================================================ */
.modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: grid; place-items: center;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative;
  width: min(460px, 92vw);
  padding: 36px 30px 28px;
  background: linear-gradient(180deg, rgba(26,26,40,0.98), rgba(18,18,28,0.98));
  border: 1px solid var(--border-hi);
  border-radius: 24px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
  text-align: center;
  animation: pop .25s var(--ease);
}
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-3);
  transition: all .15s;
}
.modal-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }

.modal-card h2 { font-size: 20px; font-weight: 700; line-height: 1.25; margin-bottom: 6px; }
.modal-card p { font-size: 13px; color: var(--text-2); margin-bottom: 20px; line-height: 1.5; }
.modal-fine { font-size: 11px; color: var(--text-3); margin-top: 14px; }

.modal-avatar { width: 80px; height: 80px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.1); margin: 0 auto 16px; display: block; object-fit: cover; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

.btn-google {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  background: #fff;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all .2s var(--ease);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.btn-google:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,0.35); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-hi);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all .2s var(--ease);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: var(--border-hi); transform: translateY(-1px); }
.btn-ghost.btn-danger:hover { background: rgba(255,107,107,0.1); border-color: rgba(255,107,107,0.3); color: var(--red); }

.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* Auth form */
.auth-form { display: grid; gap: 12px; margin-top: 8px; text-align: left; }
.field { display: grid; gap: 6px; }
.field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(10,10,15,0.6);
  border: 1px solid var(--border-hi);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all .2s var(--ease);
  font-family: var(--font-body);
}
.field input:focus {
  border-color: rgba(132,94,247,0.55);
  box-shadow: 0 0 0 4px rgba(132,94,247,0.15);
  background: rgba(10,10,15,0.85);
}
.field input::placeholder { color: var(--text-3); }

.auth-error {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.3);
  color: var(--red);
  text-align: left;
}

.auth-submit {
  margin-top: 4px;
  padding: 13px 22px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: all .2s var(--ease);
  box-shadow: 0 10px 24px rgba(132,94,247,0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}
.auth-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(132,94,247,0.55); }
.auth-submit:disabled { opacity: 0.6; cursor: wait; }

.auth-submit-spin {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-alt {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-2);
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.auth-switch {
  color: var(--accent-2);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-switch:hover { color: #ff9ae9; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

#googleBtn { margin: 4px auto 0; display: inline-flex; }
#googleBtn[disabled] { opacity: 0.6; cursor: wait; }

.linked-chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.linked-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: rgba(81,207,102,0.1); color: var(--green);
  border: 1px solid rgba(81,207,102,0.25);
}
.linked-chip.is-pending { background: rgba(255,212,59,0.1); color: #ffd43b; border-color: rgba(255,212,59,0.25); }
.linked-chip.is-off { background: rgba(255,255,255,0.04); color: var(--text-3); border-color: var(--border); }
.linked-chip .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ============================================================
   Serp footer
   ============================================================ */
.serp-foot {
  margin-top: 40px;
  padding: 18px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 22px;
  font-size: 12px;
  color: var(--text-3);
  background: rgba(10,10,15,0.6);
  backdrop-filter: blur(10px);
}
.serp-foot a:hover { color: var(--text); }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  background: rgba(26,26,40,0.95);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  opacity: 0;
  transition: all .25s var(--ease);
  z-index: 200;
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.is-error   { border-color: rgba(255,107,107,0.4); color: var(--red); }
.toast.is-success { border-color: rgba(81,207,102,0.4); color: var(--green); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  .home-top { padding: 12px 16px; }
  .home-top-nav { gap: 2px; }
  .home-top-link { display: none; }
  .home-top-auth { margin-left: 0; }
  .hsearch-input { font-size: 16px; padding: 14px 0; }
  .hbtns { margin-top: 22px; }

  .serp-top { grid-template-columns: auto 1fr auto; gap: 10px; padding: 10px 14px; }
  .serp-brand { font-size: 22px; }
  .serp-tabs { padding: 0 12px; top: 68px; }
  .serp-tab { padding: 12px 14px; font-size: 13px; }
  .serp-main { padding: 10px 16px 40px; gap: 24px; }
  .serp-stats { padding: 10px 16px 0; }

  .res-title { font-size: 17px; }
  .res-snippet { font-size: 13.5px; }

  .modal-card { padding: 30px 22px 22px; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
