/* ═══════════════════════════════════════════════════════════════
   Site search — home page (EN / UA / LV / RU)
   Matches both themes: Matrix (default) and White (.ss--light,
   set by js/site-search.js from localStorage "white").
   ═══════════════════════════════════════════════════════════════ */

@property --ss-a {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@property --ss-glow {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.ss {
  /* Matrix theme tokens */
  --ss-accent: #00ff41;
  --ss-accent-rgb: 0, 255, 65;
  --ss-title: #d78a2a;
  --ss-text: #c9c5c2;
  --ss-strong: #eafbea;
  --ss-muted: rgba(201, 197, 194, 0.55);
  --ss-bg: rgba(0, 1, 1, 0.72);
  --ss-panel: rgba(6, 10, 8, 0.9);
  --ss-line: rgba(0, 255, 65, 0.16);
  --ss-hover: rgba(0, 255, 65, 0.07);
  --ss-mark: rgba(0, 255, 65, 0.22);
  --ss-scan: rgba(0, 255, 65, 0.07);
  --ss-shadow: 0 0 0 1px rgba(0, 255, 65, 0.1), 0 24px 60px -18px rgba(0, 0, 0, 0.9);
  --ss-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ss-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  display: block;
  position: relative;
  z-index: 60;
  width: min(760px, calc(100% - 28px));
  margin: 6px auto 26px;
  scroll-margin-top: 18px;
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  color: var(--ss-text);
  animation: ss-rise 0.9s var(--ss-ease) 0.15s both;
}

.ss.ss--light {
  --ss-accent: #0066cc;
  --ss-accent-rgb: 0, 102, 204;
  --ss-title: #0066cc;
  --ss-text: #1d1d1f;
  --ss-strong: #0b0b0c;
  --ss-muted: rgba(29, 29, 31, 0.55);
  --ss-bg: rgba(255, 255, 255, 0.9);
  --ss-panel: rgba(255, 255, 255, 0.94);
  --ss-line: rgba(0, 102, 204, 0.14);
  --ss-hover: rgba(0, 102, 204, 0.06);
  --ss-mark: rgba(0, 102, 204, 0.16);
  --ss-scan: rgba(0, 102, 204, 0.035);
  --ss-shadow: 0 0 0 1px rgba(0, 102, 204, 0.08), 0 24px 60px -20px rgba(0, 40, 90, 0.35);
}

@keyframes ss-rise {
  from { opacity: 0; transform: translateY(14px) scale(0.98); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* ── The bar ─────────────────────────────────────────────── */

.ss-form { margin: 0; padding: 0; max-height: none; line-height: 1; background: none; border: 0; text-align: left; }
.ss-form div, .ss div { margin-top: 0; margin-bottom: 0; }

.ss-bar {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 14px 0 20px;
  box-sizing: border-box;
  border-left: 3px solid var(--ss-accent);
  border-right: 3px solid var(--ss-accent);
  background-color: var(--ss-bg);
  background-image:
    radial-gradient(420px circle at var(--mx) var(--my), rgba(var(--ss-accent-rgb), calc(0.06 + var(--ss-glow) * 0.08)), transparent 60%),
    linear-gradient(to bottom, transparent 49%, var(--ss-scan) 50%, transparent 51%);
  background-size: 100% 100%, 100% 3px;
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  cursor: text;
  transition:
    transform 0.5s var(--ss-spring),
    box-shadow 0.4s var(--ss-ease),
    --ss-glow 0.4s var(--ss-ease);
  box-shadow: 0 0 calc(var(--ss-glow) * 34px) rgba(var(--ss-accent-rgb), calc(var(--ss-glow) * 0.28));
}

/* Animated top/bottom hairline: a light that keeps circling the bar */
.ss-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px 0;
  pointer-events: none;
  background: conic-gradient(from var(--ss-a),
      transparent 0 62%,
      rgba(var(--ss-accent-rgb), 0.15) 70%,
      rgba(var(--ss-accent-rgb), 0.95) 80%,
      rgba(var(--ss-accent-rgb), 0.15) 90%,
      transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: ss-orbit 7s linear infinite;
  opacity: calc(0.55 + var(--ss-glow) * 0.45);
}

/* Faint static frame so the bar reads as a field even between sweeps */
.ss-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-top: 1px solid var(--ss-line);
  border-bottom: 1px solid var(--ss-line);
}

@keyframes ss-orbit { to { --ss-a: 360deg; } }

.ss.is-focus .ss-bar,
.ss-bar:hover { --ss-glow: 1; }

.ss.is-focus .ss-bar { transform: scale(1.012); }
.ss.is-focus .ss-bar::before { animation-duration: 2.6s; }

.ss-icon {
  flex: none;
  width: 26px;
  height: 26px;
  color: var(--ss-accent);
  transition: transform 0.6s var(--ss-spring), filter 0.3s;
}

.ss.is-focus .ss-icon {
  transform: rotate(-12deg) scale(1.08);
  filter: drop-shadow(0 0 6px rgba(var(--ss-accent-rgb), 0.7));
}

.ss-icon .ss-lens { transition: stroke-dashoffset 0.8s var(--ss-ease); stroke-dasharray: 40; stroke-dashoffset: 0; }
.ss.is-loading .ss-icon .ss-lens { animation: ss-lens 1s linear infinite; stroke-dasharray: 10 30; }
@keyframes ss-lens { to { stroke-dashoffset: -40; } }

.ss.is-typing .ss-icon { animation: ss-blip 0.35s var(--ss-ease); }
@keyframes ss-blip { 50% { transform: rotate(-12deg) scale(1.22); } }

.ss-field {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

.ss-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ss-input {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  font: inherit;
  font-size: 19px;
  letter-spacing: 0.02em;
  color: var(--ss-strong);
  caret-color: var(--ss-accent);
  text-align: left;
  margin: 0;
}

.ss-input::-webkit-search-cancel-button,
.ss-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.ss-input::placeholder { color: transparent; }
.ss-input::selection { background: rgba(var(--ss-accent-rgb), 0.35); }

/* Decoding placeholder — cycles through the four languages */
.ss-ghost {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 19px;
  letter-spacing: 0.02em;
  color: var(--ss-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.35s var(--ss-ease);
}

.ss-ghost .ss-glyph { color: var(--ss-accent); opacity: 0.85; }

.ss-ghost::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -0.17em;
  background: var(--ss-accent);
  opacity: 0.75;
  animation: ss-caret 1.05s steps(1) infinite;
}

@keyframes ss-caret { 50% { opacity: 0; } }

.ss.is-focus .ss-ghost::after { display: none; }
.ss.has-value .ss-ghost { opacity: 0; transform: translate(10px, -50%); }

.ss-kbd {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
  color: var(--ss-muted);
  border: 1px solid var(--ss-line);
  border-radius: 6px;
  background: rgba(var(--ss-accent-rgb), 0.04);
  transition: opacity 0.25s, transform 0.3s var(--ss-ease);
}

.ss.has-value .ss-kbd,
.ss.is-focus .ss-kbd { opacity: 0; transform: scale(0.8); pointer-events: none; position: absolute; right: 14px; }

.ss-clear {
  all: unset;
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--ss-muted);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.4) rotate(-90deg);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.45s var(--ss-spring), color 0.2s, background 0.2s;
}

.ss.has-value .ss-clear { opacity: 1; transform: none; pointer-events: auto; }
.ss-clear:hover,
.ss-clear:focus-visible { color: var(--ss-accent); background: rgba(var(--ss-accent-rgb), 0.1); }
.ss-clear svg { width: 16px; height: 16px; }

/* ── Results panel ───────────────────────────────────────── */

.ss-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  display: none;
  flex-direction: column;
  max-height: min(70vh, 640px);
  overflow: hidden;
  border-left: 3px solid var(--ss-accent);
  border-right: 3px solid var(--ss-accent);
  background: var(--ss-panel);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: var(--ss-shadow);
  transform-origin: 50% 0;
  opacity: 0;
  transform: translateY(-8px) scale(0.985);
  filter: blur(6px);
  transition:
    opacity 0.28s var(--ss-ease),
    transform 0.4s var(--ss-ease),
    filter 0.3s var(--ss-ease),
    display 0.4s allow-discrete,
    overlay 0.4s allow-discrete;
}

.ss.is-open .ss-panel {
  display: flex;
  opacity: 1;
  transform: none;
  filter: none;
}

@starting-style {
  .ss.is-open .ss-panel {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
    filter: blur(6px);
  }
}

/* scanning line that sweeps once each time new results arrive */
.ss-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ss-accent), transparent);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

