@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('fonts/onest-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 500;
  font-display: block;
  src: url('fonts/onest-500.ttf') format('truetype');
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 600;
  font-display: block;
  src: url('fonts/onest-600.ttf') format('truetype');
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url('fonts/onest-700.ttf') format('truetype');
}

:root {
  --radius: 14px;
  --border: 1px solid var(--border-color);
  --border-color: #d4d4d8;
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-soft: #fafafc;
  --text: #18181b;
  --text-muted: #71717a;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --row-max: 1040px;
  --section-gap: clamp(1.25rem, 2vw, 1.75rem);
  --card-min: 220px;
  --tools-sticky-offset: 5.75rem;
  --tools-layout-gap: 0.85rem;
  --search-hub-page-width: min(100%, calc(var(--row-max) + 2rem));
  --search-hub-width-stuck: min(calc(var(--row-max) - 6rem), calc(100vw - 6rem));
  --portal-text-opacity: 1;
  --portal-ui-opacity: 1;
  --portal-plate-opacity: 0.62;
  --portal-plate-blur: 14px;
  --portal-plate-color: #ffffff;
  --portal-legible-color: #0a0a0a;
  --portal-legible-muted: #171717;
  --portal-ui-surface: color-mix(in srgb, var(--surface) calc(var(--portal-ui-opacity) * 100%), transparent);
  --portal-ui-surface-soft: color-mix(in srgb, var(--surface-soft) calc(var(--portal-ui-opacity) * 100%), transparent);
  --portal-text-main: color-mix(in srgb, var(--text) calc(var(--portal-text-opacity) * 100%), transparent);
  --portal-text-muted: color-mix(in srgb, var(--text-muted) calc(var(--portal-text-opacity) * 100%), transparent);
}

[data-theme="dark"] {
  --border-color: #3f3f46;
  --bg: #09090b;
  --surface: #18181b;
  --surface-soft: #1d1d22;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --portal-legible-color: #f4f4f5;
  --portal-legible-muted: #e4e4e7;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  overflow-y: auto;
  background-color: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: #a1a1aa var(--bg);
}

html::-webkit-scrollbar {
  width: 10px;
}

html::-webkit-scrollbar-track {
  background: var(--bg);
}

html::-webkit-scrollbar-thumb {
  background: #a1a1aa;
  border-radius: 999px;
  border: 2px solid var(--bg);
}

[data-theme="dark"] html {
  scrollbar-color: #52525b var(--bg);
}

[data-theme="dark"] html::-webkit-scrollbar-thumb {
  background: #52525b;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  background-color: var(--bg);
  background-image: radial-gradient(ellipse 130% 48vh at 50% -6vh, #ffffff 0%, transparent 68%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--portal-text-main);
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease;
}

[data-theme="dark"] body {
  background-image: radial-gradient(ellipse 130% 48vh at 50% -6vh, #17171e 0%, transparent 68%);
}

html.has-custom-bg body {
  background: transparent !important;
}

.page-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.page-backdrop__media {
  position: absolute;
  inset: -32px;
  transform-origin: center center;
  will-change: transform, filter;
}

.page-backdrop__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.page-backdrop__dim {
  position: absolute;
  inset: 0;
  background: #09090b;
  opacity: 0.35;
  pointer-events: none;
}

[data-theme="dark"] .page-backdrop__dim {
  background: #000;
}

.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, calc(var(--row-max) + 2rem));
  min-height: 100dvh;
  margin-inline: auto;
  padding: clamp(0.75rem, 2vw, 1.25rem) 1rem 2rem;
}

/* Блок «поиска»: строка поиска в интернете + закладки */
.poiska {
  position: relative;
  z-index: 40;
  flex-shrink: 0;
  width: 100%;
  margin-top: clamp(10rem, 24vh, 15rem);
  margin-bottom: clamp(4rem, 14vh, 9rem);
}

.page--search-focused {
  justify-content: center;
}

.page--search-focused .poiska {
  margin-top: 0;
  margin-bottom: 0;
}

.page--search-focused .page-footer {
  height: 0;
}

.page--search-focused .poiska > .section-plate__content {
  align-items: center;
}

@media (prefers-reduced-motion: reduce) {
  .search-hub,
  .search-hub__surface,
  .search-hub__drawer,
  .web-search__bar,
  .scrollSearch-zone {
    transition: none;
  }
}

.poiska > .section-plate__content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  width: 100%;
}

.section-plate {
  position: absolute;
  inset: -1.2rem -0.8rem -1.3rem;
  z-index: 0;
  border-radius: calc(var(--radius) + 10px);
  background: color-mix(in srgb, var(--portal-plate-color) calc(var(--portal-plate-opacity) * 100%), transparent);
  backdrop-filter: blur(var(--portal-plate-blur));
  -webkit-backdrop-filter: blur(var(--portal-plate-blur));
  transform: translateZ(0);
  box-shadow: none;
  pointer-events: none;
}

.section-plate[data-section-plate="poiska"] {
  inset: -0.65rem -0.55rem -0.75rem;
}

.section-plate--main {
  inset: clamp(0.35rem, 1vh, 0.55rem) -0.35rem clamp(0.35rem, 1.2vh, 0.65rem);
}

.section-plate--tools {
  inset: -1.25rem -0.7rem -1.6rem;
}

.tool-name,
.settings-panel__title,
.settings-toggle__text,
.settings-segment__btn,
.settings-field__control,
.web-search__suggest-text,
.web-search__engine-label,
.search-input,
.web-search__input {
  color: var(--portal-text-main);
}

