:root {
  --bg: #ffffff;
  --sidebar: #f9f9f9;
  --surface: #ffffff;
  --surface-soft: #f7f7f8;
  --hover: #ececec;
  --border: rgba(0, 0, 0, 0.08);
  --text: #0d0d0d;
  --muted: #6f6f6f;
  --muted-2: #8b8b8b;
  --assistant: #ffffff;
  --user: #f4f4f4;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --green: #10a37f;
  --green-hover: #0d8c6d;
  --blue: #1f6feb;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

img {
  display: block;
}

button {
  border: 0;
  background: transparent;
  color: inherit;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar-top {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.sidebar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-icon-btn,
.top-icon-btn,
.composer-aux,
.composer-tool,
.composer-ghost,
.send-btn,
.google-fab,
.primary-action,
.top-pill-btn,
.model-chip,
.new-chat-btn,
.sidebar-search,
.nav-item,
.thread-item,
.footer-item,
.suggestion-card {
  cursor: pointer;
}

.sidebar-icon-btn,
.top-icon-btn,
.composer-aux,
.composer-tool,
.composer-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
}

.sidebar-icon-btn:hover,
.top-icon-btn:hover,
.composer-aux:hover,
.composer-tool:hover,
.composer-ghost:hover,
.new-chat-btn:hover,
.sidebar-search:hover,
.nav-item:hover,
.thread-item:hover,
.footer-item:hover,
.suggestion-card:hover,
.top-pill-btn:hover,
.model-chip:hover {
  background: var(--hover);
}

.brand-favicon,
.logo-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.logo-mark-wrap {
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
}

.logo-mark {
  width: 28px;
  height: 28px;
}

.new-chat-btn,
.sidebar-search,
.nav-item,
.thread-item,
.footer-item,
.model-chip,
.top-pill-btn,
.suggestion-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  text-align: left;
  color: var(--text);
}

.new-chat-btn {
  justify-content: flex-start;
  background: transparent;
  /* border: 0; */
  /* font-weight: 500; */
  font-size: 16px;
  line-height: 20px;
}

.sidebar-search,
.nav-item,
.footer-item,
.thread-item {
  font-size: 16px;
  line-height: 20px;
}

.nav-item,
.footer-item,
.sidebar-search,
.thread-item {
  background: transparent;
}

.btn-icon,
.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #545454;
  flex: 0 0 auto;
}

.icon {
  fill: currentColor;
}

.sidebar-section-title {
  padding: 8px 12px 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-nav,
.thread-list,
.sidebar-footer {
  display: grid;
  gap: 2px;
}

.active-thread {
  background: #ececec;
}

.thread-item {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d6e4ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #234;
  flex: 0 0 auto;
}

.footer-avatar.small {
  background: #ececec;
  font-size: 12px;
}

.frozen {
  user-select: none;
}

.main-area {
  min-width: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr) auto;
  position: relative;
  background: var(--bg);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-right {
  justify-content: flex-end;
}

.topbar-center {
  min-height: 1px;
}

.model-chip,
.top-pill-btn {
  width: auto;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 16px;
  line-height: 20px;
}

.model-chip {
  gap: 8px;
  font-weight: 500;
}

.chip-caret {
  color: var(--muted);
  font-size: 12px;
}

.top-pill-btn {
  gap: 8px;
  padding-inline: 12px;
  color: #3d3d3d;
}

.top-pill-label {
  font-size: 13px;
  color: #3d3d3d;
}

.mobile-only {
  display: none;
}

.chat-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 0 18px 22px;
}

.chat-scroll::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  width: 10px;
}

.chat-scroll::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.chat-messages {
  max-width: 768px;
  margin: 0 auto;
  padding: 28px 0 128px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.empty-state {
  max-width: 820px;
  margin: 10vh auto 0;
  text-align: center;
}

.empty-state.hidden {
  display: none;
}

.empty-state h1 {
  margin: 0 0 24px;
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.suggestion-card {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  min-height: 96px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 16px;
}

.suggestion-title {
  font-size: 15px;
  font-weight: 600;
}

.suggestion-copy {
  font-size: 13px;
  line-height: 18px;
  color: var(--muted);
}

.message-row {
  display: flex;
  width: 100%;
  align-items: flex-start;
}

.message-row.user {
  justify-content: flex-end;
}

.message-body {
  min-width: 0;
  width: 100%;
}

.assistant-body {
  max-width: 100%;
}

.user-body {
  width: auto;
  max-width: min(85%, 620px);
}

.message-bubble {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
  font-size: 15px;
  color: var(--text);
}

.message-bubble.assistant {
  background: transparent;
  padding: 2px 0;
  font-family: system-ui, sans-serif;
  font-size: 1rem; /* 16px */
  line-height: 1.5;
  white-space: normal;
}

.message-bubble.user {
  background: var(--user);
  border-radius: 24px;
  padding: 14px 18px;
  font-family: system-ui, sans-serif;
  font-size: 1rem; /* 16px */
  line-height: 1.5;
}

.message-actions {
  display: flex;
  gap: 2px;
  align-items: center;
  min-height: 34px;
  margin-top: 7px;
}

.user-message-actions {
  justify-content: flex-end;
  min-height: 30px;
  margin-top: 2px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.message-row.user:hover .user-message-actions,
.message-row.user:focus-within .user-message-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.message-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  border-radius: 8px;
  line-height: 1;
  cursor: pointer;
}

.message-action-btn:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

.message-action-btn svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.message-action-btn.copied,
.message-action-btn.selected {
  color: var(--text);
  background: rgba(15, 23, 42, 0.07);
}

.message-bubble.loading {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.message-bubble.loading span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a3a3a3;
  animation: pulseDots 1.2s infinite ease-in-out;
}

.message-bubble.loading span:nth-child(2) {
  animation-delay: 0.16s;
}

.message-bubble.loading span:nth-child(3) {
  animation-delay: 0.32s;
}

.message-bubble.typing::after {
  content: "▍";
  margin-left: 2px;
  color: #777;
  animation: blinkCursor 1s step-end infinite;
}

.composer-zone {
  position: relative;
  padding: 14px 18px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.92) 24%, rgba(255, 255, 255, 1) 54%);
}