.ss-panel.is-scan::before { animation: ss-scan 0.7s var(--ss-ease); }

@keyframes ss-scan {
  0%   { opacity: 0.9; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(180px); }
}

/* Language filter */
.ss-filters {
  position: relative;
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ss-line);
  overflow-x: auto;
  scrollbar-width: none;
  flex: none;
}

.ss-filters::-webkit-scrollbar { display: none; }
.ss-filters[hidden] { display: none; }

.ss-pill {
  position: absolute;
  top: 10px;
  left: 0;
  height: 32px;
  width: 0;
  border-radius: 999px;
  background: rgba(var(--ss-accent-rgb), 0.14);
  box-shadow: inset 0 0 0 1px rgba(var(--ss-accent-rgb), 0.5);
  transition: transform 0.5s var(--ss-spring), width 0.5s var(--ss-spring);
  pointer-events: none;
}

.ss-chip {
  all: unset;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ss-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.25s;
}

.ss-chip:hover { color: var(--ss-text); }
.ss-chip:focus-visible { outline: 1px dashed var(--ss-accent); outline-offset: 2px; }
.ss-chip[aria-selected="true"] { color: var(--ss-strong); }
.ss-chip .ss-n {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 11px;
  text-align: center;
  background: rgba(var(--ss-accent-rgb), 0.1);
  color: var(--ss-accent);
  transition: transform 0.3s var(--ss-spring);
}
.ss-chip.is-zero { opacity: 0.45; }