.tool-desc,
.search-empty,
.settings-section__title,
.settings-field__label,
.settings-hint,
.settings-range__label,
.settings-range__ends,
.settings-bg-history__empty,
.search-input::placeholder,
.web-search__input::placeholder {
  color: var(--portal-text-muted);
}

.section-plate[hidden] {
  display: none !important;
}

.section-plate__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: inherit;
  width: 100%;
}

.tools-heading-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.tools-heading-wrap .section-plate {
  inset: -0.5rem -0.35rem;
}

html.ui-translucent .web-search__bar,
html.ui-translucent .search-input,
html.ui-translucent .tool-card,
html.ui-translucent .bookmark-item__icon,
html.ui-translucent .bookmarks__add-wrap .bookmark-item__icon,
html.ui-translucent .web-search__engine-btn,
html.ui-translucent .web-search__engine-menu,
html.ui-translucent .web-search__suggest,
html.ui-translucent .sidebar-btn,
html.ui-translucent .tools-sticky-bar.is-stuck .search-hub__surface,
html.ui-translucent .scroll-top,
html.ui-translucent .settings-fab,
html.ui-translucent .theme-fab {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.poiska-status__time,
.poiska-status__date,
.poiska-status__weather,
.poiska-status__weather-text,
.bookmark-item__label,
.bookmark-item__label--muted,
.bookmarks__add,
.sidebar-title,
.sidebar-btn,
.portal-heading h1,
.заголовок h1,
.portal-heading p,
.заголовок p {
  color: var(--portal-legible-color);
}

.poiska-status__date,
.poiska-status__weather,
.poiska-status__weather-text,
.portal-heading p,
.заголовок p,
.bookmark-item__label,
.bookmark-item__label--muted {
  color: var(--portal-legible-muted);
}

.poiska-status__weather:hover {
  color: var(--accent);
}

.poiska-status {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.3;
}

.poiska-status__time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.poiska-status__date {
  text-transform: capitalize;
}

.poiska-status__sep {
  opacity: 0.45;
  user-select: none;
}

.poiska-status__weather {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.poiska-status__weather-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.poiska-status__weather-text {
  white-space: nowrap;
}

.web-search {
  flex-shrink: 0;
  width: 100%;
  margin: 0;
}

.web-search__form {
  display: block;
}

.web-search__field {
  position: relative;
  z-index: 1;
  width: 100%;
}

.web-search__field:has(.web-search__suggest:not([hidden])) {
  z-index: 2;
}

.web-search__field:has(.web-search__preview:not([hidden])) {
  z-index: 3;
}

.search-hub {
  width: 100%;
  margin: 0;
}

.scrollSearch-zone {
  width: 100%;
  max-width: var(--search-hub-page-width);
  margin: 0;
  margin-inline: auto;
  transition: max-width 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-hub__surface {
  width: 100%;
  border: var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: visible;
  transition:
    border-color 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    border-radius 0.36s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-hub__surface:has(.web-search__bar:focus-within) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.search-hub__drawer {
  display: grid;
  grid-template-rows: 0fr;
  padding: 0;
  border-top: none;
  opacity: 0;
  overflow: hidden;
  transition:
    grid-template-rows 0.36s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.36s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-hub__drawer > .tools-sidebar {
  min-height: 0;
  overflow: hidden;
}

.web-search__bar {
  --search-gap: 0.5rem;
  --search-bar-min-h: 52px;
  display: flex;
  align-items: center;
  gap: var(--search-gap);
  min-height: var(--search-bar-min-h);
  padding: 0.35rem 0.5rem 0.35rem 1rem;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
  transition:
    min-height 0.36s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.36s cubic-bezier(0.4, 0, 0.2, 1);
}

.web-search__input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.web-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--portal-text-main);
  font: inherit;
  font-size: 1rem;
  padding: 0.35rem 0;
}

.web-search__input:focus {
  outline: none;
}

.web-search__input::-webkit-search-cancel-button,
.web-search__input::-webkit-search-decoration {
  display: none;
  -webkit-appearance: none;
}

.web-search__input::placeholder {
  color: var(--portal-text-muted);
}

.web-search__clear {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.web-search__clear[hidden] {
  display: none;
}

.web-search__clear svg {
  width: 18px;
  height: 18px;
}

.web-search__clear:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text-muted) 15%, transparent);
}

.web-search__controls {
  display: flex;
  align-items: center;
  gap: var(--search-gap);
  flex-shrink: 0;
}

.web-search__google-only[hidden],
.web-search__icon-btn[hidden],
.web-search__chip[hidden],
.web-search__engine[hidden],
#web-search-translate[hidden],
#web-engine-picker[hidden],
#web-search-images[hidden],
#web-search-ai[hidden],
#web-search-submit[hidden],
#bookmarks-section[hidden] {
  display: none !important;
}

.is-widget-off {
  display: none !important;
}

.poiska-status__time[hidden],
.poiska-status__date[hidden],
.poiska-status__weather[hidden],
.poiska-status__sep[hidden],
#poiska-weather[hidden],
#poiska-time[hidden],
#poiska-date[hidden],
#poiska-status[hidden],
#tools-section[hidden] {
  display: none !important;
}

.web-search__icon-btn,
.web-search__submit {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
}

.web-search__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 42px;
  padding: 0 0.75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  box-sizing: border-box;
  vertical-align: middle;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.web-search__chip svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  display: block;
}

.web-search__chip > span {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  line-height: 1.2;
  height: auto;
}

.web-search__icon-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

#web-search-ai.web-search__chip {
  border-color: transparent;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface) 88%);
  color: var(--accent);
}

