/* Gidora — responsive search interface */
:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f0f4ff;
  --surface-raised: rgba(255, 255, 255, 0.92);
  --text: #14213d;
  --text-soft: #53627b;
  --text-faint: #7a879c;
  --primary: #2457d6;
  --primary-strong: #1742ad;
  --primary-soft: #e9efff;
  --accent: #13a68c;
  --border: #dfe5ef;
  --border-strong: #cbd5e4;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --focus: rgba(36, 87, 214, 0.22);
  --shadow-sm: 0 1px 2px rgba(20, 33, 61, 0.06), 0 3px 12px rgba(20, 33, 61, 0.04);
  --shadow-md: 0 14px 40px rgba(20, 33, 61, 0.1);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --content-width: 1160px;
  --results-width: 840px;
  font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, Vazirmatn, IRANSansX, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

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

html {
  min-width: 280px;
  min-height: 100%;
  direction: ltr;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 85% -10%, rgba(36, 87, 214, 0.12), transparent 34rem),
    radial-gradient(circle at -5% 35%, rgba(19, 166, 140, 0.08), transparent 27rem),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(36, 87, 214, 0.2);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

#search-shell {
  width: min(calc(100% - 32px), var(--content-width));
  min-height: calc(100vh - 2rem);
  margin-inline: auto;
  padding-block: clamp(24px, 7vh, 84px) 48px;
  transition: padding 240ms ease;
}

#search-shell.has-query {
  padding-top: 22px;
}

#brand-home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(20px, 4vh, 36px);
  color: var(--text);
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
}

#brand-home::before {
  width: 42px;
  height: 42px;
  border-radius: 14px 14px 14px 5px;
  background: linear-gradient(145deg, var(--primary), #6d83f2);
  box-shadow: 0 8px 20px rgba(36, 87, 214, 0.25);
  color: #fff;
  content: "G";
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  line-height: 1;
}

#brand-home:hover {
  color: var(--primary);
}

#search-form {
  position: relative;
  z-index: 2;
  width: min(100%, 860px);
  margin-inline: auto;
}

.has-query #search-form {
  margin-inline: 0;
}

/* Supports either a wrapper-based form or controls placed directly in the form. */
.search-box,
#search-form:has(> #search-input) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.search-box:focus-within,
#search-form:has(> #search-input):focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus), var(--shadow-md);
}

#search-input {
  min-width: 0;
  height: 54px;
  padding: 0 20px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: clamp(1rem, 2.4vw, 1.13rem);
  font-weight: 500;
  caret-color: var(--primary);
}

#search-input::placeholder {
  color: var(--text-faint);
  opacity: 1;
}

#search-input[aria-invalid="true"] {
  animation: input-shake 260ms ease;
}

.search-submit {
  min-width: 112px;
  height: 48px;
  padding-inline: 20px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 7px 18px rgba(36, 87, 214, 0.23);
  color: #fff;
  font-weight: 800;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.search-submit:hover {
  box-shadow: 0 9px 24px rgba(36, 87, 214, 0.3);
  filter: saturate(1.1);
  transform: translateY(-1px);
}

.search-submit:active {
  transform: translateY(1px);
}

.search-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  width: min(100%, 860px);
  margin: 14px auto 0;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
}

.has-query .search-tabs {
  margin-inline: 0;
}

.search-tab {
  flex: 0 0 auto;
  min-width: 58px;
  height: 33px;
  padding-inline: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.search-tab:hover,
.search-tab.is-active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.search-tab.is-active {
  box-shadow: inset 0 0 0 1px rgba(36, 87, 214, 0.12);
}

#stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  width: min(100%, 860px);
  margin: clamp(32px, 6vh, 58px) auto 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--border);
  box-shadow: var(--shadow-sm);
}

.has-query #stats-strip {
  display: none;
}

.stat-item {
  min-width: 0;
  padding: 16px 14px;
  background: rgba(255, 255, 255, 0.88);
  text-align: center;
}