.composer-shell {
  max-width: 768px;
  margin: 0 auto;
}

.composer-top-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.composer-tool {
  padding: 0 8px;
  font-size: 13px;
  color: #4d4d4d;
}

.composer-form {
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  padding: 10px 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

#chat-input {
  width: 100%;
  min-height: 28px;
  max-height: 220px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 8px 2px;
  font-size: 15px;
  line-height: 24px;
}

#chat-input::placeholder {
  color: #8b8b8b;
}

.composer-leading-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.composer-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: #5f5f5f;
}

.composer-circle:hover,
.composer-tool:hover {
  background: rgba(0, 0, 0, 0.05);
}

.composer-plus {
  font-size: 22px;
  line-height: 1;
}

.plus-glyph {
  transform: translateY(-1px);
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.send-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #0f0f0f;
  color: white;
  font-weight: 700;
}

.send-btn:hover,
.primary-action:hover {
  background: #2a2a2a;
}

.send-btn:disabled,
.google-fab:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.composer-bottom-note {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  line-height: 16px;
  color: #8b8b8b;
}

.google-fab {
  position: absolute;
  right: 24px;
  top: -60px;
  bottom: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: #1f2937;
  z-index: 10;
}

.google-fab:hover {
  background: #f8fafc;
}

.google-g {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4285f4, #34a853, #fbbc05, #ea4335);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.28);
  z-index: 60;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: min(680px, 100%);
  max-height: min(86vh, 900px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16);
  padding: 28px;
  overflow-y: auto;
}

#modal-content {
  min-height: 0;
}

.modal-inner {
  min-height: 0;
}

.modal-title {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.modal-title--step {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.modal-copy,
.modal-note,
.instruction-list,
.choice-item,
.modal-textarea {
  font-size: 15px;
  line-height: 1.7;
}

.modal-copy {
  margin: 0 0 12px;
  color: #2f2f2f;
}

.modal-note {
  color: var(--muted);
}

.instruction-list {
  margin: 0 0 16px 22px;
  color: #2f2f2f;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.primary-action {
  padding: 11px 16px;
  border-radius: 14px;
  background: var(--green);
  color: white;
}

.modal-textarea {
  width: 100%;
  min-height: 130px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  resize: vertical;
  outline: none;
}

.semantic-scale-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.semantic-scale-row {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.semantic-scale-header {
  display: grid;
  grid-template-columns: repeat(var(--semantic-point-count), minmax(24px, 1fr));
  gap: 6px;
  color: #34373b;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
}

.semantic-scale-header span:first-child {
  text-align: left;
}

.semantic-scale-header span:last-child {
  text-align: right;
}

.semantic-scale-points {
  display: grid;
  grid-template-columns: repeat(var(--semantic-point-count), minmax(24px, 1fr));
  gap: 6px;
}

.semantic-scale-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  cursor: pointer;
}

.semantic-scale-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.semantic-scale-dot {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1.5px solid #8a8f98;
  border-radius: 50%;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.semantic-scale-option:hover .semantic-scale-dot {
  border-color: #202123;
}

.semantic-scale-option input:focus-visible + .semantic-scale-dot {
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.18);
}

.semantic-scale-option input:checked + .semantic-scale-dot {
  border: 5px solid #202123;
}

@media (max-width: 680px) {
  .semantic-scale-row {
    gap: 8px;
    padding: 11px 10px;
  }

  .semantic-scale-header,
  .semantic-scale-points {
    gap: 2px;
  }

  .semantic-scale-option {
    min-width: 0;
  }
}

.survey-illustration {
  margin: 16px 0 20px;
}

.survey-illustration img {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  object-position: top center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f7f7;
}

.survey-illustration figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.extension-gate-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafafa;
}

.extension-gate-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.extension-gate-indicator {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 50%;
  background: #c8c8c8;
  box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.04);
}

.extension-gate-indicator.is-ready {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(16, 163, 127, 0.12);
}

.extension-gate-actions {
  align-items: center;
}

.secondary-action,
.extension-store-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.primary-action.extension-store-link {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.choice-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.choice-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fafafa;
}

