:root {
  color-scheme: light dark;
  --page: #f8f9fa;
  --surface: #fff;
  --ink: #111;
  --muted: #5f6368;
  --line: #dfe1e5;
  --soft-line: #eceff1;
  --hover: rgba(0, 0, 0, 0.04);
  --input-shadow: 0 1px 5px rgba(60, 64, 67, 0.16);
  --focus-ring: rgba(255, 245, 0, 0.55);
  --yellow: #fff500;
  --yellow-ink: #9a9400;
  --link: #1a0dab;
  --url: #0b7a2a;
  --snippet: #3c4043;
  --popover-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  --font-hand: "Segoe Print", "Comic Sans MS", cursive;
  --font-ui: "Segoe UI", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #202124;
    --surface: #303134;
    --ink: #e8eaed;
    --muted: #bdc1c6;
    --line: #3c4043;
    --soft-line: #303134;
    --hover: rgba(255, 255, 255, 0.08);
    --input-shadow: 0 1px 6px rgba(0, 0, 0, 0.36);
    --focus-ring: rgba(255, 245, 0, 0.36);
    --yellow-ink: #fff500;
    --link: #8ab4f8;
    --url: #81c995;
    --snippet: #e8eaed;
    --popover-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
  }
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-ui);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  background: var(--page);
}

.site-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px clamp(16px, 4vw, 48px);
  pointer-events: none;
}

.brand-button {
  width: 148px;
  height: 56px;
  border: 0;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.brand-button img {
  width: 148px;
  height: 56px;
  object-fit: contain;
}

.home-view {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  padding: 32px 18px 16vh;
}

.home-logo {
  width: min(292px, 72vw);
  height: auto;
}

.search-form {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
}

.home-search {
  max-width: 720px;
}

.results-search {
  max-width: 820px;
}

.search-form input {
  width: 100%;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface);
  padding: 0 18px;
  color: var(--ink);
  outline: none;
  box-shadow: var(--input-shadow);
}

.search-form input::placeholder {
  color: var(--muted);
}

.search-form input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.search-button {
  width: 44px;
  height: 44px;
  border: 1px solid #e4dc00;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--yellow);
}

.search-button img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.more-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  line-height: 1;
  pointer-events: auto;
}

.more-button:hover,
.brand-button:hover {
  background: var(--hover);
}

.results-view {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.results-top {
  min-height: 70px;
  display: grid;
  grid-template-columns: 118px minmax(0, 820px) 44px;
  align-items: center;
  column-gap: 0;
  padding: 0 0 10px;
}

.result-brand {
  grid-column: 1;
  justify-self: start;
  width: 142px;
  height: 61px;
}

.results-search {
  grid-column: 2;
  max-width: none;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 30px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}

.tab {
  height: 42px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 0 2px;
  font-family: var(--font-hand);
}

.tab.active {
  color: var(--yellow-ink);
  border-bottom-color: var(--yellow-ink);
}

.summary-panel,
.results-panel {
  background: transparent;
}

.summary-panel {
  margin: 18px 0 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--soft-line);
}

.results-panel {
  padding-top: 14px;
}

h2 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.summary-panel p,
.status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.summary-source {
  display: inline-block;
  margin-top: 10px;
  color: var(--link);
  font-size: 13px;
  text-decoration: none;
}

.summary-source:hover {
  text-decoration: underline;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

#resultCount {
  color: var(--muted);
  font-size: 13px;
}

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

.results-list--images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.results-list--videos {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.result-item {
  max-width: 760px;
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--soft-line);
}

.result-item--images,
.result-item--videos {
  max-width: none;
  padding: 0;
  border-bottom: 0;
}

.result-title {
  color: var(--link);
  font-size: 19px;
  line-height: 1.25;
  text-decoration: none;
}

.result-title:hover {
  text-decoration: underline;
}

.result-url {
  display: block;
  margin-top: 4px;
  color: var(--url);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.result-snippet {
  margin: 6px 0 0;
  color: var(--snippet);
  font-size: 14px;
  line-height: 1.45;
}

.image-card,
.video-card {
  color: inherit;
  text-decoration: none;
}

.image-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--input-shadow);
}

.image-card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--soft-line);
}

.image-card__body {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.image-card__title {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.image-card__meta {
  color: var(--muted);
  font-size: 12px;
}

.video-card {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--input-shadow);
}

.video-card__thumb-wrap {
  position: relative;
}

.video-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  background: var(--soft-line);
}

.video-card__duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.video-card__body {
  display: grid;
  align-content: start;
  gap: 8px;
}

.video-card__title {
  color: var(--link);
  font-size: 18px;
  line-height: 1.3;
}

.video-card__meta {
  color: var(--muted);
  font-size: 13px;
}

.video-card__snippet {
  margin: 0;
  color: var(--snippet);
  font-size: 14px;
  line-height: 1.45;
}

.services-popover {
  position: fixed;
  top: 58px;
  right: clamp(12px, 4vw, 46px);
  z-index: 30;
  width: 280px;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--popover-shadow);
}

.service {
  width: 96px;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: 11px;
  text-align: center;
  text-decoration: none;
}

.service img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

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

[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .site-bar {
    height: 64px;
    padding-inline: 12px;
  }

  .brand-button,
  .brand-button img {
    width: 124px;
    height: 48px;
  }

  .home-view {
    min-height: 100vh;
    padding-bottom: 18vh;
  }

  .search-form {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
  }

  .search-form input,
  .search-button {
    height: 42px;
  }

  .search-button {
    width: 42px;
  }

  .results-view {
    width: min(100% - 24px, 1040px);
    padding-top: 72px;
  }

  .results-top {
    min-height: 96px;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0 0 10px;
    row-gap: 8px;
  }

  .result-brand {
    grid-column: 1;
  }

  .results-search {
    grid-column: 1;
  }

  .tabs {
    gap: 24px;
    overflow-x: auto;
  }

  .result-title {
    font-size: 17px;
  }

  .results-list--images {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .video-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }
}
