html.yandesign-shell {
  --yd-black: #0d100f;
  --yd-white: #f5f0ef;
  --yd-panel: rgba(255, 255, 255, 0.055);
  --yd-panel-strong: rgba(255, 255, 255, 0.09);
  --yd-border: rgba(255, 255, 255, 0.12);
  --yd-border-soft: rgba(255, 255, 255, 0.06);
  --yd-accent: #c07a45;
  --yd-accent-soft: rgba(192, 122, 69, 0.18);
  --yd-glow: rgba(192, 122, 69, 0.15);
  --yd-mono: "IBM Plex Mono", "Courier New", monospace;
  --yd-sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --yd-display: "Instrument Serif", "Times New Roman", serif;
  --color-base-background: var(--yd-black);
  --color-base-background-mobile: var(--yd-black);
  --color-base-font: var(--yd-white);
  --color-header-background: rgba(8, 10, 10, 0.86);
  --color-footer-background: rgba(8, 10, 10, 0.86);
  --color-header-border: var(--yd-border);
  --color-footer-border: var(--yd-border);
  --color-search-background: rgba(8, 10, 10, 0.88);
  --color-search-font: var(--yd-white);
  --color-search-border: var(--yd-border);
  --color-search-background-hover: var(--yd-accent);
  --color-result-background: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
  --color-result-border: var(--yd-border);
  --color-result-link-font: var(--yd-white);
  --color-result-link-font-highlight: var(--yd-white);
  --color-result-url-font: rgba(245, 240, 239, 0.72);
  --color-result-engines-font: rgba(245, 240, 239, 0.62);
  --color-sidebar-background: rgba(8, 10, 10, 0.82);
  --color-sidebar-border: var(--yd-border);
  --color-sidebar-font: var(--yd-white);
  --color-btn-background: var(--yd-accent);
  --color-btn-font: #0d100f;
  --color-categories-item-selected-font: var(--yd-white);
  --color-categories-item-border-selected: var(--yd-accent);
  --color-autocomplete-background: rgba(8, 10, 10, 0.96);
  --color-autocomplete-border: var(--yd-border);
  --color-autocomplete-font: var(--yd-white);
  --color-autocomplete-background-hover: rgba(255, 255, 255, 0.08);
}

html.yandesign-shell body {
  font-family: var(--yd-sans);
  background: linear-gradient(180deg, #0d100f 0%, #0d100f 100%);
  color: var(--yd-white);
  min-height: 100vh;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 6px);
  opacity: 0.28;
}

.yd-shell-bg,
.yd-titlebar {
  position: relative;
  z-index: 1;
}

.yd-shell-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.yd-shell-glow,
.yd-shell-grid,
.yd-shell-scanlines {
  position: absolute;
  inset: 0;
}

.yd-shell-glow-a {
  background: none;
}

.yd-shell-glow-b {
  background: none;
}

.yd-shell-grid {
  opacity: 0.04;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: none;
}

.yd-titlebar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 8, 8, 0.66);
  backdrop-filter: blur(8px);
  font-family: var(--yd-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  z-index: 10;
}

.yd-titlebar__controls {
  display: flex;
  gap: 0.45rem;
}

.yd-titlebar__dot {
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.yd-titlebar__dot--warm { background: #c07a45; }
.yd-titlebar__dot--soft { background: #f5f0ef; }
.yd-titlebar__dot--cool { background: #879f92; }

.yd-titlebar__status {
  color: rgba(245, 240, 239, 0.68);
}

#links_on_top {
  position: relative;
  z-index: 3;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 10, 10, 0.56);
  backdrop-filter: blur(8px);
}

.yd-topmark {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--yd-white);
  font-family: var(--yd-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.yd-topmark__logo {
  width: 2rem;
  height: auto;
  opacity: 0.92;
}

#links_on_top a:not(.yd-topmark) {
  border: 0;
  background: transparent;
  color: var(--yd-white);
  border-radius: 0;
  padding: 0.4rem 0.55rem;
  transition: color 0.18s ease, opacity 0.18s ease;
}

#links_on_top a:not(.yd-topmark):hover {
  color: var(--yd-accent);
}

#main_index,
#main_results,
#main_preferences,
#main_info {
  position: relative;
  z-index: 3;
}

#main_results {
  padding-top: 0.9rem;
}

body.results_endpoint .yd-titlebar {
  display: none;
}

body.results_endpoint #links_on_top {
  display: none;
}

.yd-hero {
  width: min(1180px, calc(100% - 2rem));
  margin: 0.9rem auto 1.5rem;
}

.yd-hero__panel,
#search_header,
#results .result,
#sidebar > *:not(#sidebar-end-collapsible),
footer,
.dialog-error {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 10, 10, 0.64);
  box-shadow: none;
}