.choice-item input {
  margin-top: 6px;
}

.resume-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: #f8fafc;
}

.resume-card {
  width: min(520px, calc(100% - 32px));
  padding: 28px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.resume-card h1 {
  margin-top: 0;
  font-size: 28px;
}

.resume-form {
  display: grid;
  flex: 0 0 auto;
}

.resume-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
}

.resume-submit {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--green);
  color: white;
}

.resume-error {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 72px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  padding-inline: 10px;
}

body.sidebar-collapsed .sidebar-header-row {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-header-row .sidebar-icon-btn:first-child {
  display: none;
}

body.sidebar-collapsed .sidebar .new-chat-btn span:last-child,
body.sidebar-collapsed .sidebar .sidebar-search span:last-child,
body.sidebar-collapsed .sidebar .nav-item span:last-child,
body.sidebar-collapsed .sidebar .thread-item,
body.sidebar-collapsed .sidebar .sidebar-section-title,
body.sidebar-collapsed .sidebar .top-pill-label,
body.sidebar-collapsed .sidebar .footer-item span:last-child {
  display: none;
}

body.sidebar-collapsed .sidebar .new-chat-btn,
body.sidebar-collapsed .sidebar .sidebar-search,
body.sidebar-collapsed .sidebar .nav-item,
body.sidebar-collapsed .sidebar .footer-item {
  justify-content: center;
  padding-inline: 10px;
}

@keyframes pulseDots {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: scale(0.86);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes blinkCursor {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    max-width: calc(100vw - 52px);
    transform: translateX(-100%);
    z-index: 70;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-only {
    display: inline-flex;
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
  }

  .suggestion-grid {
    grid-template-columns: 1fr;
  }

  .google-fab {
    right: 16px;
  }
}

.composer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 2px;
}

.logged-out-footer {
  padding-top: 8px;
}

.login-avatar {
  background: #ececec;
  color: #4b5563;
}

.sponsor-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ececec;
  color: #5f5f5f;
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}

.task-hint-box {
  margin: 14px 0 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7f7f8;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.task-hint-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 6px;
}

.task-hint-copy {
  color: var(--text);
  line-height: 1.5;
}


.message-bubble.assistant p {
  margin: 0 0 0.65em;
}

.message-bubble.assistant p:last-child {
  margin-bottom: 0;
}

.message-bubble.assistant ul,
.message-bubble.assistant ol {
  margin: 0.5em 0 0.85em 1.4em;
  padding: 0;
}

.message-bubble.assistant li {
  margin: 0.25em 0;
}

.message-bubble.assistant strong {
  font-weight: 600;
}

.message-bubble.assistant em {
  font-style: italic;
}

