
.gsearch-overlay{
  display:none; position:fixed; inset:0; background:rgba(20,24,32,0.45); z-index:var(--z-modal);
  align-items:flex-start; justify-content:center; padding:12vh 16px 16px;
}
.gsearch-overlay.open{ display:flex; }
.gsearch-overlay.closing .gsearch-modal{ animation:modal-fall-out .45s cubic-bezier(.2,.8,.2,1); }
.gsearch-modal{
  width:620px; max-width:100%; max-height:min(62vh, 100%); background:var(--md-color-grey-white);
  border-radius:16px; box-shadow:var(--shadow-modal); display:flex; flex-direction:column;
  overflow:hidden; animation:modal-rise-in .32s cubic-bezier(.2,.8,.2,1);
}
.gsearch-modal > .tpl-lib-header{ flex-shrink:0; }

.gsearch-bar{
  display:flex; align-items:center; gap:10px; padding:16px 18px;
  border-bottom:1px solid var(--ui-border); flex-shrink:0;
}
.gsearch-bar > i{ color:var(--ui-muted); font-size:var(--text-2xl); flex-shrink:0; }
.gsearch-bar input{
  flex:1; min-width:0; border:0; outline:none; background:none; color:var(--ui-text);
  font-family:var(--font-sans); font-size:var(--text-3xl);
}
.gsearch-bar input::placeholder{ color:var(--ui-muted-light); }

.gsearch-results{ flex:1 1 auto; min-height:0; overflow:auto; overscroll-behavior:contain; padding:8px 8px 12px; position:relative; --scroll-fade-inset:12px; }
.gsearch-results.has-scroll:not(.at-scroll-end)::after{
  content:''; position:sticky; display:block; bottom:calc(-1 * var(--scroll-fade-inset, 0px)); left:0; right:0;
  height:48px; margin-top:-48px; pointer-events:none;
  background:linear-gradient(to top, var(--md-color-grey-white) 0%, rgba(255,255,255,0.92) 45%, rgba(255,255,255,0) 100%);
}
html[data-ui-theme="dark"] .gsearch-results.has-scroll:not(.at-scroll-end)::after{
  background:linear-gradient(to top, var(--md-color-grey-white) 0%, rgba(26,31,39,0.92) 45%, rgba(26,31,39,0) 100%);
}
.gsearch-section-label{
  padding:10px 10px 6px; font-size:var(--text-sm); font-weight:var(--font-weight-semibold);
  color:var(--ui-muted); text-transform:uppercase; letter-spacing:.04em;
}
.gsearch-row{
  display:flex; align-items:center; gap:10px; width:100%; padding:8px 10px; border:0;
  border-radius:8px; background:none; cursor:pointer; text-align:left;
  font-family:var(--font-sans); font-size:var(--text-base); color:var(--ui-text);
}
.gsearch-row:hover, .gsearch-row.active{ background:var(--ui-surface-2); }
.gsearch-row-icon{
  width:28px; height:28px; border-radius:8px; flex-shrink:0; display:flex; align-items:center;
  justify-content:center; background:var(--ui-surface-2); color:var(--ui-muted); font-size:var(--text-lg);
}
.gsearch-row:hover .gsearch-row-icon, .gsearch-row.active .gsearch-row-icon{ color:var(--ui-text); }
.gsearch-row-avatar{
  width:28px; height:28px; border-radius:50%; flex-shrink:0; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  background:var(--ui-accent); color:#fff; font-size:var(--text-md);
  font-family:var(--font-display); font-weight:400;
}
.gsearch-row-avatar img{ width:100%; height:100%; object-fit:cover; display:block; }
.gsearch-row-meta .tag{ vertical-align:middle; }
.gsearch-row-label{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gsearch-row-meta{ flex-shrink:0; color:var(--ui-muted); font-size:var(--text-sm); }
.gsearch-empty{ padding:24px 16px; display:flex; flex-direction:column; align-items:center; gap:8px; text-align:center; color:var(--ui-muted); font-size:var(--text-md); }
.gsearch-empty img{ width:120px; height:auto; display:block; }

.gsearch-shortcuts-search{ padding:14px 18px 10px; flex-shrink:0; }
.gsearch-shortcuts-body{ flex:1 1 auto; min-height:0; overflow:auto; overscroll-behavior:contain; padding:0 18px 18px; position:relative; --scroll-fade-inset:18px; }
#shortcutsOverlay{ padding-top:8vh; }
#shortcutsOverlay .gsearch-modal{ width:720px; max-height:100%; }
@media (max-height: 700px){
  .gsearch-overlay{ padding:16px; }
  #shortcutsOverlay{ padding-top:16px; }
}
.gsearch-shortcuts-body.has-scroll:not(.at-scroll-end)::after{
  content:''; position:sticky; display:block; bottom:calc(-1 * var(--scroll-fade-inset, 0px)); left:0; right:0;
  height:48px; margin-top:-48px; pointer-events:none;
  background:linear-gradient(to top, var(--md-color-grey-white) 0%, rgba(255,255,255,0.92) 45%, rgba(255,255,255,0) 100%);
}
html[data-ui-theme="dark"] .gsearch-shortcuts-body.has-scroll:not(.at-scroll-end)::after{
  background:linear-gradient(to top, var(--md-color-grey-white) 0%, rgba(26,31,39,0.92) 45%, rgba(26,31,39,0) 100%);
}
.gsearch-shortcut-group{ padding-top:14px; }
.gsearch-shortcut-group-label{
  font-size:var(--text-sm); font-weight:var(--font-weight-semibold); color:var(--ui-muted);
  text-transform:uppercase; letter-spacing:.04em; padding-bottom:4px;
}
.gsearch-shortcut-row{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:9px 0; border-bottom:1px solid var(--ui-border); font-size:var(--text-base); color:var(--ui-text);
}
.gsearch-shortcut-keys{ display:flex; align-items:center; gap:4px; flex-shrink:0; color:var(--ui-muted); font-size:var(--text-sm); }
.gsearch-shortcut-keys kbd{
  display:inline-flex; align-items:center; justify-content:center;
  height:24px; min-width:24px; padding:0 7px; box-sizing:border-box; line-height:1;
  font-family:var(--font-sans); font-size:var(--text-sm); color:var(--ui-text);
  background:var(--ui-surface-2); border:1px solid var(--ui-border); border-radius:6px;
}
.gsearch-shortcut-keys kbd.is-arrow{ width:24px; padding:0; font-size:var(--text-base); }

@media (max-width: 767px){
  .gsearch-overlay{ padding:8vh 8px 8px; }
  .gsearch-modal{ max-height:min(84vh, 100%); }
  .gsearch-bar input{ font-size:var(--text-2xl); }
}