#web-search-ai.web-search__chip:hover {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface) 80%);
  color: var(--accent-hover);
}

.web-search__icon-btn:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.web-search__engine {
  position: relative;
  flex-shrink: 0;
  z-index: 4;
}

.web-search__engine:has(.web-search__engine-btn[aria-expanded="true"]) {
  z-index: 610;
}

.web-search__engine-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: auto;
  height: 42px;
  padding: 0 0.5rem 0 0.55rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--portal-ui-surface);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  box-sizing: border-box;
}

.web-search__engine-icon {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  display: block;
  object-fit: contain;
}

.web-search__engine-btn:hover {
  border-color: var(--accent);
}

.web-search__engine-btn[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.web-search__engine-label {
  display: flex;
  align-items: center;
  line-height: 1.2;
  height: auto;
}

.web-search__engine-chevron {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  display: block;
}

.web-search__engine-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--portal-ui-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 610;
}

.web-search__engine-menu[hidden] {
  display: none;
}

[data-theme="dark"] .web-search__engine-menu {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.web-search__engine-menu [role="option"] {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.web-search__engine-menu [role="option"] .web-search__engine-icon {
  flex: 0 0 16px;
}

.web-search__engine-menu [role="option"] span {
  line-height: 1;
}

.web-search__engine-menu [role="option"]:hover,
.web-search__engine-menu [role="option"].is-selected {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface) 90%);
  color: var(--accent);
}

.web-search__preview {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  margin: 0;
  padding: 0.5rem 0.55rem;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--portal-ui-surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  z-index: 420;
  overflow: hidden;
}

.web-search__preview--inline {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  border: none;
  border-bottom: var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin: 0 0 0.15rem;
  padding: 0.2rem 0.1rem 0.55rem;
  overflow: hidden;
}

.web-search__preview[hidden] {
  display: none;
}

[data-theme="dark"] .web-search__preview {
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .web-search__preview--inline {
  box-shadow: none;
}

.web-search__preview-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(200px, 1.2fr) minmax(130px, 0.65fr);
  column-gap: clamp(0.65rem, 1.2vw, 0.9rem);
  row-gap: 0.65rem;
  align-items: start;
}

.web-search__preview-col {
  min-width: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.web-search__preview-summary,
.web-search__preview-facts {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: var(--preview-scroll-max, 11rem);
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #a1a1aa transparent;
}

.web-search__preview-summary::-webkit-scrollbar,
.web-search__preview-facts::-webkit-scrollbar {
  width: 5px;
}

.web-search__preview-summary::-webkit-scrollbar-thumb,
.web-search__preview-facts::-webkit-scrollbar-thumb {
  background: #a1a1aa;
  border-radius: 999px;
}

[data-theme="dark"] .web-search__preview-summary::-webkit-scrollbar-thumb,
[data-theme="dark"] .web-search__preview-facts::-webkit-scrollbar-thumb {
  background: #52525b;
}

.web-search__preview-media {
  padding: 0;
  position: relative;
}

.web-search__preview-main-image {
  width: 100%;
  height: auto;
  max-height: var(--preview-image-max, 11.5rem);
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--radius) - 8px);
  object-fit: cover;
  display: block;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.web-search__preview-main-image.is-switching {
  opacity: 0.2;
  transform: translateX(6px);
}

.web-search__preview-dots {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.web-search__preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 42%, #000000 58%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.web-search__preview-media:hover .web-search__preview-nav,
.web-search__preview-media:focus-within .web-search__preview-nav {
  opacity: 1;
  pointer-events: auto;
}

.web-search__preview-nav--prev {
  left: 0.45rem;
}

.web-search__preview-nav--next {
  right: 0.45rem;
}

.web-search__preview-nav svg {
  width: 16px;
  height: 16px;
  display: block;
}

.web-search__preview-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 45%, transparent);
  cursor: pointer;
}

.web-search__preview-dot.is-active {
  width: 18px;
  background: var(--accent);
}

.web-search__preview-summary {
  padding: 0.2rem 0.15rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.web-search__preview-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--portal-text-main);
}

.web-search__preview-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.web-search__preview-text {
  margin: 0.4rem 0 0;
  font-size: 0.86rem;
  line-height: 1.42;
  color: var(--portal-text-main);
}

.web-search__preview-source {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}

.web-search__preview-source:hover {
  text-decoration: underline;
}

.web-search__preview-facts {
  padding: 0.2rem 0.15rem;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.web-search__preview-facts-title {
  margin: 0 0 0.45rem;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.web-search__preview-facts-list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.28rem;
}

.web-search__preview-facts-list dt {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

.web-search__preview-facts-list dd {
  margin: -0.22rem 0 0;
  font-size: 0.86rem;
  color: var(--portal-text-main);
  line-height: 1.35;
  text-align: right;
}

.web-search__suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.4rem;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--portal-ui-surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  z-index: 400;
  max-height: min(70vh, 520px);
  overflow-x: hidden;
  overflow-y: auto;
}

.web-search__suggest[hidden] {
  display: none;
}

[data-theme="dark"] .web-search__suggest {
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
}

.web-search__suggest-scroll {
  max-height: 304px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.1rem 0.15rem 0.1rem 0.1rem;
  scrollbar-width: thin;
  scrollbar-color: #a1a1aa transparent;
}

.web-search__suggest-scroll::-webkit-scrollbar {
  width: 8px;
}

.web-search__suggest-scroll::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}