.stat-value,
.stat-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-value {
  color: var(--primary-strong);
  font-size: 1.08rem;
  font-weight: 900;
}

.stat-label {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 0.78rem;
}

#search-layout {
  display: none;
  grid-template-columns: minmax(0, var(--results-width)) minmax(220px, 280px);
  align-items: start;
  gap: 24px;
  width: min(100%, calc(var(--results-width) + 304px));
  margin-top: 22px;
}

.has-query #search-layout {
  display: grid;
}

#search-main {
  min-width: 0;
}

#ad-panel {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm);
}

.ad-label {
  color: var(--text-faint);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ad-card {
  display: grid;
  gap: 8px;
  min-height: 160px;
  padding: 18px;
  border: 1px solid rgba(36, 87, 214, 0.14);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(36, 87, 214, 0.18), transparent 7rem),
    linear-gradient(145deg, var(--surface-soft), rgba(255, 255, 255, 0.84));
  color: var(--text);
  text-decoration: none;
}

.ad-card strong {
  align-self: end;
  color: var(--primary-strong);
  font-size: 1.04rem;
  line-height: 1.35;
}

.ad-card span {
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}

#result-summary,
#results,
#pagination,
#empty-state {
  width: 100%;
}

#result-summary {
  min-height: 28px;
  margin-top: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
  scroll-margin-top: 16px;
}

#result-summary:empty {
  display: none;
}

#results {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.result-card {
  position: relative;
  padding: 15px 18px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.77);
  box-shadow: var(--shadow-sm);
  animation: result-enter 360ms both;
  animation-delay: calc(var(--result-order, 0) * 28ms);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.result-card:hover {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: 0 7px 22px rgba(20, 33, 61, 0.08);
  transform: translateY(-1px);
}

.result-card--asset {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.result-media-preview {
  display: block;
  width: 100%;
  max-height: 260px;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-soft);
}

.result-media-preview img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.result-address {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #24725f;
  font-size: 0.74rem;
}

.result-favicon {
  flex: 0 0 auto;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 7px;
  background: #e4f6f1;
  color: #15715d;
  font-size: 0.62rem;
  font-weight: 900;
}

.result-url {
  direction: ltr;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  unicode-bidi: plaintext;
  white-space: nowrap;
}

.result-type-badge {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 0.7rem;
  font-weight: 900;
}

.result-title {
  margin: 6px 0 4px;
  font-size: clamp(0.96rem, 1.9vw, 1.08rem);
  font-weight: 720;
  line-height: 1.38;
  letter-spacing: -0.005em;
}

.result-link {
  color: var(--primary-strong);
  text-decoration: none;
  text-underline-offset: 4px;
}

.result-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.result-link[aria-disabled="true"] {
  color: var(--text-soft);
  cursor: default;
}

