/* ==========================================================================
   Aevy shell: modern header (single search icon), icon-only account area,
   modern bottom tab bar, and the Settings / signed-out profile cards.
   Loaded after every other stylesheet, so it wins over the older layered rules.
   ========================================================================== */

/* ---------- header actions ---------- */
.site-header .bar-actions { gap: 4px; align-items: center; }
.site-header .icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--text); cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.site-header .icon-btn:hover { background: var(--surface3); }
.site-header .icon-btn:active { transform: scale(.92); }
.site-header .icon-btn svg,
.hd-search svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.site-header .icon-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-text); }
.hd-search { order: 1; }
.site-header .bar-actions #dmTop, .site-header .bar-actions #msgBtn { order: 2; }
#userSlot { order: 4; }
.site-header .bar-actions .pub-top { order: 3; }

/* avatar-only account button */
.uslot .uc-av { padding: 2px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--line2); transition: box-shadow .18s var(--ease), transform .18s var(--ease); }
.uslot .uc-av:hover { background: none; box-shadow: 0 0 0 2px var(--accent-hi); }
.uslot .uc-av:active { transform: scale(.94); }
.uslot .uc-av .avatar { display: block; }

/* ---------- search: one icon, opens a bar over the header ---------- */
.site-header .dev-search {
  position: absolute; inset: 0; z-index: 6; margin: 0; width: auto; max-width: none; min-width: 0; height: auto; flex: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 max(14px, calc((100% - 1600px) / 2 + 24px));
  border: 0; border-radius: 0; box-shadow: none; overflow: visible;
  background: var(--bg);
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .18s var(--ease), transform .22s var(--ease);
}
.site-header .dev-search[hidden] { display: none !important; }
.site-header .dev-search.open { opacity: 1; transform: none; pointer-events: auto; }
.site-header .dev-search:focus-within { box-shadow: none; border: 0; }
.site-header .dev-search .ds-pill { position: relative; flex: 1 1 auto; min-width: 0; max-width: 680px; display: flex; align-items: center; }
.site-header .dev-search input {
  display: block !important; flex: 1 1 auto; width: 100%; min-width: 0; height: 42px; padding: 0 44px 0 44px;
  border: 1px solid var(--line2); border-radius: 999px; background: var(--surface2); color: var(--text);
  font: 16px/1 var(--sans); outline: 0; -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.site-header .dev-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.site-header .dev-search input:focus { border-color: var(--accent-hi); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.site-header .dev-search .ds-ico {
  position: absolute; left: 15px; top: 50%; width: 19px; height: 19px; margin-top: -9.5px;
  fill: none; stroke: var(--muted); stroke-width: 1.9; stroke-linecap: round; pointer-events: none;
}
.site-header .dev-search .ds-back,
.site-header .dev-search .ds-clear {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--text); cursor: pointer;
}
.site-header .dev-search .ds-back:hover, .site-header .dev-search .ds-clear:hover { background: var(--surface3); }
.site-header .dev-search .ds-back svg, .site-header .dev-search .ds-clear svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.site-header .dev-search .ds-clear { position: absolute; right: 5px; top: 50%; margin-top: -16px; width: 32px; height: 32px; background: var(--surface3); }
.site-header .dev-search .ds-clear svg { width: 15px; height: 15px; }
.site-header .dev-search .ds-clear[hidden] { display: none; }
body.search-open .site-header, body.search-open .site-header.hide { transform: none !important; }

/* the sidebar-era rules pinned #theme; it no longer exists */
.site-header .burger { width: 40px; height: 40px; }

/* ---------- bottom tab bar (phones) ---------- */
@media (max-width: 760px) {
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .tabbar {
    grid-template-columns: repeat(5, 1fr);
    height: calc(64px + env(safe-area-inset-bottom, 0px)); padding: 6px 4px env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
    border-top: 1px solid var(--line2);
    box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, .35);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); min-width: 0; -webkit-tap-highlight-color: transparent;
    transition: color .2s var(--ease);
  }
  .tabbar a > svg {
    box-sizing: content-box; width: 24px; height: 24px; padding: 4px 12px; border-radius: 999px;
    fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
    transition: background .22s var(--ease), transform .22s var(--ease), stroke-width .2s;
  }
  .tabbar a > svg .fl { transition: fill-opacity .2s; }
  .tabbar a > b { font-size: 10.5px; line-height: 1; font-weight: 600; letter-spacing: .01em; }
  .tabbar a:active > svg { transform: scale(.88); }
  .tabbar a[aria-current="page"] { color: var(--accent-text); }
  .tabbar a[aria-current="page"] > svg { background: var(--accent-soft); stroke-width: 2; }
  .tabbar a[aria-current="page"] > svg .fl { fill: currentColor; fill-opacity: .2; }
  .tabbar a[aria-current="page"][data-route="home"] svg { fill: none; }
  .tabbar a[aria-current="page"] > b { color: var(--text); }

  /* profile photo replaces the icon, keeps the label */
  .tab-av { margin: 2px 0 1px; padding: 1.5px; border: 1.5px solid transparent; border-radius: 50%; }
  .tabbar a[aria-current="page"] .tab-av { border-color: var(--accent-hi); }
  .tabbar .act-dot { top: 4px; right: calc(50% - 20px); }
  .pwa-card { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .site-header .dev-search, .tabbar a > svg { transition: none; }
}