.web-search__suggest-scroll::-webkit-scrollbar-thumb {
  background: #a1a1aa;
  border-radius: 999px;
  border: 2px solid var(--surface);
}

[data-theme="dark"] .web-search__suggest-scroll {
  scrollbar-color: #52525b transparent;
}

[data-theme="dark"] .web-search__suggest-scroll::-webkit-scrollbar-thumb {
  background: #52525b;
  border-color: var(--surface);
}

.web-search__suggest-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.125rem;
  padding: 0.3rem 0.45rem 0.3rem 0.55rem;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  line-height: 1.25;
  transition: background 0.12s ease, color 0.12s ease;
}

.web-search__suggest-item--history {
  padding-left: 0.5rem;
}

.web-search__suggest-history-icon {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.web-search__suggest-history-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.web-search__suggest-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

.web-search__suggest-remove {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 0.1rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.web-search__suggest-remove svg {
  width: 13px;
  height: 13px;
}

.web-search__suggest-item--history:hover .web-search__suggest-history-icon,
.web-search__suggest-item--history.is-active .web-search__suggest-history-icon {
  color: var(--accent);
}

.web-search__suggest-item:hover .web-search__suggest-remove,
.web-search__suggest-item.is-active .web-search__suggest-remove {
  opacity: 1;
}

.web-search__suggest-remove:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text-muted) 18%, transparent);
}

.web-search__suggest-item:hover,
.web-search__suggest-item.is-active {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface) 90%);
  color: var(--accent);
}

.web-search__suggest-item:hover .web-search__suggest-text,
.web-search__suggest-item.is-active .web-search__suggest-text {
  color: var(--accent);
}

.web-search__suggest:has(.web-search__suggest-tools) .web-search__suggest-scroll {
  max-height: min(38vh, 280px);
}

.bookmarks {
  flex-shrink: 0;
  margin: 0.35rem 0 0;
  padding: 0;
}

.bookmarks__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 0.65rem 1rem;
  width: 100%;
}

.bookmark-item-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 4.75rem;
  touch-action: pan-y;
  user-select: none;
}

.bookmark-item-wrap.is-hold-ready {
  cursor: grab;
}

.bookmark-item-wrap.is-hold-ready .bookmark-item__icon {
  transform: scale(1.05);
  border-color: var(--accent);
}

.bookmark-item-wrap.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.bookmark-item-wrap.is-drop-target .bookmark-item__icon {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}

.bookmarks__add-wrap {
  cursor: default;
  gap: 0.5rem;
}

.bookmarks__add-icon {
  padding: 0;
  border-style: dashed;
  background: color-mix(in srgb, var(--portal-ui-surface) 85%, transparent);
}

.bookmarks__add-icon .bookmarks__add {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  border-radius: 50%;
}

.bookmark-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  text-decoration: none;
  color: inherit;
}