.result-snippet {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.68;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

mark {
  border-radius: 3px;
  background: #fff0a8;
  color: inherit;
  padding-inline: 1px;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.result-meta-item {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-faint);
  font-size: 0.67rem;
}

.result-source-link {
  max-width: 100%;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-source-link:hover {
  color: var(--primary);
}

.result-skeleton {
  pointer-events: none;
}

.skeleton-line {
  display: block;
  height: 12px;
  margin-top: 12px;
  border-radius: 999px;
  background: linear-gradient(100deg, #e8ecf3 20%, #f7f9fc 38%, #e8ecf3 56%);
  background-size: 220% 100%;
  animation: skeleton-wave 1.25s linear infinite;
}

.skeleton-url {
  width: 34%;
  height: 9px;
  margin-top: 2px;
}

.skeleton-title {
  width: 62%;
  height: 18px;
}

.skeleton-text {
  width: 92%;
}

.skeleton-text-short {
  width: 70%;
}

#empty-state,
.error-card {
  margin-top: 18px;
  padding: clamp(28px, 6vw, 50px) 22px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 19px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 2rem;
  font-weight: 400;
}

.empty-title,
.error-title {
  margin: 0;
  font-size: 1.12rem;
}

.empty-description,
.error-description {
  max-width: 540px;
  margin: 8px auto 0;
  color: var(--text-soft);
  font-size: 0.91rem;
}

.error-card {
  border-color: rgba(180, 35, 24, 0.26);
  background: var(--danger-soft);
}

.error-title {
  color: var(--danger);
}

.retry-button {
  margin-top: 18px;
  padding: 9px 18px;
  border: 1px solid rgba(180, 35, 24, 0.3);
  border-radius: 11px;
  background: #fff;
  color: var(--danger);
  font-weight: 800;
}

.retry-button:hover {
  background: #fff8f7;
}

#pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 30px;
}

.page-button {
  display: grid;
  min-width: 40px;
  height: 40px;
  padding-inline: 11px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
  font-size: 0.86rem;
  font-weight: 700;
  transition: border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.page-button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.page-button.is-current {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  opacity: 1;
}

.page-button:disabled:not(.is-current) {
  opacity: 0.45;
}

.page-prev,
.page-next {
  min-width: 66px;
}

.page-ellipsis {
  min-width: 24px;
  color: var(--text-faint);
  text-align: center;
}

@keyframes result-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes skeleton-wave {
  to { background-position-x: -220%; }
}

@keyframes input-shake {
  25% { transform: translateX(3px); }
  50% { transform: translateX(-3px); }
  75% { transform: translateX(2px); }
}

@media (max-width: 980px) {
  #search-layout {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, var(--results-width));
  }

  #ad-panel {
    position: static;
    order: 2;
  }

  .ad-card {
    min-height: 120px;
  }
}

@media (max-width: 700px) {
  #search-shell {
    width: min(calc(100% - 20px), var(--content-width));
    padding-top: 22px;
  }

  #brand-home {
    margin-bottom: 18px;
  }

  #stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-card {
    padding: 17px 15px;
  }

  .result-snippet {
    -webkit-line-clamp: 4;
  }
}

@media (max-width: 480px) {
  .search-box,
  #search-form:has(> #search-input) {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 5px;
    border-radius: 18px;
  }

  #search-input {
    height: 50px;
    padding-inline: 12px;
  }

  .search-submit {
    min-width: 54px;
    height: 44px;
    padding-inline: 13px;
    border-radius: 13px;
  }

  .search-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .search-tab {
    min-width: 62px;
    flex: 0 0 auto;
  }

  #pagination {
    gap: 4px;
  }

  .page-button {
    min-width: 35px;
    height: 37px;
    padding-inline: 8px;
  }

  .page-prev,
  .page-next {
    min-width: 54px;
    font-size: 0.78rem;
  }

  .page-ellipsis {
    min-width: 14px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d1423;
    --surface: #151f31;
    --surface-soft: #1a2740;
    --surface-raised: rgba(21, 31, 49, 0.92);
    --text: #ecf2ff;
    --text-soft: #b1bdd1;
    --text-faint: #8896ad;
    --primary: #7c9cff;
    --primary-strong: #9bb2ff;
    --primary-soft: #1c2c56;
    --border: #27344a;
    --border-strong: #35445d;
    --danger: #ff9189;
    --danger-soft: #321d22;
    --focus: rgba(124, 156, 255, 0.28);
    --shadow-sm: 0 2px 14px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 16px 46px rgba(0, 0, 0, 0.28);
  }

  body {
    background:
      radial-gradient(circle at 85% -10%, rgba(68, 97, 190, 0.2), transparent 34rem),
      radial-gradient(circle at -5% 35%, rgba(19, 166, 140, 0.1), transparent 27rem),
      var(--bg);
  }

  .stat-item,
  .search-tabs,
  .result-card,
  #ad-panel,
  #empty-state {
    background: rgba(21, 31, 49, 0.78);
  }

  .ad-card {
    background:
      radial-gradient(circle at 100% 0%, rgba(124, 156, 255, 0.18), transparent 7rem),
      linear-gradient(145deg, var(--surface-soft), rgba(21, 31, 49, 0.84));
  }

  .result-favicon {
    background: #173a38;
    color: #77d5bf;
  }

  .result-address {
    color: #74cdb8;
  }

  mark {
    background: #695b16;
  }

  .retry-button {
    background: #231b21;
  }

  .retry-button:hover {
    background: #2b1e23;
  }

  .skeleton-line {
    background: linear-gradient(100deg, #202c40 20%, #2a374c 38%, #202c40 56%);
    background-size: 220% 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: #fff;
  }

  #search-form,
  #stats-strip,
  #pagination {
    display: none !important;
  }

  #search-shell {
    width: 100%;
    padding: 0;
  }

  .result-card {
    break-inside: avoid;
    border: 0;
    box-shadow: none;
  }
}

