/* Modern AI Top Search v1.2 - compact fixed top, auto-hide on scroll down, show on scroll up */
#matsp-fixed-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  display: flex;
  justify-content: center;
  pointer-events: auto;
  transition: transform .2s ease, opacity .18s ease;
  will-change: transform, opacity;
  backdrop-filter: blur(6px);
}

.matsp-panel {
  width: 100%;
  max-width: 1100px;
  margin: 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(11,18,32,0.04);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  box-shadow: 0 6px 26px rgba(7,22,30,0.06);
}

.matsp-input {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid rgba(11,18,32,0.04);
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.03);
}
.matsp-input input {
  border: none;
  outline: none;
  background: transparent;
  color: #071421;
  font-size: 15px;
  width: 100%;
  font-weight: 600;
}
.matsp-input input::placeholder { color:#6b7280; font-weight:500; }

.matsp-btn {
  background: linear-gradient(90deg,#34a853,#1a73e8);
  color:#fff;
  border:none;
  padding:8px 12px;
  border-radius:999px;
  font-weight:700;
  cursor:pointer;
  box-shadow: 0 6px 18px rgba(26,115,232,0.08);
}

/* close and show */
#matsp-close { background:transparent; border:none; font-size:16px; width:36px; height:36px; border-radius:999px; cursor:pointer; }
#matsp-show { position: fixed; right: 12px; top: 12px; display:none; z-index:999999; background: linear-gradient(90deg,#34a853,#1a73e8); color:#fff; padding:8px 12px; border-radius:999px; box-shadow:0 8px 24px rgba(7,22,30,0.12); }

/* results */
#matsp-results {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, calc(100% - 32px));
  max-height: 66vh;
  overflow:auto;
  z-index: 99998;
  padding:14px;
  border-radius:10px;
  background:#fff;
  box-shadow: 0 18px 60px rgba(10,20,30,0.06);
  display:none;
}

.matsp-ai-badge{ display:inline-block; background:linear-gradient(90deg,#34a853,#1a73e8); color:#fff; padding:6px 10px; border-radius:999px; font-weight:700; margin-bottom:8px; font-size:13px; }
.matsp-ai-answer{ color:#0b1220; font-size:14px; line-height:1.6; white-space:pre-wrap; margin-bottom:10px; }

.matsp-article{ display:flex; gap:12px; align-items:flex-start; padding:10px; border-radius:8px; border:1px solid #eef2f5; margin-bottom:10px; text-decoration:none; color:inherit; }
.matsp-thumb{ width:86px; height:60px; border-radius:8px; object-fit:cover; background:#f2f4f6; }
.matsp-title{ font-weight:800; color:#0b3b3b; margin-bottom:6px; }
.matsp-meta{ color:#6b7280; font-size:12px; margin-bottom:6px; }

/* auto-hide helpers */
.matsp-hidden-up { transform: translateY(-120%); opacity:0; pointer-events:none; }
.matsp-minimized { transform: translateY(-65%); opacity:0.6; }

@media (max-width:720px){
  .matsp-panel{ margin:6px; padding:6px 8px; }
  #matsp-results{ top: 56px; left: 8px; transform:none; width: calc(100% - 16px); }
}