.bookmark-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--portal-ui-surface);
  border: var(--border);
  box-shadow: var(--shadow);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.bookmark-item__icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.bookmark-item:hover .bookmark-item__icon {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.bookmark-item__label {
  max-width: 100%;
  font-size: 0.72rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-item-wrap:hover .bookmark-item__label {
  color: var(--portal-legible-color);
}

.bookmark-item__edit {
  position: absolute;
  top: -4px;
  right: 2px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  box-shadow: var(--shadow);
}

.bookmark-item__edit svg {
  width: 12px;
  height: 12px;
}

.bookmark-item-wrap:hover .bookmark-item__edit,
.bookmark-item__edit:focus-visible {
  opacity: 1;
}

.bookmark-item__edit:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.bookmarks__add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  color: var(--portal-legible-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.bookmarks__add-icon:hover {
  border-color: var(--accent);
  border-style: solid;
}

.bookmarks__add-icon:hover .bookmarks__add {
  color: var(--accent);
}

.bookmark-item__label--muted {
  color: var(--portal-legible-muted);
}

.bookmarks__add svg {
  width: 22px;
  height: 22px;
}

.bookmark-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bookmark-form__label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.bookmark-form__input {
  height: 42px;
  padding: 0 0.85rem;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.bookmark-form__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.bookmark-form__actions {
  margin-top: 0.25rem;
}

.cert-modal__btn--danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.cert-modal__btn--danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

[data-theme="dark"] .cert-modal__btn--danger {
  background: #450a0a;
  border-color: #ef4444;
  color: #fecaca;
}

.web-search__submit {
  color: var(--text);
}

.web-search__submit svg {
  width: 22px;
  height: 22px;
}

.web-search__submit:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.tools-section {
  position: relative;
  z-index: 1;
  width: 100%;
  flex-shrink: 0;
  min-height: calc(100dvh - var(--tools-sticky-offset, 5.75rem));
}

.page-footer {
  width: 100%;
  flex-shrink: 0;
  height: clamp(18rem, 42vh, 26rem);
  pointer-events: none;
}

.tools-section__content {
  position: relative;
  gap: 0;
}

.portal-heading {
  display: block;
  position: relative;
  flex-shrink: 0;
  margin: 0 0 clamp(0.85rem, 2vw, 1.1rem);
  background: transparent;
}

.tools-sticky-sentinel {
  display: block;
  height: 1px;
  width: 100%;
  margin: 0;
  pointer-events: none;
  visibility: hidden;
}

.tools-sticky-placeholder {
  width: 100%;
  margin: 0;
  pointer-events: none;
}

.tools-sticky-bar {
  --sticky-top: clamp(0.45rem, 1.2vw, 0.65rem);
  position: relative;
  z-index: 120;
  width: 100%;
  padding: 0;
  margin: 0;
}

.tools-sticky-bar.is-stuck {
  position: fixed;
  top: var(--sticky-top);
  right: auto;
  z-index: 280;
  margin: 0;
}

.tools-sticky-bar.is-stuck .scrollSearch-zone {
  width: 100%;
  max-width: var(--search-hub-width-stuck);
  margin-inline: auto;
  padding-inline: 0;
  box-sizing: border-box;
}

.tools-sticky-bar.is-stuck .search-hub {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  flex-shrink: 0;
}

.tools-sticky-bar.is-stuck .search-hub__surface {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

html.search-suggest-open .tools-sticky-bar,
html.search-suggest-open .tools-sticky-bar.is-stuck {
  z-index: 500;
}

[data-theme="dark"] .tools-sticky-bar.is-stuck .search-hub__surface {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.topbar {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  margin: 0;
  padding-block: calc(var(--topbar-pad-block) / 2);
  padding-inline: 0;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) + 6px);
  background: transparent;
  box-shadow: none;
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  transition:
    padding-inline 0.28s ease,
    border-color 0.28s ease,
    background 0.28s ease,
    box-shadow 0.28s ease,
    backdrop-filter 0.28s ease;
}

.topbar--web-search {
  padding-block: 0;
}

.topbar--web-search .web-search {
  width: 100%;
}

.cert-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 46px;
  padding: 0 1rem;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  background: #dcfce7;
  color: #166534;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cert-btn:hover {
  background: #bbf7d0;
  border-color: #6ee7b7;
  color: #14532d;
}

[data-theme="dark"] .cert-btn {
  background: #14532d;
  color: #bbf7d0;
  border-color: #22c55e;
}

[data-theme="dark"] .cert-btn:hover {
  background: #166534;
  border-color: #4ade80;
  color: #ecfdf5;
}

.cert-btn--sidebar {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.2rem;
  width: 100%;
  height: auto;
  min-height: 2.85rem;
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem;
  text-align: left;
}

.cert-btn__main {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
}

.cert-btn__state {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  opacity: 0.88;
}

.cert-btn--ok {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.cert-btn--ok .cert-btn__state {
  color: #15803d;
}

.cert-btn--fail {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.cert-btn--fail .cert-btn__state {
  color: #b91c1c;
}

[data-theme="dark"] .cert-btn--ok {
  background: #14532d;
  border-color: #22c55e;
  color: #bbf7d0;
}

[data-theme="dark"] .cert-btn--fail {
  background: #450a0a;
  border-color: #f87171;
  color: #fecaca;
}

.cert-modal__warn--ok {
  color: #166534;
  background: #ecfdf5;
  border-color: #86efac;
}

[data-theme="dark"] .cert-modal__warn--ok {
  color: #bbf7d0;
  background: #14532d;
  border-color: #22c55e;
}

.web-search__suggest-tools {
  border-top: 1px solid var(--border-color);
  padding: 0.65rem 0.75rem 0.75rem;
}

.web-search__suggest-tools-title {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--portal-text-muted);
}

.web-search__suggest-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.45rem;
  min-height: 0;
}

.web-search__suggest-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.4rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: color-mix(in srgb, var(--portal-ui-surface) 92%, #ffffff 8%);
  color: var(--portal-text-main);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.web-search__suggest-tool img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
}

.web-search__suggest-tool:hover,
.web-search__suggest-tool.is-active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-color) 55%);
  background: color-mix(in srgb, var(--accent) 8%, var(--portal-ui-surface) 92%);
  color: var(--accent);
}

.заголовок {
  width: 100%;
  text-align: center;
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 clamp(1.25rem, 2.5vw, 1.75rem);
}

.заголовок:not(.portal-heading) {
  display: none;
}

.fab-stack {
  position: fixed;
  right: clamp(1rem, 3vw, 1.5rem);
  bottom: clamp(1rem, 3vw, 1.5rem);
  z-index: 85;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.5rem;
}

.scroll-top,
.settings-fab,
.theme-fab {
  position: relative;
  right: auto;
  bottom: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: var(--border);
  border-radius: 50%;
  background: var(--portal-ui-surface);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.2s ease;
}

.theme-fab__icon {
  width: 22px;
  height: 22px;
  display: block;
}

.theme-fab .icon-sun {
  display: none;
}

.theme-fab .icon-moon {
  display: block;
}

[data-theme="dark"] .theme-fab .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-fab .icon-moon {
  display: none;
}

.theme-fab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

#theme-toggle[hidden],
.theme-fab[hidden],
.theme-fab.is-widget-off {
  display: none !important;
}

.settings-fab[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.scroll-top[hidden] {
  display: none;
}

.scroll-top svg {
  width: 22px;
  height: 22px;
}

.scroll-top:hover,
.settings-fab:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.settings-fab__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

[data-theme="dark"] .scroll-top,
[data-theme="dark"] .settings-fab,
[data-theme="dark"] .theme-fab {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.settings-panel {
  --portal-ui-opacity: 1;
  --portal-text-opacity: 1;
  --portal-ui-surface: var(--surface);
  --portal-ui-surface-soft: var(--surface-soft);
  --portal-text-main: var(--text);
  --portal-text-muted: var(--text-muted);
  position: fixed;
  top: clamp(0.75rem, 2.5vw, 1.25rem);
  right: clamp(1rem, 3vw, 1.5rem);
  bottom: clamp(0.75rem, 2.5vw, 1.25rem);
  z-index: 90;
  width: clamp(288px, 92vw, 320px);
  pointer-events: auto;
}

.settings-panel[hidden] {
  display: none;
}

.settings-panel__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}

[data-theme="dark"] .settings-panel__inner {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.settings-panel__scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 0.1rem 0.15rem 0;
  scrollbar-width: thin;
  scrollbar-color: #a1a1aa transparent;
}

.settings-panel__scroll::-webkit-scrollbar {
  width: 8px;
}

.settings-panel__scroll::-webkit-scrollbar-track {
  background: transparent;
  margin: 8px 0;
}

.settings-panel__scroll::-webkit-scrollbar-thumb {
  background: #a1a1aa;
  border-radius: 999px;
  border: 2px solid var(--surface);
}

[data-theme="dark"] .settings-panel__scroll {
  scrollbar-color: #52525b transparent;
}

[data-theme="dark"] .settings-panel__scroll::-webkit-scrollbar-thumb {
  background: #52525b;
  border-color: var(--surface);
}

.settings-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-bottom: var(--border);
  flex-shrink: 0;
}