/* desktop top nav: consistent modern icons */
@media (min-width: 1024px) {
  .nav a { display: inline-flex; align-items: center; gap: 8px; }
  .nav .ni { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .nav a[aria-current="page"] .ni { stroke-width: 2; fill: currentColor; fill-opacity: .16; }
}


/* ==========================================================================
   Sign in / Create account: plain, conventional form
   ========================================================================== */
#view-auth, .auth-shell { min-height: calc(100dvh - var(--hdr)); }
.auth-shell { display: block !important; background: var(--bg2); }
.auth-main { display: flex; justify-content: center; align-items: flex-start; padding: clamp(24px, 7vh, 72px) 16px 56px; }
.auth-card { width: min(420px, 100%); padding: 32px 32px 28px; background: var(--surface); border: 1px solid var(--line2); border-radius: 10px; box-shadow: none; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px; font-size: 18px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.auth-h { margin: 0 0 6px; font-size: 1.5rem; line-height: 1.25; font-weight: 650; letter-spacing: -.015em; }
.auth-card .auth-lead { margin: 0 0 22px; max-width: none; color: var(--text2); font-size: 14.5px; line-height: 1.5; }
.auth-card .sub2 { margin: 0 0 18px; font-size: 14px; color: var(--text2); }
.auth-card .seg { display: flex; gap: 22px; padding: 0; margin: 0 0 22px; border: 0; border-bottom: 1px solid var(--line2); border-radius: 0; background: none; }
.auth-card .seg button { height: auto; padding: 0 0 11px; margin-bottom: -1px; border-radius: 0; border-bottom: 2px solid transparent; font-size: 14px; font-weight: 600; color: var(--muted); background: none; box-shadow: none; }
.auth-card .seg button:hover { color: var(--text); }
.auth-card .seg button.on { color: var(--text); background: none; box-shadow: none; border-bottom-color: var(--accent); }
.auth-card .form { gap: 16px; }
.auth-card .l { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.auth-card .l small { font-weight: 400; color: var(--muted); }
.auth-card .field { height: 42px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line3); background: var(--bg); font-size: 15px; }
.auth-card .field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-card .pwrap .field { padding-right: 44px; }
.auth-card .btn-lg { width: 100%; height: 44px; border-radius: 8px; font-size: 15px; font-weight: 600; justify-content: center; }
.auth-card .btn-primary:hover { transform: none; }
.auth-card .rowsb { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 18px; }
.auth-card .linkbtn { font-size: 13px; font-weight: 500; color: var(--accent-text); }
.auth-card .linkbtn:hover { text-decoration: underline; }
.auth-card .hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.auth-card .note { display: block !important; margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.auth-card .note a { color: var(--accent-text); text-decoration: underline; }
@media (max-width: 520px) {
  .auth-main { padding: 0; }
  .auth-card { width: 100%; padding: 26px 20px 32px; border: 0; border-radius: 0; background: var(--bg); min-height: calc(100dvh - var(--hdr)); }
  .auth-shell { background: var(--bg); }
}

/* ==========================================================================
   Settings: section list with a sticky index (collapses to one column on phones)
   ========================================================================== */
.pp-body.is-settings { grid-template-columns: minmax(0, 1fr) !important; }
.pp-body.is-settings .pp-side { display: none; }
.st-page { width: 100%; max-width: 880px; margin: 0 auto; }
.st-top { margin: 0 0 22px; }
.st-top h1 { margin: 0; font-size: 1.5rem; font-weight: 650; letter-spacing: -.015em; }
.st-top p { margin: 6px 0 0; color: var(--text2); font-size: 14px; }
.st-layout { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 36px; align-items: start; }
.st-nav { position: sticky; top: calc(var(--hdr) + 16px); display: grid; gap: 2px; }
.st-nav a { padding: 8px 12px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--text2); }
.st-nav a:hover { background: var(--surface3); color: var(--text); }
.st-body { display: grid; gap: 34px; min-width: 0; }
.st-sec { scroll-margin-top: calc(var(--hdr) + 16px); }
.st-h { margin-bottom: 12px; }
.st-h h3 { margin: 0; font-size: 1rem; font-weight: 650; }
.st-h p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--text2); }
.st-card { background: var(--surface); border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; min-height: 64px; }
.st-row + .st-row, .st-form + .st-row { border-top: 1px solid var(--line); }
.st-l { min-width: 0; }
.st-l b { display: block; font-size: 14.5px; font-weight: 600; color: var(--text); }
.st-l span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--text2); overflow-wrap: anywhere; }
.st-r { flex: none; }
a.st-link { color: var(--text); }
a.st-link:hover { background: var(--surface2); }
.st-go { color: var(--muted); font-size: 22px; line-height: 1; }
.st-form { display: grid; gap: 14px; padding: 18px 20px; }
.st-f label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.st-f .field { height: 40px; max-width: 360px; border-radius: 8px; }
.st-f small { display: block; margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.st-form .ferr:empty { display: none; }
.st-sw { position: relative; display: inline-block; width: 44px; height: 24px; }
.st-sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.st-sw i { position: absolute; inset: 0; border-radius: 999px; background: var(--line3); transition: background .18s; }
.st-sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .18s var(--ease); }
.st-sw input:checked + i { background: var(--accent); }
.st-sw input:checked + i::after { transform: translateX(20px); }
.st-sw input:focus-visible + i { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.st-danger .st-h h3 { color: var(--danger); }
.st-danger .st-card { border-color: color-mix(in srgb, var(--danger) 35%, var(--line2)); }
.st-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; padding: 14px 18px; border: 1px solid var(--line2); border-radius: 10px; background: var(--surface); }
.st-notice b { display: block; font-size: 14.5px; }
.st-notice span { display: block; margin-top: 2px; font-size: 13px; color: var(--text2); }
.st-na { display: flex; gap: 8px; }
.pp-out { max-width: 880px; padding-top: 28px; }
@media (max-width: 760px) {
  .st-layout { grid-template-columns: 1fr; gap: 0; }
  .st-nav { display: none; }
  .st-body { gap: 28px; }
  .st-row { padding: 14px 16px; }
  .st-form { padding: 16px; }
  .st-f .field { max-width: none; }
}
.auth-card .hint:empty { display: none; }