/* Echo-style dark Gidora skin */
:root {
  color-scheme: dark;
  --bg: #0e1117;
  --surface: rgba(21, 26, 35, 0.78);
  --surface-soft: rgba(32, 40, 57, 0.86);
  --surface-raised: rgba(21, 26, 35, 0.88);
  --text: #eef2f8;
  --text-soft: #aab6c7;
  --text-faint: #8d9bad;
  --primary: #6aa8ff;
  --primary-strong: #9fd8ff;
  --primary-soft: rgba(106, 168, 255, 0.13);
  --accent: #62e7d4;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.14);
  --danger: #ff7a90;
  --danger-soft: rgba(255, 122, 144, 0.1);
  --focus: rgba(98, 231, 212, 0.28);
  --shadow-sm: 0 16px 36px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 22px 54px rgba(0, 0, 0, 0.32);
}

body {
  background:
    radial-gradient(circle at 18% 8%, rgba(98, 231, 212, 0.14), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(106, 168, 255, 0.18), transparent 30%),
    linear-gradient(180deg, #0e1117, #10141c 52%, #0b0e14);
  color: var(--text);
  font-family: Tahoma, Arial, "Segoe UI", Vazirmatn, sans-serif;
  font-size: 14px;
}

.top-bar {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 28px;
}

.language-select {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(21, 26, 35, 0.72);
  color: #eef2f8;
  padding: 0 12px;
  font: inherit;
  outline: 0;
}

.language-select:hover,
.language-select:focus {
  border-color: rgba(98, 231, 212, 0.42);
  background: #202839;
}

.language-select option {
  background: #151a23;
  color: #eef2f8;
}

.apps-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  display: grid;
  grid-template-columns: repeat(2, 5px);
  grid-template-rows: repeat(2, 5px);
  align-content: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.apps-button span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c9d4e5;
}

.apps-button:hover,
.apps-button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

#search-shell {
  align-content: center;
  display: grid;
  justify-items: center;
  row-gap: 0;
  width: min(calc(100% - 36px), 1180px);
  min-height: calc(100vh - 120px);
  padding-block: 0 28px;
}

#search-shell.has-query {
  align-content: start;
  justify-items: start;
  padding-top: 24px;
}

#brand-home {
  display: block;
  margin: 0 0 22px;
  direction: ltr;
  background: linear-gradient(135deg, #f8fbff 0%, #9fd8ff 38%, #62e7d4 72%, #ffd36a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.45));
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(62px, 13vw, 112px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.92;
  text-rendering: geometricPrecision;
}

#brand-home::before {
  display: none;
}

#brand-home:hover {
  color: transparent;
  filter: drop-shadow(0 20px 38px rgba(98, 231, 212, 0.16));
}

.has-query #brand-home {
  margin-bottom: 8px;
  font-size: clamp(40px, 8vw, 64px);
}

#search-form {
  display: grid;
  justify-items: center;
  gap: 24px;
  width: min(100%, 680px);
}

.has-query #search-form {
  justify-items: stretch;
  gap: 0;
  width: min(100%, 760px);
}

.search-box,
#search-form:has(> #search-input) {
  width: min(100%, 528px);
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  min-height: 44px;
  padding: 0 8px;
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(21, 26, 35, 0.88);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.has-query .search-box,
.has-query #search-form:has(> #search-input) {
  width: min(100%, 760px);
  min-height: 52px;
}