.ss-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--ss-accent-rgb), 0.35) transparent;
}

.ss-note {
  margin: 0;
  padding: 10px 18px 0;
  font-size: 13px;
  color: var(--ss-muted);
}

.ss-note b { color: var(--ss-accent); font-weight: 400; }

.ss-results {
  list-style: none;
  margin: 0;
  padding: 6px;
}

/* ── One result ── */
.ss-item {
  --i: 0;
  position: relative;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  padding: 12px 14px 12px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  animation: ss-item-in 0.55s var(--ss-ease) both;
  animation-delay: calc(var(--i) * 38ms);
  transition: background 0.25s;
}

@keyframes ss-item-in {
  from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.ss-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: var(--ss-accent);
  box-shadow: 0 0 12px rgba(var(--ss-accent-rgb), 0.8);
  transform: scaleY(0);
  transition: transform 0.35s var(--ss-spring);
}

.ss-item:hover,
.ss-item.is-active { background: var(--ss-hover); }
.ss-item.is-active::before { transform: scaleY(1); }

.ss-thumb {
  position: relative;
  width: 76px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(var(--ss-accent-rgb), 0.08);
  box-shadow: inset 0 0 0 1px var(--ss-line);
  display: grid;
  place-items: center;
  color: var(--ss-accent);
}

.ss-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  display: block;
  transition: transform 0.6s var(--ss-ease);
}

.ss-item:hover .ss-thumb img,
.ss-item.is-active .ss-thumb img { transform: scale(1.08); }

.ss-thumb svg { width: 26px; height: 26px; }

.ss-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }

.ss-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  color: var(--ss-title);
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ss-item.is-active .ss-title { text-decoration: underline; text-decoration-color: rgba(var(--ss-accent-rgb), 0.5); text-underline-offset: 3px; }

.ss-where {
  font-size: 12px;
  color: var(--ss-accent);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-snip {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ss-text);
  opacity: 0.85;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ss-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.ss-kind {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ss-muted);
  padding-right: 4px;
}

.ss-lang {
  font-size: 11px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--ss-muted);
  border: 1px solid var(--ss-line);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.3s var(--ss-spring);
}

/* the theme gives every link to the cookies article a 48px block box */
.ss a.ss-lang {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 0;
  margin: 0 !important;
}

.ss-lang:hover { color: var(--ss-accent); border-color: rgba(var(--ss-accent-rgb), 0.6); transform: translateY(-1px); }
.ss-lang.is-primary { color: var(--ss-accent); border-color: rgba(var(--ss-accent-rgb), 0.6); background: rgba(var(--ss-accent-rgb), 0.1); }
.ss-lang.is-hit::after { content: "•"; margin-left: 3px; color: var(--ss-accent); }

.ss mark {
  color: inherit;
  background: linear-gradient(var(--ss-mark), var(--ss-mark)) no-repeat 0 100% / 100% 100%;
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(var(--ss-accent-rgb), 0.7);
  animation: ss-mark 0.6s var(--ss-ease) both;
  animation-delay: calc(var(--i, 0) * 38ms + 0.15s);
}

.ss-item mark { animation-delay: inherit; }

@keyframes ss-mark { from { background-size: 0 100%; } }

/* Suggestions / empty states */
.ss-section {
  padding: 14px 18px 16px;
  animation: ss-item-in 0.5s var(--ss-ease) both;
}

.ss-section h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ss-muted);
  text-align: left;
}

.ss-empty {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--ss-text);
  text-align: left;
}

.ss-sugs { display: flex; flex-wrap: wrap; gap: 8px; }

.ss-sug {
  all: unset;
  --i: 0;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ss-text);
  border: 1px solid var(--ss-line);
  cursor: pointer;
  animation: ss-item-in 0.5s var(--ss-ease) both;
  animation-delay: calc(var(--i) * 45ms);
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.35s var(--ss-spring);
}

.ss-sug:hover,
.ss-sug:focus-visible { color: var(--ss-accent); border-color: rgba(var(--ss-accent-rgb), 0.6); background: rgba(var(--ss-accent-rgb), 0.08); transform: translateY(-2px); }
.ss-sug::before { content: "› "; color: var(--ss-accent); }

/* Skeleton while the index downloads */
.ss-skel { display: grid; gap: 10px; padding: 14px; }
.ss-skel i {
  display: block;
  height: 56px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(var(--ss-accent-rgb), 0.05) 0 40%, rgba(var(--ss-accent-rgb), 0.14) 50%, rgba(var(--ss-accent-rgb), 0.05) 60% 100%) 0 0 / 300% 100%;
  animation: ss-shimmer 1.2s linear infinite;
}
.ss-skel i:nth-child(2) { animation-delay: 0.1s; opacity: 0.8; }
.ss-skel i:nth-child(3) { animation-delay: 0.2s; opacity: 0.6; }
@keyframes ss-shimmer { to { background-position: -150% 0; } }

.ss-foot {
  flex: none;
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  padding: 9px 14px;
  border-top: 1px solid var(--ss-line);
  font-size: 11px;
  color: var(--ss-muted);
}

.ss-foot kbd {
  font: inherit;
  padding: 1px 5px;
  margin-right: 4px;
  border-radius: 4px;
  border: 1px solid var(--ss-line);
  color: var(--ss-text);
}

.ss-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* Dim the page behind the open panel, so results read as the foreground */
.ss-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ss-ease);
}

.ss--light ~ .ss-scrim,
.ss-scrim.ss--light { background: rgba(240, 246, 255, 0.4); }
.ss-scrim.is-on { opacity: 1; pointer-events: auto; }

