:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #dfe5ee;
  --accent: #2764e7;
  --accent-dark: #1849b8;
  --soft: #edf3ff;
  --shadow: 0 12px 30px rgba(20, 42, 74, 0.08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  overflow-wrap: anywhere;
}
button, input, textarea, select { font: inherit; }
.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;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10vw;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.brand { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.link-reset { color: inherit; text-decoration: none; }

.container {
  width: 80vw;
  max-width: 1440px;
  margin: 0 auto;
}

.landing-layout,
.single-column-layout {
  padding: 52px 0 64px;
}

.hero { padding: 18px 0 40px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; font-weight: 800; color: var(--accent); }
h1 { font-size: clamp(2.2rem, 4.7vw, 4rem); line-height: 1.08; margin: 10px 0 16px; letter-spacing: -0.04em; }
h2 { margin: 6px 0 16px; font-size: clamp(1.35rem, 2.2vw, 1.75rem); letter-spacing: -0.025em; line-height: 1.25; }
.lead { max-width: 760px; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.12rem); }

.prompt-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin-top: 34px; }
.prompt-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  min-height: 120px;
  padding: 22px;
  text-align: left;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.prompt-card:hover { transform: translateY(-2px); border-color: #b8c8ee; box-shadow: 0 16px 34px rgba(20,42,74,.12); }
.icon { font-size: 1.5rem; flex: 0 0 auto; }

.prompt-composer {
  margin-top: 34px;
  padding: clamp(18px, 2.5vw, 28px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.custom-prompt { display: flex; gap: 10px; align-items: stretch; }
.prompt-combobox { position: relative; flex: 1; min-width: 0; }
.custom-prompt textarea {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 15px 54px 15px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}
.prompt-menu-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--soft);
  color: var(--accent-dark);
  cursor: pointer;
}
.prompt-menu-button::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: -4px auto 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.prompt-menu-button[aria-expanded="true"]::after { margin-top: 4px; transform: rotate(225deg); }
.prompt-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 16px 34px rgba(20,42,74,.16);
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}
.prompt-options[hidden] { display: none; }
.prompt-options button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(20,42,74,.06);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.prompt-options button::after { content: "\203A"; color: var(--accent); font-size: 1.5rem; line-height: 1; }
.prompt-options button:hover,
.prompt-options button:focus-visible,
.prompt-options button.is-active {
  border-color: #b8c8ee;
  background: var(--soft);
  outline: none;
  transform: translateY(-1px);
}
.prompt-options button:disabled {
  cursor: wait;
  color: var(--muted);
  transform: none;
}
.suggested-prompts { margin-top: 28px; }
.suggested-prompts h2 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}
.suggested-prompt-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.suggestion-skeleton {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(90deg, #fff 20%, #edf2f8 45%, #fff 70%);
  background-size: 240% 100%;
  box-shadow: 0 7px 20px rgba(20,42,74,.04);
  animation: suggestion-loading 1.4s ease-in-out infinite;
}
@keyframes suggestion-loading {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
.suggested-prompt-card {
  position: relative;
  width: 100%;
  min-height: 64px;
  padding: 16px 54px 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 7px 20px rgba(20,42,74,.06);
  text-align: left;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.suggested-prompt-card::after {
  content: "\203A";
  position: absolute;
  top: 50%;
  right: 20px;
  color: var(--accent);
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1;
  transform: translateY(-53%);
}
.suggested-prompt-card:hover {
  transform: translateY(-1px);
  border-color: #b8c8ee;
  box-shadow: 0 11px 25px rgba(20,42,74,.1);
}
.suggested-prompt-card:focus-visible { outline: 3px solid #9bc7ff; outline-offset: 2px; }
.primary-btn, .secondary-btn, .read-more-btn, .ad-action {
  border-radius: 12px;
  padding: 13px 19px;
  font-size: .95rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.primary-btn { border: 0; background: var(--accent); color: white; }
.primary-btn:hover { background: var(--accent-dark); }

.breadcrumb { font-size: .86rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.response-card, .rsos-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.response-card { padding: clamp(24px, 3.5vw, 46px); }
.chat-thread { display: grid; gap: 18px; }
.chat-status { min-height: 24px; margin-top: 12px; color: var(--muted); font-size: .9rem; }
.chat-message { width: 100%; }
.chat-message .assistant-label { margin-top: 0; }
.user-message {
  width: min(88%, 980px);
  margin-left: auto;
  background: var(--soft);
  border-color: #cfdbf5;
}
.user-message h1,
.user-message h2 { margin-bottom: 0; }
.related-user-message h2 { font-size: clamp(1.35rem, 2.4vw, 2rem); }
.related-exchange { display: grid; gap: 18px; }
.followup-exchange { display: grid; gap: 18px; }
.typing-cursor {
  display: inline-block;
  width: 8px;
  height: 1.15em;
  margin-left: 3px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: typing-blink .8s steps(1) infinite;
}
@keyframes typing-blink { 50% { opacity: 0; } }
.related-exchange[hidden],
.related-ads[hidden],
.inline-rsos[hidden],
.typing-cursor[hidden] { display: none; }
.screen2-composer {
  position: sticky;
  bottom: 12px;
  z-index: 30;
  margin-top: 24px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 35px rgba(20,42,74,.16);
  backdrop-filter: blur(12px);
}
.followup-select { position: relative; }
.followup-menu-button {
  position: relative;
  width: 100%;
  min-height: 54px;
  padding: 14px 54px 14px 16px;
  border: 1px solid #cdd8ee;
  border-radius: 12px;
  background: #f8faff;
  color: var(--text);
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}
.followup-menu-button::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 20px;
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--accent-dark);
  border-left: 2px solid var(--accent-dark);
  transform: translateY(-25%) rotate(45deg);
}
.followup-menu-button[aria-expanded="true"]::after { transform: translateY(-75%) rotate(225deg); }
.followup-menu-button:disabled { cursor: wait; color: var(--muted); opacity: .8; }
.followup-options {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 -12px 30px rgba(20,42,74,.14);
}
.followup-options[hidden] { display: none; }
.followup-options button {
  width: 100%;
  padding: 13px 15px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 650;
  cursor: pointer;
}
.followup-options button:hover,
.followup-options button:focus-visible { background: var(--soft); outline: none; }
.user-query-label { color: var(--muted); font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.response-card h1 { font-size: clamp(1.9rem, 3.5vw, 3.15rem); max-width: 1100px; }
.assistant-label { margin-top: 28px; margin-bottom: 12px; font-weight: 800; font-size: .95rem; }

.ai-response {
  color: #344054;
  max-width: 1040px;
  font-size: clamp(1rem, 1.25vw, 1.08rem);
  line-height: 1.82;
}
.ai-response p { margin: 0 0 1.15em; }
.ai-response h3 { color: var(--text); font-size: 1.16em; line-height: 1.35; margin: 1.5em 0 .55em; }
.ai-response ul { padding-left: 1.35em; margin: 0 0 1.2em; }
.ai-response li { margin: .4em 0; }
.ai-response strong { color: #202939; }
.ai-response code {
  padding: .12em .35em;
  border-radius: 5px;
  background: #eef2f7;
  color: #202939;
  font-size: .92em;
}

.expandable-copy {
  position: relative;
  transition: max-height .35s ease;
}
.expandable-copy.is-collapsed {
  max-height: 410px;
  overflow: hidden;
}
.expandable-copy.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 110px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 82%);
  pointer-events: none;
}
.read-more-btn {
  margin-top: 10px;
  border: 1px solid #cdd8ee;
  background: #f8faff;
  color: var(--accent-dark);
}
.read-more-btn:hover { background: var(--soft); }

.rsos-card { padding: clamp(22px, 3vw, 34px); margin-top: 24px; }
.section-heading-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.inline-rsos { margin: 26px 0 30px; }
.inline-rsos h2 {
  margin: 0 0 10px;
  color: #565656;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0;
}
.rsos-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.rsos-button {
  width: 100%;
  border: 0;
  background: #087333;
  color: #fff;
  border-radius: 24px;
  padding: 18px 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.35;
  text-align: left;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.rsos-button::before,
.rsos-button::after {
  content: "\203A";
  font-size: 2rem;
  font-weight: 400;
  line-height: .7;
}
.rsos-button:hover { background: #05652c; }
.rsos-button:disabled { cursor: default; opacity: .62; }
.rsos-button:focus-visible { outline: 3px solid #9bc7ff; outline-offset: 2px; }

.search-summary { margin-bottom: 20px; }
.search-summary h1 { font-size: clamp(2.1rem, 4vw, 3.5rem); max-width: 1100px; }
.ad-slot {
  border: 1px solid #d4dbe6;
  background: #fff;
  border-radius: 18px;
  margin: 20px 0;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(20,42,74,.05);
}
.ad-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7a8495; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.ad-content { padding: 20px; }
.ad-rich { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.ad-rich > div { display: flex; flex-direction: column; gap: 3px; }
.ad-content strong { font-size: 1.02rem; }
.ad-content span { color: var(--muted); }
.ad-action { border: 1px solid #cdd8ee; background: #f8faff; color: #1f4fa8; white-space: nowrap; }
.large-ad .ad-content { min-height: 90px; }
.inline-ad .ad-content { min-height: 74px; }
.monetized-response { margin-top: 18px; }

.mock-search-ad {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid #dadce0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(60,64,67,.08);
}
.mock-ad-source {
  margin-bottom: 5px;
  color: #202124;
  font-size: .84rem;
  font-weight: 600;
}
.mock-ad-url {
  margin-bottom: 4px;
  color: #3c4043;
  font-size: .82rem;
}
.mock-ad-title {
  margin: 0 0 7px;
  color: #1a0dab;
  font-size: 1.22rem;
  font-weight: 500;
  line-height: 1.35;
}
.mock-ad-description {
  margin: 0;
  color: #4d5156;
  line-height: 1.55;
}
.mock-ad-sitelinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  color: #1a0dab;
  font-size: .9rem;
  font-weight: 500;
}

@media (max-width: 1100px) {
  .container { width: 88vw; }
  .topbar { padding-left: 6vw; padding-right: 6vw; }
}

@media (max-width: 760px) {
  body { line-height: 1.62; }
  .container { width: calc(100% - 32px); }
  .topbar { min-height: 64px; padding: 0 16px; }
  .brand { font-size: 1.05rem; }
  .landing-layout, .single-column-layout { padding: 30px 0 44px; }
  .hero { padding-top: 4px; }
  h1 { font-size: clamp(2rem, 9vw, 2.75rem); }
  .response-card h1, .search-summary h1 { font-size: clamp(1.75rem, 8vw, 2.45rem); }
  .lead { font-size: 1rem; }
  .prompt-grid { grid-template-columns: 1fr; gap: 13px; margin-top: 26px; }
  .prompt-card { min-height: 92px; padding: 18px; border-radius: 15px; font-size: .98rem; }
  .custom-prompt { flex-direction: column; }
  .prompt-composer { margin-top: 26px; padding: 16px; border-radius: 16px; }
  .prompt-combobox, .custom-prompt textarea, .primary-btn { width: 100%; min-height: 50px; }
  .response-card { padding: 22px 18px; border-radius: 16px; }
  .user-message { width: 94%; }
  .assistant-label { margin-top: 22px; }
  .ai-response { font-size: 1rem; line-height: 1.72; }
  .expandable-copy.is-collapsed { max-height: 360px; }
  .expandable-copy.is-collapsed::after { height: 95px; }
  .read-more-btn { width: 100%; min-height: 48px; }
  .rsos-card { padding: 20px 18px; border-radius: 16px; }
  .section-heading-row { flex-direction: column; }
  .inline-rsos { margin: 22px 0 26px; }
  .rsos-button { border-radius: 18px; padding: 15px 14px; font-size: .98rem; gap: 10px; }
  .ad-rich { flex-direction: column; align-items: stretch; }
  .ad-action { width: 100%; min-height: 46px; }
  .mock-search-ad { padding: 17px 16px; }
  .mock-ad-title { font-size: 1.08rem; }
  .mock-ad-sitelinks { flex-direction: column; gap: 5px; }
  .breadcrumb { white-space: normal; line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .suggestion-skeleton { background: #f4f6f9; }
}

@media (max-width: 390px) {
  .container { width: calc(100% - 24px); }
  .topbar { padding: 0 12px; }
  .response-card, .rsos-card { padding-left: 16px; padding-right: 16px; }
  .ai-response { font-size: .97rem; }
  .prompt-card { padding: 16px; }
}