.yd-hero__panel {
  padding: clamp(1rem, 2vw, 1.4rem);
}

.yd-kicker,
.engines,
#result_count small,
footer,
.search_filters,
.search_box button,
.categories a,
.yd-search-logo__text {
  font-family: var(--yd-mono);
}

.yd-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 240, 239, 0.64);
}

.yd-ascii-marquee {
  margin: 0.55rem 0 1rem;
  padding: 0.75rem 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.yd-ascii-marquee__line {
  margin: 0;
  font-family: var(--yd-mono);
  font-size: clamp(0.78rem, 1.3vw, 0.94rem);
  line-height: 1.45;
  white-space: pre-wrap;
  color: rgba(245, 240, 239, 0.84);
  text-shadow: none;
  animation: ydAsciiFlicker 4.4s steps(2, end) infinite;
}

.yd-ascii-marquee__line--a { color: #f5f0ef; }
.yd-ascii-marquee__line--b { color: rgba(192, 122, 69, 0.88); animation-delay: 0.25s; }

@keyframes ydAsciiFlicker {
  0%, 100% { opacity: 0.92; transform: translateX(0); }
  12% { opacity: 0.72; }
  18% { opacity: 1; }
  42% { transform: translateX(0); }
  50% { transform: translateX(0.08rem); }
  54% { transform: translateX(-0.05rem); }
  58% { transform: translateX(0); }
  72% { opacity: 0.82; }
}

#main_index .index {
  margin-top: 0;
}

#main_index .title {
  display: none;
}

#main_index .yd-hero__panel {
  padding: clamp(1.2rem, 2.8vw, 2rem);
}

#main_index #search {
  max-width: 56rem;
}

#main_index #search,
#main_results #search {
  margin: 0;
}

#main_index #search_header,
#main_results #search_header {
  gap: 0.8rem;
  border-radius: 0;
  padding: 0.8rem;
}

#main_index #search_header {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}

#main_index #search_logo {
  display: none;
}

#main_index #search_view {
  width: 100%;
}

#search_logo,
.yd-search-logo__text {
  color: var(--yd-white);
}

#search_logo {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 13rem;
  text-decoration: none;
}

.yd-search-logo {
  width: 2rem;
  height: auto;
}

.yd-search-logo__text {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}

.search_box {
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

#main_index .search_box {
  border-color: rgba(192, 122, 69, 0.3);
  background: rgba(6, 7, 7, 0.9);
  box-shadow: 0 0 0 1px rgba(192, 122, 69, 0.12), 0 16px 44px rgba(0, 0, 0, 0.3);
}

.search_box input {
  font-family: var(--yd-sans);
  letter-spacing: 0.01em;
}

#main_index .search_box input {
  min-height: 4rem;
  padding: 0 1.15rem;
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  background: transparent;
}

#main_index .search_box input::placeholder {
  color: rgba(245, 240, 239, 0.46);
}

.search_box:focus-within {
  border-color: rgba(192, 122, 69, 0.58);
}

#main_index .search_box:focus-within {
  box-shadow: 0 0 0 1px rgba(192, 122, 69, 0.32), 0 0 0 0.35rem rgba(192, 122, 69, 0.08);
}

.search_box button {
  border-left: 1px solid var(--yd-border);
}

#main_index .search_box button {
  min-width: 4rem;
}

#main_index #send_search {
  background: var(--yd-accent);
  color: #0d100f;
}

#main_index #send_search:hover {
  background: #d28b56;
}

.search_box button:hover {
  background: rgba(255, 255, 255, 0.05);
}

.search_filters {
  margin-top: 0.8rem;
  gap: 0.6rem;
}

.search_filters .select select,
.search_filters .checkbox-onoff + label,
.search_filters .input_select select {
  border-radius: 0;
}

.categories {
  margin-left: auto;
}

#main_index .categories {
  margin-top: 0.85rem;
  justify-content: center;
  opacity: 0.76;
}

.categories label,
.categories a {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

#main_index .search_filters {
  margin-top: 0.7rem;
  justify-content: center;
  opacity: 0.72;
}

#main_results div#results {
  width: min(1180px, calc(100% - 2rem));
  margin: 1rem auto 0;
  display: grid;
  grid-template:
    "corrections sidebar" min-content
    "answers sidebar" min-content
    "urls sidebar" 1fr
    "pagination sidebar" min-content
    / minmax(0, 1fr) 19rem;
  gap: 0 1rem;
  padding: 0;
}

#main_results #urls {
  grid-area: urls;
  min-width: 0;
}

#main_results #sidebar {
  grid-area: sidebar;
  min-width: 0;
}

#main_results #corrections {
  grid-area: corrections;
}

#main_results #answers {
  grid-area: answers;
  margin: 0 0 1rem;
}

