/* Homepage-only refinement. The gateway behavior remains untouched. */
body[data-route="search"] {
  --home-ink: #17191f;
  --home-paper: #f4f5f7;
  --home-panel: #ffffff;
  --home-line: #d9dde5;
  --home-muted: #69707d;
  --home-blue: #195ee8;
  --home-blue-dark: #1045b3;
  --home-green: #168c5a;
  background: var(--home-paper);
  color: var(--home-ink);
}

[data-theme="dark"] body[data-route="search"] {
  --home-ink: #f3f5f8;
  --home-paper: #0d0f13;
  --home-panel: #15181e;
  --home-line: #2d323c;
  --home-muted: #9ca4b2;
  --home-blue: #73a2ff;
  --home-blue-dark: #a9c3ff;
  --home-green: #5ed39a;
}

body[data-route="search"]::before,
body[data-route="search"]::after,
body[data-route="search"] .bg-field,
body[data-route="search"] .taskbar-left,
body[data-route="search"] .os-footer,
body[data-route="search"] .bottom-nav {
  display: none !important;
}

body[data-route="search"] .app-shell {
  min-height: 100dvh;
  padding: 0;
}

body[data-route="search"] .os-header {
  left: auto;
  right: 20px;
  top: 16px;
  width: auto;
  height: 40px;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

body[data-route="search"] .os-header::before,
body[data-route="search"] .os-header::after,
body[data-route="search"] .os-header .header-left {
  display: none;
}

body[data-route="search"] .os-header .header-actions {
  display: flex;
}

body[data-route="search"] .os-header .h-action {
  width: 40px;
  height: 40px;
  border: 1px solid var(--home-line);
  border-radius: 6px;
  background: var(--home-panel);
  color: var(--home-muted);
}

body[data-route="search"] .apps-shortcut {
  display: flex;
  top: 16px;
  left: 20px;
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--home-line);
  border-radius: 6px;
  background: var(--home-panel);
  color: var(--home-ink);
  backdrop-filter: none;
  box-shadow: none;
}

body[data-route="search"] .shell-content {
  max-width: none;
  min-height: 100dvh;
  padding: 0;
}

body[data-route="search"] .main-body {
  min-height: 100dvh;
}

#rgRoot {
  min-height: 100dvh;
  background: var(--home-paper);
  color: var(--home-ink);
  font-family: "Montserrat", "Avenir Next", "Segoe UI", sans-serif;
}

#rgRoot .stage {
  width: min(760px, calc(100% - 40px));
  min-height: 100dvh;
  justify-content: center;
  padding: 96px 0 110px;
}

#rgRoot.has-result .stage {
  min-height: auto;
  padding-top: 96px;
}

#rgRoot .brandmark {
  margin-bottom: 28px;
}

#rgRoot .brandmark-logo {
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
}

#rgRoot .brandmark h1 {
  color: var(--home-ink);
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: 46px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
}

#rgRoot .brandmark h1 span {
  color: var(--home-blue);
  -webkit-text-fill-color: currentColor;
}

#rgRoot .tagline {
  max-width: 520px;
  margin: 13px auto 0;
  color: var(--home-muted);
  font-size: 14px;
  line-height: 1.6;
}

#rgRoot .quick-menu {
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--home-line);
  border-radius: 6px;
  background: var(--home-panel);
}

#rgRoot .quick-menu-item {
  min-height: 34px;
  padding: 7px 14px;
  border: 0;
  border-radius: 4px !important;
  background: transparent;
  color: var(--home-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
}

#rgRoot .quick-menu-item:hover {
  border: 0;
  background: var(--home-paper);
  color: var(--home-ink);
  box-shadow: none;
}

#rgRoot .quick-menu-item.is-current {
  background: var(--home-ink);
  color: var(--home-panel);
}

#rgRoot .workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--home-muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
}

#rgRoot .runtime-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--home-green);
}

#rgRoot .runtime-state i {
  width: 7px;
  height: 7px;
  border-radius: 50% !important;
  background: currentColor;
}