.message-bubble.assistant code {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  padding: 0.15em 0.35em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.message-bubble.assistant pre {
  margin: 0.85em 0;
  padding: 12px 14px;
  overflow-x: auto;
  border-radius: 14px;
  background: #f7f7f8;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.message-bubble.assistant pre code {
  background: transparent;
  border-radius: 0;
  padding: 0;
  font-size: 0.92em;
}

.message-bubble.assistant blockquote {
  margin: 0.85em 0;
  padding: 0 0 0 12px;
  border-left: 3px solid rgba(0, 0, 0, 0.14);
  color: #4b5563;
}

.message-bubble.assistant a {
  color: #2563eb;
  text-decoration: none;
}

.message-bubble.assistant a:hover {
  text-decoration: underline;
}

.message-bubble.assistant hr {
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin: 1em 0;
}

.sponsor-badge {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}


.search-body {
  overflow-y: auto;
  background: #fff;
  color: #202124;
  font-family: Arial, sans-serif;
}

.search-app-shell {
  min-height: 100vh;
  background: #fff;
}

.search-topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 24px 12px;
  border-bottom: 1px solid #f1f3f4;
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.search-back-btn {
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

.search-back-btn:hover,
.search-submit-btn:hover {
  background: #f8f9fa;
}

.search-form {
  flex: 1;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  border: 1px solid #dfe1e5;
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: 0 1px 6px rgba(32,33,36,.08);
}

.search-input-wrap:focus-within {
  box-shadow: 0 2px 8px rgba(32,33,36,.16);
}

.search-input-icon {
  color: #9aa0a6;
  font-size: 16px;
}

#search-query-input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 16px;
  line-height: 22px;
  color: #202124;
}

.search-submit-btn {
  border-radius: 999px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}

.search-main {
  max-width: 840px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.search-logo {
  margin-bottom: 18px;
  font-size: 54px;
  font-weight: 500;
  letter-spacing: -0.04em;
  text-align: left;
}

.g-blue { color: #4285f4; }
.g-red { color: #ea4335; }
.g-yellow { color: #fbbc05; }
.g-green { color: #34a853; }

.search-status {
  color: #5f6368;
  font-size: 14px;
  margin-bottom: 20px;
}

.search-results {
  display: grid;
  gap: 18px;
}

.search-result-card,
.search-empty-card {
  padding: 2px 0 10px;
}

.search-result-source {
  font-size: 14px;
  color: #202124;
  margin-bottom: 4px;
}

.search-result-title {
  display: block;
  padding: 0;
  color: #1a0dab;
  background: transparent;
  font-size: 22px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

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

.search-result-snippet {
  margin: 6px 0 0;
  color: #4d5156;
  font-size: 14px;
  line-height: 1.58;
}

.search-result-meta {
  margin-top: 6px;
  color: #9aa0a6;
  font-size: 12px;
}

.search-empty-title {
  font-size: 20px;
  color: #202124;
  margin-bottom: 8px;
}

.search-empty-copy {
  font-size: 14px;
  color: #5f6368;
}

@media (max-width: 720px) {
  .search-topbar {
    flex-direction: column;
    align-items: stretch;
    padding-inline: 16px;
  }

  .search-main {
    padding-inline: 16px;
  }

  .search-logo {
    font-size: 42px;
  }

  .search-result-title {
    font-size: 20px;
  }
}
/* Controlled Google-like search page */
.google-page-body {
  margin: 0;
  min-height: 100vh;
  background: #fff;
  color: #202124;
  font-family: Arial, Helvetica, sans-serif;
  overflow-y: auto;
  overflow-x: hidden;
}

.google-page-shell {
  min-height: 100vh;
  background: #fff;
}

.google-page-body .google-page-shell {
  min-height: 100vh;
}

.google-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid #dadce0;
  backdrop-filter: blur(8px);
}

.google-topbar-main {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 24px 10px;
}

.google-logo-link {
  text-decoration: none;
  flex: 0 0 auto;
}

.google-wordmark {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -1px;
  line-height: 1;
  white-space: nowrap;
}

.g-blue { color: #4285f4; }
.g-red { color: #ea4335; }
.g-yellow { color: #fbbc05; }
.g-green { color: #34a853; }

.google-searchbar-form {
  flex: 1 1 auto;
  max-width: 720px;
}

.google-searchbar-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #dfe1e5;
  border-radius: 999px;
  box-shadow: 0 1px 6px rgba(32,33,36,0.16);
  background: #fff;
}

.google-searchbar-shell:focus-within {
  box-shadow: 0 1px 6px rgba(32,33,36,0.28);
}

.google-searchbar-icon,
.google-searchbar-action,
.google-top-icon,
.google-tab,
.google-back-chat-btn,
.google-result-menu,
.google-result-sitelinks button,
.google-kp-chip,
.google-related-chip,
.google-pagination-links button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.google-searchbar-icon,
.google-searchbar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #5f6368;
  border-radius: 999px;
}

.google-searchbar-action:hover,
.google-top-icon:hover,
.google-tab:hover,
.google-result-menu:hover,
.google-result-sitelinks button:hover,
.google-kp-chip:hover,
.google-related-chip:hover,
.google-pagination-links button:hover {
  background: rgba(60,64,67,0.08);
}

.google-searchbar-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 16px;
  color: #202124;
  background: transparent;
}

.google-searchbar-divider {
  width: 1px;
  height: 24px;
  background: #dadce0;
}

.google-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.google-top-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
}

.google-back-chat-btn {
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: #1a73e8;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.google-back-chat-btn:hover {
  background: #185abc;
}

.google-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 24px 0 144px;
  overflow-x: auto;
}

.google-tab {
  position: relative;
  padding: 14px 12px 13px;
  color: #5f6368;
  font-size: 14px;
  white-space: nowrap;
}

.google-tab.active {
  color: #202124;
  font-weight: 500;
}

.google-tab.active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #202124;
}

.google-results-shell {
  display: grid;
  grid-template-columns: minmax(0, 680px) 360px;
  gap: 34px;
  align-items: start;
  padding: 14px 24px 48px 144px;
}

.google-results-column {
  min-width: 0;
}

.google-results-meta {
  color: #70757a;
  font-size: 14px;
  min-height: 24px;
  margin: 6px 0 18px;
}

.google-results-list {
  display: grid;
  gap: 26px;
}

.google-result-card {
  width: 100%;
}

.google-result-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 24px;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.google-result-favicon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f1f3f4;
  color: #5f6368;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
}

.google-result-favicon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
}

.google-result-favicon-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.google-result-source-wrap {
  min-width: 0;
}

.google-result-source-title {
  font-size: 14px;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.google-result-source-line {
  font-size: 12px;
  color: #5f6368;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.google-result-menu {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
}

.google-result-link {
  padding: 0;
  text-align: left;
  font-size: 22px;
  line-height: 1.3;
  color: #1a0dab;
  text-decoration: none;
}

.google-result-link:hover {
  text-decoration: underline;
}

.google-result-snippet {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.58;
  color: #4d5156;
}

.google-result-sitelinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.google-result-sitelinks button {
  padding: 0;
  font-size: 14px;
  color: #1a0dab;
}

.google-knowledge-panel {
  position: sticky;
  top: 112px;
}

.google-kp-card {
  border: 1px solid #dadce0;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(60,64,67,0.08);
}

.google-kp-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.google-kp-mark {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: #f1f3f4;
  color: #202124;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 600;
}

.google-kp-title {
  font-size: 30px;
  line-height: 1.15;
  color: #202124;
}

.google-kp-subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: #5f6368;
}

.google-kp-gallery {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 8px;
  margin-bottom: 14px;
}

.google-kp-image,
.google-kp-image.small,
.google-kp-image.primary,
.google-kp-image.muted {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(135deg, #eceff1, #dfe7f1);
  min-height: 148px;
}

.google-kp-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.google-kp-image.primary {
  min-height: 210px;
}

.google-kp-image-stack {
  display: grid;
  gap: 8px;
}

.google-kp-image.small {
  min-height: 101px;
}

.google-kp-image.muted,
.google-kp-image.image-failed,
.google-kp-image-placeholder {
  background: linear-gradient(135deg, #f0f0f0, #dadce0);
}

.google-kp-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: #1a73e8;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 14px;
}

.google-kp-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.58;
  color: #4d5156;
}

.google-kp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.google-kp-chip {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #f1f3f4;
  color: #202124;
  font-size: 14px;
}

.google-related-section {
  margin-top: 38px;
}

.google-related-title {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 400;
}

.google-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.google-related-chip {
  min-height: 54px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid #dadce0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 16px;
  color: #202124;
}

.google-pagination {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.google-pagination-wordmark {
  font-size: 38px;
  letter-spacing: -1px;
}

.google-pagination-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.google-pagination-links button {
  padding: 6px 8px;
  color: #1a0dab;
  font-size: 14px;
}

.google-pagination-links button.active {
  color: #202124;
  font-weight: 600;
}

.google-empty-state {
  border: 1px solid #dadce0;
  border-radius: 18px;
  padding: 20px;
}

.google-empty-title {
  font-size: 20px;
  margin-bottom: 6px;
}

.google-empty-copy {
  color: #5f6368;
  font-size: 14px;
}

.google-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: rgba(32,33,36,0.94);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  z-index: 60;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .google-results-shell {
    grid-template-columns: minmax(0, 1fr);
    padding-right: 18px;
  }

  .google-knowledge-panel {
    position: static;
  }
}

@media (max-width: 900px) {
  .google-topbar-main {
    gap: 12px;
    padding: 14px 12px 10px;
  }

  .google-tabs {
    padding-left: 12px;
  }

  .google-results-shell {
    padding-left: 12px;
  }

  .google-logo-link {
    display: none;
  }

  .google-back-chat-btn {
    padding: 0 12px;
  }
}


/* Sponsored-label presentation tuned for LLM task treatments */
.sponsor-badge {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  vertical-align: middle;
}

.message-bubble.assistant .sponsored-product-link {
  color: #6aa4ff;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.message-bubble.assistant .sponsored-product-link:hover,
.message-bubble.assistant .sponsored-product-link:focus {
  color: #4a8af5;
  outline: none;
}


/* Sponsored-label refinements */
.sponsor-badge {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  vertical-align: middle;
}

.message-bubble.assistant .sponsored-product-link {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: rgba(0, 0, 0, 0.55);
  text-underline-offset: 2px;
  cursor: pointer;
  transition: text-decoration-color 0.15s ease, opacity 0.15s ease;
}

.message-bubble.assistant .sponsored-product-link:hover,
.message-bubble.assistant .sponsored-product-link:focus {
  opacity: 0.88;
  text-decoration-color: rgba(0, 0, 0, 0.9);
  outline: none;
}


/* Remove trailing typing cursor */
.message-bubble.typing::after {
  content: none;
  animation: none;
}

/* Markdown table styling */
.message-bubble.assistant table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.9em 0;
  font-size: 0.95em;
}

.message-bubble.assistant th,
.message-bubble.assistant td {
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.message-bubble.assistant th {
  background: #f7f7f8;
  font-weight: 600;
}

.message-bubble.assistant tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.015);
}

/* Study popup form extensions */
.modal-field {
  margin: 16px 0 18px;
}

.modal-field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 10px;
}