/* ═════════ Article pages: header button + overlay ═════════ */

.ss-navgroup {
  display: flex;
  align-items: center;
  gap: 0; /* the search button's left margin is set by site-search.js */
  pointer-events: none;
}

/* Same look as the header's theme toggle / chapter nav (colours come
   from colors-dark.css / colors-light.css variables) */
.ss-trigger {
  pointer-events: auto;
  margin-left: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(to right, var(--color-bg-main-start, rgba(20, 20, 20, 0.9)), var(--color-bg-main-end, rgba(28, 25, 25, 0.9)));
  border: 1px solid var(--color-border-light, rgba(255, 255, 255, 0.15));
  color: inherit;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.ss-trigger:hover { transform: translateY(-2px); box-shadow: 0 6px 18px -6px rgba(0, 255, 65, 0.45); }
[data-theme="light"] .ss-trigger:hover { box-shadow: 0 6px 18px -6px rgba(0, 102, 204, 0.4); }
.ss-trigger:active { transform: scale(0.95); }
.ss-trigger:focus-visible { outline: 2px solid #00ff41; outline-offset: 2px; }
[data-theme="light"] .ss-trigger:focus-visible { outline-color: #0066cc; }

.ss-trigger .ss-trigger__icon {
  width: 22px;
  height: 22px;
  fill: none;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ss-trigger:hover .ss-trigger__icon { transform: rotate(-14deg) scale(1.1); }

/* soft sheen sweeping across the button now and then, to hint it's there */
.ss-trigger::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: ss-sheen 6s ease-in-out 1.5s infinite;
  pointer-events: none;
}

@keyframes ss-sheen {
  0%, 80% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

html.ss-lock { overflow: hidden; }

.ss-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  padding: 11vh 16px 16px;
  box-sizing: border-box;
  pointer-events: none;
}

.ss-modal.is-on { display: block; }
.ss-modal .ss { pointer-events: auto; }

.ss.ss--modal {
  width: min(780px, 100%);
  margin: 0 auto;
  animation: ss-pop 0.45s var(--ss-ease) both;
}

@keyframes ss-pop {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.ss--modal .ss-panel { max-height: calc(89vh - 11vh - 96px); }

.ss-scrim.ss-scrim--modal {
  z-index: 1990;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px) saturate(0.9);
  -webkit-backdrop-filter: blur(6px) saturate(0.9);
}

.ss-scrim.ss-scrim--modal.ss--light { background: rgba(225, 235, 250, 0.55); }

/* section titles inside the panel */
.ss-sec {
  margin: 0;
  padding: 12px 18px 4px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ss-muted);
  text-align: left;
}

.ss-sec .ss-n {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  text-transform: none;
  background: rgba(var(--ss-accent-rgb), 0.1);
  color: var(--ss-accent);
}

.ss-results--local { padding-bottom: 2px; }

.ss-item.ss-item--local {
  grid-template-columns: 28px 1fr;
  align-items: start;
  padding: 10px 14px 10px 12px;
}

.ss-lnum {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ss-accent);
  background: rgba(var(--ss-accent-rgb), 0.1);
  box-shadow: inset 0 0 0 1px var(--ss-line);
}

.ss-item--local .ss-snip { opacity: 1; -webkit-line-clamp: 3; }

/* matches highlighted inside the article (CSS Custom Highlight API) */
::highlight(ss-hit) { background-color: rgba(0, 255, 65, 0.28); color: inherit; }
::highlight(ss-current) { background-color: #00ff41; color: #000; }
[data-theme="light"] ::highlight(ss-hit) { background-color: rgba(0, 102, 204, 0.18); }
[data-theme="light"] ::highlight(ss-current) { background-color: #0066cc; color: #fff; }

/* the paragraph you jumped to glows briefly */
.ss-flash { animation: ss-flash 1.8s var(--ss-ease, ease); border-radius: 6px; }
@keyframes ss-flash {
  0%, 30% { box-shadow: 0 0 0 6px rgba(0, 255, 65, 0.25); background-color: rgba(0, 255, 65, 0.06); }
  100% { box-shadow: 0 0 0 6px rgba(0, 255, 65, 0); background-color: transparent; }
}
[data-theme="light"] .ss-flash { animation-name: ss-flash-light; }
@keyframes ss-flash-light {
  0%, 30% { box-shadow: 0 0 0 6px rgba(0, 102, 204, 0.2); background-color: rgba(0, 102, 204, 0.05); }
  100% { box-shadow: 0 0 0 6px rgba(0, 102, 204, 0); background-color: transparent; }
}

/* Phones: keep the chapter counter centred (as on desktop) but compact,
   so it clears the home + search buttons on the left and the language
   button on the right */
/* article.css pins the counter at left:140px under 474px; always centre it */
.ss-navgroup ~ .chapter-nav { left: 50%; }

@media (max-width: 600px) {
  .ss-navgroup ~ .chapter-nav { padding: 0.25rem; gap: 0.125rem; }
  .ss-navgroup ~ .chapter-nav .chapter-nav__btn { min-width: 36px; min-height: 40px; padding: 0.25rem; }
  .ss-navgroup ~ .chapter-nav .chapter-nav__indicator { min-width: 44px; padding: 0 0.25rem; font-size: 1rem; }
  .ss-trigger { width: 40px; height: 40px; }
}

@media (max-width: 420px) {
  .ss-navgroup ~ .chapter-nav { padding: 0.125rem; gap: 0; }
  .ss-navgroup ~ .chapter-nav .chapter-nav__btn { min-width: 30px; padding: 0.125rem; }
  .ss-navgroup ~ .chapter-nav .chapter-nav__indicator { min-width: 38px; padding: 0; font-size: 0.95rem; }
  .ss-navgroup ~ .chapter-nav .icon { width: 20px; height: 20px; }
  .ss-trigger { width: 38px; height: 38px; }
  .ss-trigger .ss-trigger__icon { width: 20px; height: 20px; }
  /* slimmer language button so the centred counter has room */
  html:has(.ss-navgroup) .lang-trigger { padding: 6px 8px; gap: 4px; }
  html:has(.ss-navgroup) .lang-trigger .lang-arrow { display: none; }
}

@media (max-width: 360px) {
  .ss-navgroup ~ .chapter-nav .chapter-nav__btn { min-width: 26px; }
  .ss-navgroup ~ .chapter-nav .chapter-nav__indicator { min-width: 34px; font-size: 0.9rem; }
  html:has(.ss-navgroup) .lang-trigger .lang-code { display: none; }
}

/* ── Small screens ── */
@media (max-width: 600px) {
  .ss { width: calc(100% - 20px); margin-bottom: 20px; }
  .ss-bar { height: 56px; padding: 0 8px 0 14px; gap: 10px; }
  .ss-input, .ss-ghost { font-size: 16px; }
  .ss-kbd { display: none; }
  .ss-panel { max-height: 72vh; }
  .ss-item { grid-template-columns: 58px 1fr; gap: 11px; padding: 10px 10px 10px 10px; }
  .ss-thumb { width: 58px; height: 46px; }
  .ss-title { font-size: 15px; }
  .ss-foot { display: none; }
  .ss { scroll-margin-top: 64px; }
  .ss-modal { padding: 10px 10px 10px; }
  .ss--modal .ss-panel { max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); }
  .ss-meta { gap: 5px; }
  .ss-meta .ss-f { display: none; }
  .ss-lang { padding: 4px 6px; }
  .ss-chip { padding: 0 10px; }
}

@media (hover: none) {
  .ss-kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ss-trigger::after, .ss-flash { animation: none !important; }
  .ss, .ss *, .ss *::before, .ss *::after, .ss-scrim {
    animation: none !important;
    transition: none !important;
  }
  .ss-bar::before { opacity: 0.6; }
}