/* ==========================================================================
   Scripts page: compact header, toolbar and animated script cards
   ========================================================================== */
#view-scripts .page-head { padding: 28px 0 22px; background: none; border-bottom: 1px solid var(--line); }
#view-scripts .page-head .wrap, #view-scripts > .wrap { width: min(1200px, calc(100% - 48px)); }
.sc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
#view-scripts .page-head h1 { margin: 0; font-size: 1.75rem; font-weight: 650; letter-spacing: -.02em; }
#view-scripts .page-head p:last-child { display: block; margin: 6px 0 0; max-width: 52ch; font-size: 14.5px; color: var(--text2); }
.sc-count { flex: none; padding: 5px 12px; border: 1px solid var(--line2); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text2); font-variant-numeric: tabular-nums; }
.sc-count:empty { display: none; }

#view-scripts > .wrap { padding-top: 22px; }
#view-scripts .tools { gap: 10px; margin-bottom: 14px; padding: 0; }
#view-scripts .search-wrap { flex: 1 1 280px; max-width: 420px; }
#view-scripts .field.search { height: 42px; padding-left: 38px; border-radius: 8px; border: 1px solid var(--line3); background: var(--surface); }
#view-scripts .field.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#view-scripts .field.sel { height: 42px; border-radius: 8px; border: 1px solid var(--line3); background-color: var(--surface); }
#view-scripts .tools .btn { height: 42px; border-radius: 8px; }
#view-scripts .chips { gap: 8px; margin-bottom: 18px; padding-bottom: 4px; }
#view-scripts .chip { height: 32px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 999px; background: var(--surface); color: var(--text2); font-size: 13px; font-weight: 600; transition: background .18s, color .18s, border-color .18s, transform .18s var(--ease); }
#view-scripts .chip:hover { border-color: var(--line3); color: var(--text); }
#view-scripts .chip:active { transform: scale(.96); }
#view-scripts .chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-text); }