.search-box:focus-within,
#search-form:has(> #search-input):focus-within {
  border-color: rgba(98, 231, 212, 0.42);
  box-shadow: 0 0 0 4px rgba(98, 231, 212, 0.1), 0 22px 52px rgba(0, 0, 0, 0.34);
}

#search-input {
  height: 42px;
  padding-inline: 4px 8px;
  color: #f7f9fd;
  font-size: 1rem;
  font-weight: 400;
}

.search-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #8d9bad;
}

.search-icon svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

#search-input::placeholder {
  color: #98a6b9;
}

.search-submit,
.voice-button {
  display: inline-grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: #eef2f8;
  font-size: 0.86rem;
  font-weight: 700;
}

.search-submit:hover,
.voice-button:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  color: #ffffff;
  filter: none;
}

.search-submit svg,
.voice-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  pointer-events: none;
}

.voice-button {
  color: #aab6c7;
}

.voice-button.is-listening {
  border-color: rgba(98, 231, 212, 0.72);
  background: rgba(98, 231, 212, 0.16);
  color: #8af3e5;
  box-shadow: 0 0 0 4px rgba(98, 231, 212, 0.09);
}

.voice-button.is-processing {
  border-color: rgba(159, 216, 255, 0.68);
  background: rgba(106, 168, 255, 0.16);
  color: #9fd8ff;
  box-shadow: 0 0 0 4px rgba(106, 168, 255, 0.08);
}

.voice-button:disabled {
  opacity: 0.45;
}

.search-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

#search-shell.has-query .search-actions {
  display: none;
}

.search-action-button {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: #202839;
  color: #eef2f8;
  font-size: 0.82rem;
  font-weight: 700;
}

.search-action-button:hover,
.search-action-button:focus-visible {
  border-color: rgba(98, 231, 212, 0.42);
  background: #273147;
}

.search-tabs {
  width: min(100%, 680px);
  margin-top: 18px;
  padding: 5px;
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(21, 26, 35, 0.58);
  box-shadow: none;
}

#search-shell:not(.has-query) .search-tabs {
  display: none;
}

#search-shell.has-query .search-tabs {
  display: flex;
}

.has-query .search-tabs {
  width: min(100%, 760px);
}

.search-tab {
  min-width: 62px;
  height: 32px;
  border-radius: 999px;
  color: #aab6c7;
  font-size: 0.76rem;
}

.search-tab:hover,
.search-tab.is-active {
  background: rgba(98, 231, 212, 0.12);
  color: #8af3e5;
}

.search-tab.is-active {
  box-shadow: inset 0 0 0 1px rgba(98, 231, 212, 0.2);
}

#search-layout {
  grid-template-columns: minmax(0, 760px) minmax(210px, 270px);
  gap: 18px;
  width: min(100%, 1050px);
  margin-top: 18px;
}

#result-summary {
  color: #9aa7b8;
  font-size: 0.82rem;
}

#results {
  gap: 11px;
}

.result-card {
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(21, 26, 35, 0.72);
  box-shadow: none;
}

.result-card:hover {
  border-color: rgba(98, 231, 212, 0.42);
  background: rgba(32, 40, 57, 0.86);
  box-shadow: none;
}

.result-address {
  color: #8af3e5;
}

.result-favicon {
  background: rgba(98, 231, 212, 0.1);
  color: #8af3e5;
}

.result-type-badge,
.result-meta-item {
  background: rgba(106, 168, 255, 0.1);
  color: #9fd8ff;
}

.result-title {
  font-size: clamp(1rem, 1.9vw, 1.14rem);
  font-weight: 700;
}

.result-link {
  color: #f4f7fb;
}

.result-link:hover {
  color: #9fd8ff;
}

.result-snippet {
  color: #aab6c7;
}

mark {
  background: rgba(255, 211, 106, 0.22);
  color: #fff3c4;
}

#ad-panel {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(21, 26, 35, 0.62);
  box-shadow: none;
}