#main_results #pagination {
  grid-area: pagination;
}

#main_results #search_header {
  background: rgba(8, 10, 10, 0.76);
  padding-top: 0.35rem;
}

#main_results .search_box {
  background: rgba(6, 7, 7, 0.88);
}

#main_results .search_box input {
  min-height: 3.15rem;
  padding: 0 1rem;
  font-size: 1rem;
}

#main_results #send_search {
  background: rgba(255, 255, 255, 0.06);
  color: var(--yd-white);
}

#main_results #send_search:hover {
  background: rgba(255, 255, 255, 0.12);
}

#results #urls {
  display: grid;
  gap: 0.85rem;
}

#results .result {
  border-radius: 0;
  padding: 1rem 1.05rem;
  backdrop-filter: none;
  transition: border-color 0.18s ease, background 0.18s ease;
  background: rgba(10, 11, 11, 0.82);
  min-width: 0;
  overflow: hidden;
}

#results .result:hover {
  border-color: rgba(192, 122, 69, 0.26);
  background: rgba(12, 13, 13, 0.92);
}

#results .result h3 {
  margin: 0.35rem 0 0;
  font-family: var(--yd-sans);
  font-size: clamp(1.02rem, 1.35vw, 1.22rem);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

#results .result h3 a {
  color: var(--yd-white);
  text-decoration-thickness: 0.06em;
}

#results .result h3 a:hover {
  color: #fff;
}

#results .result .content {
  margin-top: 0.45rem;
  color: rgba(245, 240, 239, 0.9);
  font-size: 0.96rem;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

#results .result .url_header,
#results .result .url_wrapper,
#results .result .engines {
  color: rgba(245, 240, 239, 0.74);
  font-size: 0.82rem;
  line-height: 1.45;
}

#results .result .url_wrapper,
#results .result .url_i1,
#results .result .url_i2,
#results .result .cache_link,
#results .result h3 a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

#results .result .url_header {
  opacity: 0.92;
}

#results .result .url_header:hover {
  color: rgba(245, 240, 239, 0.92);
}

#results .result .engines span {
  border: 1px solid var(--yd-border-soft);
  padding: 0.18rem 0.45rem;
  margin-right: 0.35rem;
  display: inline-block;
  background: rgba(255, 255, 255, 0.03);
}

#results .result .highlight {
  background: rgba(192, 122, 69, 0.22);
  color: #fff7f0;
}

#result_count small {
  color: rgba(245, 240, 239, 0.78);
}

#sidebar > *:not(#sidebar-end-collapsible) {
  margin-bottom: 0.8rem;
  border-radius: 0;
  padding: 0.8rem 0.9rem;
}

#sidebar {
  color: rgba(245, 240, 239, 0.86);
}

#sidebar details summary.title {
  font-family: var(--yd-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

#sidebar .title,
#sidebar summary.title,
#sidebar a,
#sidebar p,
#sidebar li,
#sidebar dd,
#sidebar dt,
#answers,
#answers .title,
#answers .answer {
  color: rgba(245, 240, 239, 0.88);
}

#answers {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 11, 11, 0.88);
  color: rgba(245, 240, 239, 0.9);
}

#answers a,
#answers .answer-url,
#answers span,
#answers b,
#answers small {
  color: inherit;
}

#pagination {
  width: min(1180px, calc(100% - 2rem));
  margin: 1rem auto 0;
}

#pagination button,
#pagination input.page_number,
#pagination input.page_number_current {
  border-radius: 0;
}

footer {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.25rem auto;
  padding: 0.8rem 1rem;
  position: relative;
  z-index: 3;
  border-radius: 0;
  color: rgba(245, 240, 239, 0.64);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
}

footer a {
  color: var(--yd-white);
}

@media (max-width: 900px) {
  #main_results div#results {
    grid-template:
      "corrections" min-content
      "answers" min-content
      "sidebar" min-content
      "urls" 1fr
      "pagination" min-content
      / minmax(0, 1fr);
    gap: 0;
  }

  .yd-titlebar__title {
    display: none;
  }

  .yd-titlebar__status {
    display: none;
  }

  #links_on_top {
    flex-wrap: wrap;
  }

  #search_logo {
    min-width: auto;
    width: 100%;
  }
}

@media (max-width: 700px) {
  #main_results div#results,
  .yd-hero,
  #links_on_top,
  footer {
    width: calc(100% - 1rem);
  }

  #main_index #search_header,
  #main_results #search_header,
  .yd-hero__panel {
    padding: 0.85rem;
  }

  #main_index .search_box input {
    min-height: 3.5rem;
    font-size: 1rem;
  }

  #links_on_top a:not(.yd-topmark) span {
    display: none;
  }
}