.settings-panel__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.settings-panel__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.settings-panel__close:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text);
}

.settings-section {
  padding: 1.05rem 0.9rem;
}

.settings-section + .settings-section {
  border-top: var(--border);
  margin-top: 0.35rem;
}

.settings-section__body {
  display: flex;
  flex-direction: column;
}

.settings-section__body.is-disabled {
  opacity: 0.42;
  pointer-events: none;
}

.settings-section__body.is-disabled label,
.settings-section__body.is-disabled .settings-segment__btn,
.settings-section__body.is-disabled .settings-file__btn {
  cursor: not-allowed;
}

.settings-subpanel[hidden] {
  display: none !important;
}

.settings-range-wrap--locked {
  pointer-events: none;
}

.settings-range-wrap--locked .settings-range__label {
  color: var(--text-muted);
}

.settings-range-wrap--locked .settings-range__input {
  cursor: not-allowed;
  opacity: 0.65;
}

.settings-range-wrap:not(.settings-range-wrap--locked) .settings-range__input {
  opacity: 1;
}

.settings-toggle--section {
  margin-bottom: 0.65rem;
}

.settings-section--actions .settings-hint {
  margin-top: 0;
  margin-bottom: 0.65rem;
}

.settings-section--engine .settings-hint {
  margin-top: 0;
  margin-bottom: 0.55rem;
}

.settings-engine-picker {
  width: 100%;
}

.settings-engine-picker .web-search__engine-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 0.65rem;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.settings-engine-picker .web-search__engine {
  z-index: 1;
}

.settings-engine-picker .web-search__engine:has(.web-search__engine-btn[aria-expanded="true"]) {
  z-index: 610;
}

.settings-engine-picker .web-search__engine-menu {
  left: 0;
  right: 0;
  min-width: 0;
  width: 100%;
  z-index: 610;
}

.settings-section__title {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.settings-hint--group {
  margin: 0.85rem 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.settings-hint--plates {
  margin-top: 1rem;
}

.settings-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.25rem;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--portal-ui-surface-soft);
  margin-bottom: 0.65rem;
}

.settings-segment__btn {
  height: 36px;
  padding: 0 0.5rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.settings-segment__btn:hover {
  color: var(--portal-text-main);
}

.settings-segment__btn.is-active {
  border-color: var(--border-color);
  background: var(--portal-ui-surface);
  color: var(--portal-text-main);
  box-shadow: var(--shadow);
}

.settings-segment--compact {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 0;
}

.settings-segment--compact .settings-segment__btn {
  height: 30px;
  padding: 0 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-segment--compact .settings-segment__btn svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.settings-field--inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.settings-field--inline .settings-field__label {
  flex: 1;
  min-width: 0;
}

.settings-field--inline .settings-segment--compact {
  flex-shrink: 0;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
  font-size: 0.86rem;
  cursor: pointer;
  user-select: none;
}

.settings-toggle--compact {
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
}

.settings-toggle--with-icon {
  gap: 0.5rem;
}

.settings-toggle__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  color: var(--text-muted);
}

.settings-toggle__icon svg {
  width: 1.125rem;
  height: 1.125rem;
  display: block;
}

.settings-toggle__icon img {
  width: 1rem;
  height: 1rem;
  display: block;
  object-fit: contain;
}

.settings-toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.settings-toggle__box {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  border: var(--border);
  border-radius: 4px;
  background: var(--surface-soft);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
}

.settings-toggle__box::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.settings-toggle__input:checked + .settings-toggle__box {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface) 88%);
}

.settings-toggle__input:checked + .settings-toggle__box::after {
  opacity: 1;
  transform: scale(1);
}

.settings-toggle__input:focus-visible + .settings-toggle__box {
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: 2px;
}

.settings-bg-preview {
  position: relative;
  margin-bottom: 0.65rem;
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-soft);
  aspect-ratio: 16 / 6;
}

.settings-bg-preview__img,
.settings-bg-preview__color {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 4.5rem;
}

.settings-bg-preview__img {
  object-fit: cover;
}

.settings-bg-preview__color[hidden],
.settings-bg-preview__img[hidden] {
  display: none;
}

.settings-bg-preview--color .settings-bg-preview__color {
  min-height: 4.5rem;
}

.settings-bg-preview__remove {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 55%, #000000 45%);
  color: #ffffff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.92;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.settings-bg-preview__remove:hover {
  opacity: 1;
  transform: scale(1.05);
}

.settings-file {
  margin-bottom: 0.65rem;
}

.settings-file__btn,
.settings-btn {
  width: 100%;
  height: 40px;
  border: var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 10%, var(--portal-ui-surface) 90%);
  color: var(--accent);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.settings-file__btn:hover,