.ad-label {
  color: #8d9bad;
}

.ad-card {
  border-color: rgba(98, 231, 212, 0.14);
  background:
    radial-gradient(circle at 100% 0%, rgba(98, 231, 212, 0.14), transparent 7rem),
    linear-gradient(145deg, rgba(32, 40, 57, 0.88), rgba(21, 26, 35, 0.82));
}

.ad-card strong {
  color: #8af3e5;
}

.ad-card span {
  color: #aab6c7;
}

#empty-state,
.error-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(21, 26, 35, 0.68);
}

.empty-icon {
  background: rgba(98, 231, 212, 0.1);
  color: #8af3e5;
}

.empty-description,
.error-description {
  color: #aab6c7;
}

.page-button {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(21, 26, 35, 0.78);
  color: #eef2f8;
}

.page-button:hover:not(:disabled),
.page-button.is-current {
  border-color: rgba(98, 231, 212, 0.42);
  background: rgba(98, 231, 212, 0.12);
  color: #8af3e5;
}

.skeleton-line {
  background: linear-gradient(100deg, #1b2230 20%, #273147 38%, #1b2230 56%);
  background-size: 220% 100%;
}

.site-footer {
  min-height: 40px;
  display: grid;
  place-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #9fd8ff;
  font-size: 0.72rem;
}

.image-preview-panel {
  padding: 0 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  animation: result-enter 320ms both;
}

.image-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.image-preview-title {
  margin: 0;
  color: #eef2f8;
  font-size: 1.24rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.image-preview-more {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(32, 40, 57, 0.72);
  color: #9fd8ff;
  font-size: 0.76rem;
  font-weight: 750;
  text-decoration: none;
}

.image-preview-more:hover {
  border-color: rgba(98, 231, 212, 0.36);
  color: #8af3e5;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.image-preview-tile {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(21, 26, 35, 0.74);
  color: #d8e2f1;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.image-preview-tile:hover {
  border-color: rgba(98, 231, 212, 0.42);
  background: rgba(32, 40, 57, 0.9);
  transform: translateY(-1px);
}

.image-preview-tile:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.image-preview-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 1.35 / 1;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}

.image-preview-tile:first-child img {
  aspect-ratio: 1.58 / 1;
}

.image-preview-caption,
.image-preview-source {
  display: block;
  overflow: hidden;
  padding-inline: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview-caption {
  padding-top: 8px;
  color: #eef2f8;
  font-size: 0.78rem;
  font-weight: 720;
}

.image-preview-source {
  padding-block: 3px 9px;
  color: #9aa7b8;
  direction: ltr;
  font-size: 0.68rem;
}

.has-query #results > .result-card:not(.result-card--asset) {
  padding: 14px 0 17px;
  border-width: 0 0 1px;
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: transparent;
}

.has-query #results > .result-card:not(.result-card--asset):hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: transparent;
  transform: none;
}

.has-query .result-address {
  color: #bdc8d8;
}

.has-query .result-favicon {
  background: rgba(255, 255, 255, 0.08);
  color: #d8e2f1;
}

.has-query .result-link {
  color: #9fc6ff;
}

.has-query .result-link:hover {
  color: #c8dcff;
}

.has-query .result-snippet {
  color: #bdc8d8;
  font-size: 0.82rem;
}

@media (max-width: 760px) {
  .top-bar {
    padding-inline: 14px;
  }

  #search-shell {
    width: min(calc(100% - 24px), 1180px);
    min-height: calc(100vh - 112px);
  }

  #brand-home {
    font-size: clamp(54px, 18vw, 82px);
  }

  .has-query #brand-home {
    font-size: clamp(34px, 11vw, 52px);
  }

  #search-input {
    padding-inline: 16px 8px;
  }

  .search-submit,
  .voice-button {
    width: 34px;
    min-width: 34px;
    padding-inline: 13px;
  }

  .image-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-preview-tile:first-child {
    grid-column: span 2;
    grid-row: span 1;
  }
}