.modal-select {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}

.modal-textarea-small {
  min-height: 90px;
  margin-top: 10px;
}

.modal-error {
  min-height: 18px;
  color: #b91c1c;
  font-size: 13px;
  margin-top: 6px;
}

.scale-field-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fafafa;
}

.scale-anchor-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.scale-options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scale-option {
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.matrix-anchor-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 10px;
  font-size: 12px;
  color: var(--muted);
}

.matrix-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  table-layout: fixed;
}

.matrix-label-column {
  width: 40%;
}

.matrix-scale-column {
  width: calc(60% / var(--scale-count));
}

.matrix-table th,
.matrix-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: center;
}

.matrix-table thead th {
  padding-inline: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-2);
  background: #fafafa;
}

.single-scale-table-wrap {
  border-radius: 8px;
}

.single-scale-table {
  min-width: 640px;
}

.single-scale-table--grouped .matrix-label-column {
  width: 32%;
}

.single-scale-table--grouped .matrix-scale-column {
  width: calc(68% / var(--scale-count));
}

.single-scale-table--standalone .matrix-scale-column {
  width: calc(100% / var(--scale-count));
}

.scale-question-label {
  margin-bottom: 10px;
}

.matrix-anchor-cell {
  min-height: 44px;
  vertical-align: middle;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.scale-descriptor-prefix,
.scale-descriptor-pole {
  display: block;
}

.matrix-table tbody tr:last-child td {
  border-bottom: none;
}

.matrix-table .matrix-row-label {
  text-align: left;
  font-size: 14px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.matrix-cell {
  min-width: 0;
}

.matrix-radio-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ranking-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranking-row {
  display: grid;
  grid-template-columns: 32px 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: grab;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.ranking-row:hover {
  border-color: #aeb4bc;
}

.ranking-row.dragging {
  opacity: 0.55;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.ranking-position {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.ranking-drag-handle {
  display: grid;
  place-items: center;
  color: #8b9199;
}

.ranking-drag-handle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.ranking-option-wrap {
  min-width: 0;
}

.ranking-option-name {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.ranking-other-input {
  width: 100%;
  min-height: 38px;
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  cursor: text;
}

.ranking-move-buttons {
  display: flex;
  gap: 4px;
}

.ranking-move-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #4b5563;
  font-size: 15px;
  cursor: pointer;
}

.ranking-move-button:hover:not(:disabled) {
  background: #f3f4f6;
  color: #111827;
}

.ranking-move-button:disabled {
  opacity: 0.3;
  cursor: default;
}

body[data-search-button-size="small"] .google-fab {
  top: -54px;
  padding: 8px 11px;
  font-size: 13px;
  gap: 6px;
}

body[data-search-button-size="small"] .google-g {
  width: 18px;
  height: 18px;
  font-size: 11px;
}

body[data-search-button-size="large"] .google-fab {
  top: -76px;
  padding: 17px 26px;
  font-size: 17px;
  gap: 12px;
}

body[data-search-button-size="large"] .google-g {
  width: 28px;
  height: 28px;
  font-size: 16px;
}

/* Ads are rendered as independent units below the LLM response. */
.ad-unit {
  width: 100%;
  margin-top: 14px;
}

.ad-separator {
  width: 100%;
  border-top: 1px solid rgba(15, 23, 42, 0.14);
  margin-bottom: 14px;
}

.ad-card-stack {
  display: grid;
  gap: 10px;
}

.ad-card-topline {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto 30px;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin-bottom: 7px;
}

.ad-advertiser-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  background: #f1f1f1;
  color: #454545;
  font-size: 12px;
  font-weight: 600;
}

.ad-advertiser-logo {
  width: 100%;
  height: 100%;
  padding: 3px;
  object-fit: contain;
}

.ad-advertiser {
  overflow: hidden;
  color: #303134;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e5e5e5;
  color: #55575a;
  font-size: 12px;
  font-weight: 500;
}

.ad-menu-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #62666b;
  cursor: pointer;
}

.ad-menu-button:hover {
  background: rgba(0, 0, 0, 0.06);
}

.ad-menu-button svg {
  width: 20px;
  height: 20px;
}

.ad-headline {
  margin-bottom: 4px;
  color: #202123;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ad-description {
  display: -webkit-box;
  overflow: hidden;
  color: #5c5f63;
  font-size: 13px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.guide-mode {
  cursor: default;
}

.guide-highlight {
  outline: 3px solid rgba(255,255,255,0.98);
  outline-offset: 4px;
}

.guide-spotlight {
  position: fixed;
  z-index: 4000;
  pointer-events: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.98), 0 0 0 9999px rgba(15, 23, 42, 0.42);
  transition: top 0.08s ease, left 0.08s ease, width 0.08s ease, height 0.08s ease;
}

.guide-card {
  position: fixed;
  z-index: 4001;
  width: min(320px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  box-shadow: 0 18px 38px rgba(15,23,42,0.16);
  padding: 14px 16px;
  pointer-events: none;
}

.guide-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.guide-body {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

/* Read-only example conversation */
.example-chat-view {
  max-width: 768px;
  margin: 0 auto;
  padding: 28px 0 96px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.example-chat-view.hidden {
  display: none;
}

.example-chat-view .message-bubble {
  white-space: normal;
}

.example-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 14px 0;
}

.example-table-wrap table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.45;
}

.example-table-wrap th,
.example-table-wrap td {
  word-break: normal;
  overflow-wrap: normal;
}

body.example-mode #chat-messages,
body.example-mode #empty-state,
body.example-mode .composer-zone,
body.example-mode #google-search-btn {
  display: none;
}

/* Product images in each randomized task prompt */
.task-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.task-product-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.task-product-image-wrap {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  margin-bottom: 9px;
}

.task-product-image {
  width: 84%;
  height: 84%;
  object-fit: contain;
}

.task-product-grid--logos {
  grid-template-columns: repeat(2, minmax(0, 220px));
  justify-content: center;
}

.task-product-card--logo .task-product-image-wrap {
  aspect-ratio: 4 / 3;
}

.task-product-card--logo .task-product-image {
  width: 68%;
  height: 68%;
}

.task-product-option {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 3px;
}

.task-product-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.product-choice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.product-choice-item {
  display: grid;
  grid-template-columns: auto 88px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 108px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
}

.product-choice-image-wrap {
  width: 88px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
}

.product-choice-image {
  width: 84%;
  height: 84%;
  object-fit: contain;
}

.product-choice-item--logo .product-choice-image {
  width: 66%;
  height: 66%;
}

/* Keep scale labels and values on the same grid columns. */
.scale-anchor-row,
.scale-options-row {
  display: grid;
  grid-template-columns: repeat(var(--scale-count), minmax(0, 1fr));
  gap: 8px;
}

.scale-anchor-row {
  align-items: end;
  margin-bottom: 7px;
  text-align: center;
  line-height: 1.25;
}

.scale-options-row {
  flex-wrap: initial;
}

.scale-option {
  min-width: 0;
  min-height: 56px;
  justify-content: center;
  padding: 7px 4px;
  border-radius: 8px;
}

.matrix-anchor-header th {
  border-bottom: 0;
  padding-top: 9px;
  padding-bottom: 3px;
}

.matrix-table thead .matrix-anchor-cell {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  white-space: normal;
  vertical-align: bottom;
}

/* Slider questions used in the final section. */
.slider-field-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px 12px;
  background: #fafafa;
}

.slider-current-value {
  display: block;
  width: fit-content;
  min-width: 64px;
  margin: 0 auto 8px;
  padding: 5px 9px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.survey-slider {
  width: 100%;
  accent-color: var(--green);
  cursor: pointer;
}

.slider-stop-labels {
  display: grid;
  grid-template-columns: repeat(var(--slider-count), minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
  color: #4b5563;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

.slider-stop-labels span {
  overflow-wrap: anywhere;
}

.slider-anchor-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 560px) {
  .task-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .matrix-table {
    min-width: 100%;
  }

  .matrix-label-column {
    width: 34%;
  }

  .matrix-scale-column {
    width: calc(66% / var(--scale-count));
  }

  .matrix-table th,
  .matrix-table td {
    padding: 8px 2px;
  }

  .matrix-table .matrix-row-label {
    padding-left: 8px;
    font-size: 12px;
  }

  .matrix-table thead .matrix-anchor-cell {
    font-size: 9px;
  }

  .single-scale-table {
    min-width: 610px;
  }

  .scale-field-wrap {
    padding: 10px 8px;
  }

  .scale-anchor-row,
  .scale-options-row {
    gap: 4px;
  }

  .scale-anchor-row {
    font-size: 10px;
  }

  .scale-option {
    min-height: 52px;
  }

  .slider-field-wrap {
    padding-inline: 10px;
  }

  .ranking-row {
    grid-template-columns: 28px 20px minmax(0, 1fr);
  }

  .ranking-move-buttons {
    grid-column: 3;
    justify-content: flex-end;
  }

  .product-choice-list {
    grid-template-columns: 1fr;
  }

  .product-choice-item {
    grid-template-columns: auto 76px minmax(0, 1fr);
  }

  .product-choice-image-wrap {
    width: 76px;
  }
}

/* ===== Contextual ads experiment v2 ===== */
.ad-unit {
  width: 100%;
  margin: 18px 0 4px;
}

.ad-card-stack {
  display: grid;
  gap: 12px;
}

.ad-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  width: min(100%, 480px);
  height: 128px;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 17px;
  background: #fff;
  color: #171717;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow .16s ease, border-color .16s ease;
}

.ad-card::after { display: none; }
.ad-card:hover,
.ad-card:focus-visible {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.18);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.09);
  outline: none;
}

.ad-card-content {
  min-width: 0;
  padding: 13px 14px 12px 16px;
}

.ad-card-header {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 30px;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.ad-advertiser-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: #f2f4f7;
  font-size: 12px;
  font-weight: 700;
}

.ad-advertiser-logo {
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
  background: #fff;
}

.ad-advertiser-line {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ad-advertiser-line strong { font-weight: 600; }
.ad-advertiser-line span { color: #262626; }

.ad-badge {
  min-width: 32px;
  min-height: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f1f1;
  color: #626262;
  font-size: 14px;
  font-weight: 500;
}

.ad-menu-button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 16px;
  letter-spacing: 1px;
  line-height: 1;
  position: relative;
  z-index: 2;
}

.ad-card-copy {
  padding: 0;
  overflow: hidden;
}

.ad-headline {
  margin: 0 0 3px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-description {
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.35;
  color: #5f6368;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ad-card-image-wrap {
  width: 128px;
  height: 128px;
  min-height: 0;
  border-radius: 0;
  background: #fff;
  overflow: hidden;
  box-shadow: none;
}

.ad-card-image {
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: contain;
  background: #fff;
}

.ad-about-overlay,
.ad-report-overlay,
.ad-hide-feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.34);
}

.ad-dialog {
  width: min(414px, calc(100vw - 32px));
  max-height: min(90vh, 720px);
  overflow-y: auto;
  border-radius: 20px;
  background: #fff;
  color: #202124;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .22);
}

.ad-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 21px 20px 14px;
}
.ad-dialog-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}
.ad-dialog-close {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: transparent;
  color: #6b6f73;
  font-size: 27px;
  line-height: 1;
}
.ad-dialog-close:hover { background: #f3f4f6; }

.ad-dialog-row {
  display: block;
  width: calc(100% - 36px);
  margin: 0 18px;
  padding: 13px 0;
  border-top: 1px solid #eceff1;
  background: transparent;
  color: #202124;
  font-size: 15px;
  text-align: left;
}
.ad-dialog-row:hover { color: #111827; background: #fafafa; }
.ad-report-action { color: #6b6f73; }

.ad-dialog-section {
  margin: 0 18px;
  padding: 17px 0;
  border-top: 1px solid #eceff1;
}
.ad-dialog-section h3 {
  margin: 0 0 9px;
  font-size: 15px;
  font-weight: 650;
}
.ad-dialog-section p {
  margin: 0;
  color: #777b80;
  font-size: 14px;
  line-height: 1.45;
}
.ad-learn-more {
  color: #777b80;
  text-decoration: underline;
  cursor: default;
}
.ad-sponsor-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 8px;
}
.ad-sponsor-identity img,
.ad-sponsor-identity > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 4px;
  border: 1px solid #eceff1;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
}
.ad-sponsor-identity strong { font-size: 14px; }

.ad-report-dialog { padding-bottom: 18px; }
.ad-report-intro { margin: 0 20px 12px; color: #555; line-height: 1.45; }
.ad-report-form { padding: 0 20px; }
.ad-report-reason {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid #f0f1f2;
  font-size: 14px;
  line-height: 1.4;
}
.ad-report-reason input { margin-top: 3px; }
.ad-report-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 14px; }
.ad-report-submit { padding: 9px 13px; border-radius: 10px; background: #111827; color: #fff; }
.ad-report-submit:disabled { opacity: .45; cursor: not-allowed; }
body.ad-dialog-open { overflow: hidden; }

.ad-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 6000;
  background: transparent;
}

.ad-menu-popover {
  position: fixed;
  display: grid;
  gap: 3px;
  padding: 11px;
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 15px 42px rgba(15, 23, 42, .18);
}

.ad-menu-action {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 52px;
  padding: 10px 13px;
  border-radius: 13px;
  background: transparent;
  color: #171717;
  font-size: 17px;
  text-align: left;
}

.ad-menu-action:hover,
.ad-menu-action:focus-visible {
  background: #f3f3f3;
  outline: none;
}

.ad-menu-action svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ad-hide-feedback-dialog {
  width: min(900px, calc(100vw - 32px));
  padding-bottom: 22px;
}

.ad-hide-feedback-prompt {
  margin: 4px 20px 18px;
  color: #202124;
  font-size: 18px;
  line-height: 1.4;
}

.ad-hide-feedback-form {
  padding: 0 20px;
}

.ad-hide-feedback-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ad-hide-feedback-option {
  position: relative;
  cursor: pointer;
}

.ad-hide-feedback-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ad-hide-feedback-option span {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f1f1f1;
  color: #202124;
  font-size: 16px;
  line-height: 1.2;
}

.ad-hide-feedback-option:hover span {
  background: #e8e8e8;
}

.ad-hide-feedback-option input:focus-visible + span,
.ad-hide-feedback-option input:checked + span {
  border-color: #202124;
  background: #e7e7e7;
  box-shadow: 0 0 0 2px rgba(32, 33, 36, .10);
}

.ad-hide-feedback-note {
  margin: 22px 20px 16px;
  color: #8b8b8b;
  font-size: 14px;
  line-height: 1.45;
}

.ad-hide-ad-free {
  min-height: 44px;
  margin: 0 20px;
  padding: 10px 17px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.ad-hide-ad-free:hover {
  background: #2a2a2a;
}

.assistant-image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 220px));
  gap: 10px;
  margin: 12px 0 4px;
}
.assistant-response-image {
  width: 100%;
  max-height: 260px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, .08);
  background: #fff;
  object-fit: contain;
}