.settings-btn:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--portal-ui-surface) 84%);
}

.settings-btn--ghost {
  background: var(--portal-ui-surface-soft);
  color: var(--text-muted);
}

.settings-btn--ghost:hover {
  color: var(--accent);
}

.settings-btn--reset {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface) 88%);
  color: var(--accent);
  font-weight: 600;
}

.settings-btn--reset:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 20%, var(--surface) 80%);
  color: var(--accent);
}

.settings-section--actions .settings-btn--reset {
  margin-top: 0.15rem;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
}

.settings-panel .settings-toggle__text,
.settings-panel .settings-segment__btn,
.settings-panel .settings-field__control,
.settings-panel .settings-panel__title,
.settings-panel .settings-range__label output {
  color: var(--text);
}

.settings-panel .settings-field__label,
.settings-panel .settings-hint,
.settings-panel .settings-range__label,
.settings-panel .settings-range__ends,
.settings-panel .settings-section__title,
.settings-panel .settings-bg-history__empty {
  color: var(--text-muted);
}

.settings-field__label,
.settings-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.settings-hint {
  margin: 0 0 0.45rem;
}

.settings-field__control {
  width: 100%;
  font: inherit;
  font-size: 0.84rem;
  padding: 0.5rem 0.65rem;
  border: var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--portal-ui-surface) 92%, #ffffff 8%);
  color: var(--portal-text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.settings-field__control--color {
  padding: 0.3rem;
  min-height: 2.35rem;
  cursor: pointer;
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
  block-size: 2.35rem;
}

@-moz-document url-prefix() {
  .settings-field__control--color {
    padding: 0.2rem 0.3rem;
    height: 2.35rem;
  }
}

.settings-field__control::placeholder {
  color: var(--portal-text-muted);
}

.settings-field__control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.settings-bg-history {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.settings-bg-history__empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.settings-bg-history__item {
  position: relative;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-soft);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.settings-bg-history__item:hover {
  transform: translateY(-1px);
}

.settings-bg-history__item.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

.settings-bg-history__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-bg-history__remove {
  position: absolute;
  top: 3px;
  right: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(9, 9, 11, 0.72);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.settings-bg-history__item:hover .settings-bg-history__remove,
.settings-bg-history__remove:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.settings-range {
  display: block;
  margin-bottom: 0.65rem;
}

.settings-range__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.settings-range__val {
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--portal-text-main);
  font-weight: 500;
  min-width: 3.5ch;
  text-align: right;
}

.settings-range__label output {
  font-variant-numeric: tabular-nums;
  color: var(--portal-text-main);
  font-weight: 500;
}

.settings-range__input {
  width: 100%;
  height: 6px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.settings-range__ends {
  display: flex;
  justify-content: space-between;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.заголовок h1 {
  margin: 0 0 0.12rem;
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.заголовок p {
  margin: 0;
  font-size: clamp(0.94rem, 2.2vw, 1.05rem);
  font-weight: 400;
  max-width: 38rem;
  margin-inline: auto;
  line-height: 1.3;
}

.content-layout {
  position: relative;
  flex: 1;
  width: 100%;
  margin-top: var(--tools-layout-gap);
  padding-top: 0.35rem;
}

.content-layout__inner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(1.25rem, 3vw, 2.1rem);
  align-items: start;
  position: relative;
  z-index: 1;
}

.content-layout .section-plate {
  inset: -0.55rem;
}

.sidebar-slot {
  min-width: 0;
}

.tools-sidebar {
  position: sticky;
  top: var(--tools-sticky-offset);
  align-self: start;
  z-index: 50;
  flex-shrink: 0;
  max-height: calc(100dvh - var(--tools-sticky-offset) - 1rem);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #a1a1aa transparent;
  padding-top: 0.25rem;
  padding-bottom: 0.5rem;
}

.tools-sidebar::-webkit-scrollbar {
  width: 6px;
}

.tools-sidebar::-webkit-scrollbar-thumb {
  background: #a1a1aa;
  border-radius: 999px;
}

.search-hub__drawer .tools-sidebar {
  position: static;
  top: auto;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.services-pane {
  overflow-x: hidden;
  padding: 0.5rem 0.35rem 1rem;
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sidebar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  margin: 0;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  font-size: 0.93rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.sidebar-btn:hover {
  border-color: var(--border-color);
  color: var(--portal-legible-color);
  background: color-mix(in srgb, var(--portal-ui-surface) 88%, transparent 12%);
}

.sidebar-btn.is-active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-color) 55%);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--portal-ui-surface) 90%);
}

.categories {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

.category {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.category.is-hidden {
  display: none;
}

.tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--card-min), 1fr));
  gap: 1rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.35rem 1.1rem 1.2rem;
  background: var(--portal-ui-surface);
  border: var(--border);
  border-radius: calc(var(--radius) - 2px);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.tool-card.is-hidden {
  display: none;
}

.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1;
}

[data-theme="dark"] .tool-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.tool-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tool-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 0.85rem;
  border-radius: var(--radius);
}

.tool-name {
  margin: 0 0 0.45rem;
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.25;
}

.tool-desc {
  margin: 0;
  font-size: 0.855rem;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 30ch;
}

.search-empty {
  display: none;
  width: 100%;
  max-width: var(--row-max);
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.search-empty.is-visible {
  display: block;
}

.cert-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.45);
}

.cert-modal[hidden] {
  display: none;
}