#view-scripts #cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; max-width: none; margin: 0; padding: 0 0 72px; }

.sc {
  --lc: var(--accent);
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 18px 18px 14px;
  background: var(--surface); border: 1px solid var(--line2); border-radius: 12px; cursor: pointer; overflow: hidden;
  outline: none; -webkit-tap-highlight-color: transparent;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .2s;
  animation: scIn .55s var(--ease) both; animation-delay: calc(min(var(--i, 0), 11) * 55ms);
}
.sc.sc-still { animation: none; }
.sc::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--lc); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.sc:hover, .sc:focus-visible { transform: translateY(-4px); border-color: color-mix(in srgb, var(--lc) 55%, var(--line2)); box-shadow: 0 18px 34px -22px rgba(15, 23, 42, .45), 0 2px 6px rgba(15, 23, 42, .06); }
.sc:hover::before, .sc:focus-visible::before { transform: scaleX(1); }
.sc:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.sc:active { transform: translateY(-1px) scale(.995); transition-duration: .1s; }
@keyframes scIn { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }

.sc-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.sc-lang { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; color: var(--text); }
.sc-lang i { width: 9px; height: 9px; border-radius: 50%; background: var(--lc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lc) 22%, transparent); }
.sc-vis { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--surface3); color: var(--text2); font-weight: 600; font-size: 11.5px; }
.sc-vis svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sc-ago { margin-left: auto; color: var(--muted); }
.sc-title { margin: 2px 0 0; font-size: 1.05rem; font-weight: 650; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-desc { margin: 0; min-height: 2.9em; font-size: 13.5px; line-height: 1.45; color: var(--text2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-desc em { color: var(--muted); font-style: normal; }

.sc-code, .sc-bin { position: relative; height: 112px; margin-top: 2px; border-radius: 8px; background: #0f1218; overflow: hidden; }
.sc-code { padding: 12px 0; counter-reset: ln; font: 12px/1.65 var(--mono); color: #c3cad6; }
.sc-code span { display: block; padding-right: 12px; white-space: pre; overflow: hidden; text-overflow: clip; transition: transform .45s var(--ease); }
.sc-code span::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 34px; margin-right: 12px; text-align: right; color: #566071; }
.sc-code::after { content: ""; position: absolute; inset: auto 0 0 0; height: 44px; background: linear-gradient(transparent, #0f1218); pointer-events: none; }
.sc:hover .sc-code span { transform: translateX(-4px); }
.sc-bin { display: flex; align-items: center; gap: 12px; padding: 0 16px; color: #c3cad6; }
.sc-bin svg { flex: none; width: 28px; height: 28px; fill: none; stroke: #8b95a7; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sc-bin b { display: block; font: 600 13px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-bin small { color: #7d8797; font-size: 12px; }
.sc-bin > span { min-width: 0; }

.sc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-tags span { padding: 2px 9px; border-radius: 6px; background: var(--surface3); color: var(--text2); font-size: 12px; font-weight: 500; }
.sc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.sc-by { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; font-weight: 550; color: var(--text2); }
.sc-by > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-meta { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.sc-meta svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sc-like { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px; border-radius: 8px; font-size: 12.5px; color: var(--text2); }
.sc-like .pc { font-weight: 600; font-variant-numeric: tabular-nums; }
.sc-like .pc:empty { display: none; }
.sc-like:hover { background: var(--surface3); color: #ff4f74; }
.sc-like.on { color: #ff4f74; }
.sc-like.on svg { fill: currentColor; animation: scPop .45s var(--ease); }
@keyframes scPop { 0% { transform: scale(.6); } 55% { transform: scale(1.35); } 100% { transform: scale(1); } }
.sc-rate, .sc-size { display: inline-flex; align-items: center; gap: 3px; padding: 0 6px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sc-rate svg { width: 14px; height: 14px; fill: #e6a700; stroke: #e6a700; }
.sc-ic { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--text2); cursor: pointer; transition: background .15s, color .15s, transform .15s var(--ease); }
.sc-ic:hover { background: var(--surface3); color: var(--text); }
.sc-ic:active { transform: scale(.88); }
.sc-dl { color: var(--accent-text); }
.sc-dl:hover { background: var(--accent-soft); color: var(--accent-text); }

@media (max-width: 760px) {
  #view-scripts .page-head { padding: 16px 0 14px; }
  #view-scripts .page-head .wrap, #view-scripts > .wrap { width: calc(100% - 28px); }
  #view-scripts .page-head h1 { font-size: 1.35rem; }
  #view-scripts .page-head p:last-child { font-size: 13.5px; }
  #view-scripts > .wrap { padding-top: 14px; }
  #view-scripts .tools { padding: 0; }
  #view-scripts .chips { padding-inline: 0; margin-inline: -14px; padding-left: 14px; padding-right: 14px; }
  #view-scripts #cards { grid-template-columns: 1fr; gap: 12px; margin: 0; padding-bottom: 24px; }
  .sc { padding: 16px 16px 12px; }
  .sc-size { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sc, .sc::before, .sc-code span { animation: none !important; transition: none !important; }
}
@media (max-width: 760px) {
  #view-scripts .page-head p:last-child { display: none; }
  #view-scripts .page-head .sc-head { align-items: center; }
  #view-scripts .tools { display: grid; grid-template-columns: 1fr; gap: 10px; }
  #view-scripts .tools .search-wrap { max-width: none; }
  #view-scripts .tools .btn-primary, #view-scripts .tools .spacer { display: none; }
}

/* ==========================================================================
   Scripts page v2: no in-page search (header search icon does it), mobile-first toolbar
   ========================================================================== */
#q { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#view-scripts .sc-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
#view-scripts .sc-tools .sc-count { padding: 0; border: 0; font-size: 14px; font-weight: 600; color: var(--text2); }
#view-scripts .sc-sort { display: block; }
#view-scripts .sc-sort .field.sel { width: auto; min-width: 170px; }

@media (max-width: 760px) {
  #view-scripts .page-head { padding: 14px 0 12px; border-bottom: 0; }
  #view-scripts .page-head h1 { font-size: 1.4rem; }
  #view-scripts > .wrap { padding-top: 0; }
  #view-scripts .sc-tools { display: flex; position: static; margin-bottom: 10px; }
  #view-scripts .sc-tools .spacer { display: block; flex: 1; }
  #view-scripts .sc-tools .btn-primary { display: none; }
  #view-scripts .sc-sort .field.sel { height: 36px; min-width: 0; padding: 0 30px 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
  /* both filter rows: single scrolling line, edge to edge, with a soft fade on the right */
  #view-scripts .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 8px; padding: 2px 14px 4px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  #view-scripts .chips::-webkit-scrollbar { display: none; }
  #view-scripts .chip { flex: none; height: 34px; scroll-snap-align: start; }
  #view-scripts #catChips { margin: 0 -14px 4px; }
  #view-scripts #chips { margin: 0 -14px 14px; }
  #view-scripts #chips .chip { height: 30px; font-size: 12.5px; }
  /* cards: tighter and with comfortable touch targets */
  #view-scripts #cards { gap: 12px; }
  .sc { padding: 14px 14px 10px; gap: 8px; border-radius: 14px; content-visibility: auto; contain-intrinsic-size: auto 330px; }
  .sc:hover { transform: none; box-shadow: none; }
  .sc:active { transform: scale(.985); }
  .sc-title { font-size: 1rem; }
  .sc-desc { min-height: 0; font-size: 13.5px; }
  .sc-code, .sc-bin { height: 92px; }
  .sc-code { padding: 10px 0; font-size: 11.5px; }
  .sc-foot { padding-top: 8px; }
  .sc-like { height: 40px; padding: 0 10px; }
  .sc-ic { width: 40px; height: 40px; }
  .sc-rate { display: none; }
}