.product-choice-other-item {
  min-height: 78px;
  grid-template-columns: auto 88px minmax(0, 1fr);
}
.product-choice-other-letter {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 24px;
  font-weight: 700;
}
.product-choice-copy { line-height: 1.4; }
.product-choice-other-input {
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
}
.product-choice-other-input.hidden { display: none; }

@media (max-width: 680px) {
  .ad-card { grid-template-columns: 112px minmax(0, 1fr); height: 112px; border-radius: 15px; }
  .ad-card-content { padding: 10px 10px 9px 12px; }
  .ad-card-image-wrap { width: 112px; height: 112px; }
  .ad-headline { font-size: 15px; }
  .ad-description { font-size: 13px; }
  .ad-card-header { grid-template-columns: 24px minmax(0, 1fr) auto 27px; gap: 5px; margin-bottom: 5px; }
  .ad-advertiser-mark { width: 24px; height: 24px; }
  .ad-advertiser-line { font-size: 13px; }
  .ad-badge { min-width: 29px; min-height: 25px; padding: 2px 7px; font-size: 12px; }
  .ad-menu-button { width: 27px; height: 27px; }
  .ad-hide-feedback-options { gap: 9px; }
  .ad-hide-feedback-option span { min-height: 42px; padding: 9px 14px; font-size: 14px; }
  .product-choice-list { grid-template-columns: 1fr; }
}