.cert-modal__panel {
  width: min(100%, 38rem);
  padding: 1.5rem 1.4rem 1.25rem;
  background: var(--surface);
  border: var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.cert-modal__title {
  margin: 0 0 0.65rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.cert-modal__text {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.cert-modal__warn {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid #fcd34d;
  background: #fef9c3;
  color: #854d0e;
  font-size: 0.85rem;
  line-height: 1.4;
}

.cert-modal__warn[hidden] {
  display: none;
}

[data-theme="dark"] .cert-modal__warn {
  border-color: #ca8a04;
  background: #422006;
  color: #fde68a;
}

.cert-modal__steps {
  margin: 0 0 1.1rem;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.cert-modal__steps li + li {
  margin-top: 0.35rem;
}

.cert-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cert-modal__btn {
  height: 40px;
  padding: 0 1rem;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.cert-modal__btn--primary {
  border-color: #a7f3d0;
  background: #dcfce7;
  color: #166534;
  font-weight: 500;
}

[data-theme="dark"] .cert-modal__btn--primary {
  background: #14532d;
  color: #bbf7d0;
  border-color: #22c55e;
}

@media (min-width: 861px) {
  .search-hub__drawer {
    display: none !important;
  }

  .tools-sticky-bar:not(.is-stuck) .scrollSearch-zone {
    max-width: var(--search-hub-page-width);
  }

  .tools-sticky-bar .search-hub {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 860px) {
  .content-layout__inner {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .sidebar-slot {
    display: none;
  }

  .search-hub__drawer {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    padding: 0;
    border-top: none;
    transition:
      grid-template-rows 0.24s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1),
      padding 0.24s cubic-bezier(0.4, 0, 0.2, 1);
  }

  html.is-search-stuck .search-hub__surface {
    border-radius: 20px;
  }

  html.is-search-stuck .web-search__bar {
    --search-bar-min-h: 46px;
    padding-top: 0.28rem;
    padding-bottom: 0.28rem;
  }

  html.is-search-stuck .search-hub__drawer:not(:empty) {
    grid-template-rows: 1fr;
    opacity: 1;
    padding: 0.45rem 0.55rem 0.55rem;
    border-top: var(--border);
  }

  html.is-search-stuck .search-hub__drawer > .tools-sidebar {
    overflow-x: auto;
    overflow-y: hidden;
  }

  .tools-sticky-bar.is-stuck .scrollSearch-zone {
    width: 100%;
    max-width: 100%;
    padding-inline: 1rem;
  }

  .tools-sticky-bar.is-stuck .search-hub {
    width: 100%;
    max-width: 100%;
  }

  .search-hub__drawer .tools-sidebar {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.4rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }

  .search-hub__drawer .tools-sidebar::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .search-hub__drawer .cert-btn--sidebar {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: none;
    min-height: 2.25rem;
    margin: 0;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
  }

  .search-hub__drawer .cert-btn__main {
    font-size: 0.78rem;
    line-height: 1;
  }

  .search-hub__drawer .cert-btn__state {
    display: none;
  }

  .search-hub__drawer .sidebar-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.35rem;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0 0.15rem 0 0;
  }

  .search-hub__drawer .sidebar-btn {
    flex-shrink: 0;
    width: auto;
    min-height: 2.25rem;
    padding: 0 0.72rem;
    border-radius: 999px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .web-search__preview {
    bottom: calc(100% + 6px);
    padding: 0.35rem;
  }

  .web-search__preview-grid {
    grid-template-columns: minmax(170px, 0.95fr) minmax(220px, 1.2fr);
  }

  .web-search__preview-facts {
    grid-column: 2;
  }

  .web-search__suggest {
    max-height: min(78vh, 620px);
  }

  .web-search__suggest:has(.web-search__preview--inline) .web-search__suggest-scroll {
    max-height: none;
    overflow: visible;
    padding-top: 0.25rem;
  }

}

@media (max-width: 600px) {
  .page {
    padding-top: 0.75rem;
  }

  .page-footer {
    height: max(115dvh, 36rem);
  }

  .poiska {
    margin-top: clamp(6rem, 18vh, 10rem);
    margin-bottom: clamp(2.5rem, 10vh, 5rem);
  }

  .page--search-focused .poiska {
    margin-top: 0;
    margin-bottom: 0;
  }

  .poiska > .section-plate__content {
    gap: 1rem;
  }

  .web-search__preview-grid {
    grid-template-columns: 1fr;
  }

  .web-search__preview-facts {
    grid-column: auto;
    text-align: left;
  }

  .web-search__preview-nav {
    width: 26px;
    height: 26px;
  }

  .web-search__preview-nav--prev {
    left: 0.3rem;
  }

  .web-search__preview-nav--next {
    right: 0.3rem;
  }

  .web-search__preview-facts-list dt,
  .web-search__preview-facts-list dd {
    text-align: left;
  }

  .web-search__bar {
    min-height: 48px;
    padding-left: 0.85rem;
  }

  .web-search__input {
    font-size: 0.95rem;
  }

  .web-search__chip span {
    display: none;
  }

  #web-search-ai.web-search__chip {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .web-search__engine-btn {
    font-size: 0.75rem;
    padding: 0 0.35rem 0 0.55rem;
  }

  .bookmark-item-wrap {
    width: 4.25rem;
  }

  .bookmark-item__icon {
    width: 44px;
    height: 44px;
  }

  .bookmarks__add {
    width: 44px;
    height: 44px;
  }

  .topbar {
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .заголовок {
    margin: 1rem 0 1rem;
  }

  .cert-btn--sidebar {
    margin-bottom: 0.65rem;
  }
}