#rgRoot .search-pill {
  min-height: 76px;
  align-items: flex-start;
  padding: 20px;
  border: 1px solid var(--home-line);
  border-radius: 6px !important;
  background: var(--home-panel);
  box-shadow: 0 14px 40px rgba(29, 34, 44, .08);
  backdrop-filter: none;
}

#rgRoot .search-pill:focus-within {
  border-color: var(--home-blue);
  box-shadow: 0 0 0 3px rgba(25, 94, 232, .12), 0 18px 44px rgba(29, 34, 44, .1);
}

#rgRoot .search-pill textarea {
  min-height: 34px;
  padding: 0;
  color: var(--home-ink);
  font-size: 15px;
  line-height: 1.65;
}

#rgRoot .pill-icon,
#rgRoot .pill-icon-btn,
#rgRoot .hint-text {
  color: var(--home-muted);
}

#rgRoot .pill-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 5px !important;
}

#rgRoot .pill-icon-btn:hover {
  background: var(--home-paper);
  color: var(--home-blue);
}

#rgRoot .hint-row {
  padding: 8px 2px 0;
}

#rgRoot .button-row {
  justify-content: flex-start;
  gap: 8px;
  margin-top: 14px;
}

#rgRoot .google-btn,
#rgRoot .output-select select {
  min-height: 42px;
  border: 1px solid var(--home-line);
  border-radius: 5px !important;
  background: var(--home-panel);
  color: var(--home-ink);
  box-shadow: none;
}

#rgRoot .google-btn.primary {
  background: var(--home-blue);
  border-color: var(--home-blue);
  color: #fff;
}

#rgRoot .google-btn.primary:hover {
  background: var(--home-blue-dark);
  border-color: var(--home-blue-dark);
  box-shadow: none;
}

#rgRoot .progress-panel,
#rgRoot .result-panel,
#rgRoot .camera-panel {
  border: 1px solid var(--home-line);
  border-radius: 6px !important;
  background: var(--home-panel);
  color: var(--home-ink);
  box-shadow: 0 14px 40px rgba(29, 34, 44, .08);
  backdrop-filter: none;
}

#rgRoot .progress-panel {
  padding: 16px 18px;
}

#rgRoot .progress-cancel {
  border-color: var(--home-line);
  border-radius: 5px !important;
  color: var(--home-muted);
}

#rgRoot .result-head h2 {
  font-size: 21px;
  letter-spacing: 0;
}

#rgRoot .eyebrow {
  color: var(--home-blue);
}

#rgRoot .result-content,
#rgRoot .pipeline span,
#rgRoot .route-item {
  border-color: var(--home-line);
  border-radius: 5px !important;
  background: var(--home-paper);
  color: var(--home-ink);
}

@media (max-width: 640px) {
  body[data-route="search"] .os-header {
    top: 10px;
    right: 10px;
  }

  body[data-route="search"] .apps-shortcut {
    top: 10px;
    left: 10px;
    height: 40px;
  }

  #rgRoot .stage {
    width: min(100% - 24px, 760px);
    justify-content: flex-start;
    padding: 92px 0 116px;
  }

  #rgRoot .brandmark {
    margin-bottom: 22px;
  }

  #rgRoot .brandmark h1 {
    font-size: 38px;
  }

  #rgRoot .quick-menu {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  #rgRoot .quick-menu-item {
    flex: 0 0 auto;
    padding: 7px 11px;
  }

  #rgRoot .search-pill {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 16px;
  }

  #rgRoot .pill-actions {
    grid-column: 2;
    justify-content: flex-end;
  }

  #rgRoot .button-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  #rgRoot .google-btn.primary {
    grid-column: 1 / -1;
  }

  #rgRoot .output-select,
  #rgRoot .output-select select {
    width: 100%;
  }
}

@media (max-width: 380px) {
  #rgRoot .workspace-heading {
    display: block;
  }

  #rgRoot .runtime-state {
    margin-top: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #rgRoot *,
  body[data-route="search"] * {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
