:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --ink: #171a21;
  --muted: #687083;
  --line: #dfe3ec;
  --blue: #4285f4;
  --red: #ea4335;
  --yellow: #fbbc05;
  --green: #34a853;
  --panel: #ffffff;
  --shadow: 0 24px 70px rgba(28, 42, 70, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(66, 133, 244, 0.18), transparent 28rem),
    radial-gradient(circle at 86% 8%, rgba(251, 188, 5, 0.25), transparent 22rem),
    linear-gradient(135deg, #fff 0%, var(--bg) 58%, #eef3ff 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body.replay-mode .app-shell {
  grid-template-columns: minmax(360px, 820px);
  justify-content: center;
}

body.replay-mode .composer {
  display: none;
}

body.replay-mode .stage {
  width: min(820px, 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 34px;
  align-items: center;
  padding: 42px 0;
}

.composer,
.browser-card {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(223, 227, 236, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.composer {
  border-radius: 8px;
  padding: 32px;
}

.brand-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 28px;
}

.logo {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: conic-gradient(from 180deg, var(--blue), var(--green), var(--yellow), var(--red), var(--blue));
  color: white;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 14px 32px rgba(66, 133, 244, 0.28);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.ask-form label {
  display: block;
  margin-bottom: 10px;
  color: #293040;
  font-weight: 750;
}

.input-row,
.share-row {
  display: flex;
  gap: 10px;
}

input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 14px 16px;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.13);
}

button,
.actions a {
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 14px 18px;
  font-weight: 850;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

button:hover,
.actions a:hover {
  transform: translateY(-1px);
}

.helpers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  background: #eef2fb;
  color: #2f3749;
  padding: 9px 11px;
  font-size: 0.86rem;
}

.share-panel {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.share-panel p {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 700;
}

.browser-card {
  overflow: hidden;
  border-radius: 8px;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f1f3f8;
}

.browser-bar span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.browser-bar span:nth-child(1) { background: var(--red); }
.browser-bar span:nth-child(2) { background: var(--yellow); }
.browser-bar span:nth-child(3) { background: var(--green); }

.browser-bar p {
  margin: 0 0 0 8px;
  width: 100%;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 8px 14px;
  font-size: 0.86rem;
}

.google-ish {
  padding: 34px;
}

.search-logo {
  text-align: center;
  font-size: clamp(2.3rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 22px;
}

.search-logo span:nth-child(1),
.search-logo span:nth-child(4) { color: var(--blue); }
.search-logo span:nth-child(2),
.search-logo span:nth-child(6) { color: var(--red); }
.search-logo span:nth-child(3) { color: var(--yellow); }
.search-logo span:nth-child(5) { color: var(--green); }

.search-logo b {
  display: block;
  color: #202124;
  font-size: 0.92rem;
  margin-top: 8px;
}

.search-box {
  display: flex;
  align-items: center;
  min-height: 58px;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 18px;
  box-shadow: 0 9px 26px rgba(60, 64, 67, 0.12);
}

.magnifier {
  width: 18px;
  height: 18px;
  border: 2px solid #9aa0a6;
  border-radius: 999px;
  position: relative;
  flex: 0 0 auto;
}

.magnifier::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  background: #9aa0a6;
  right: -6px;
  bottom: -3px;
  rotate: 45deg;
}

.typed-query {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.cursor {
  width: 2px;
  height: 24px;
  background: var(--blue);
  animation: blink 0.9s steps(2, start) infinite;
}

.ai-panel {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f9fbff);
  padding: 20px;
}

.thinking-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #303849;
  font-weight: 800;
}

.thinking-row p {
  margin: 0;
}

.spark {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: conic-gradient(var(--blue), var(--green), var(--yellow), var(--red), var(--blue));
  animation: spin 1.8s linear infinite;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #e9edf6;
  overflow: hidden;
  margin: 16px 0;
}

.progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 0.35s ease;
}

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

.steps li {
  border-left: 4px solid #cad2e3;
  color: var(--muted);
  padding: 6px 0 6px 10px;
  font-size: 0.92rem;
}

.steps li.done {
  border-color: var(--green);
  color: #26311f;
  font-weight: 750;
}

.terminal {
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid #202633;
  border-radius: 8px;
  background: #10141c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #181d28;
}

.terminal-bar span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.terminal-bar span:nth-child(1) { background: var(--red); }
.terminal-bar span:nth-child(2) { background: var(--yellow); }
.terminal-bar span:nth-child(3) { background: var(--green); }

.terminal-bar b {
  margin-left: 4px;
  color: #d7deed;
  font-size: 0.78rem;
}

.terminal pre {
  min-height: 112px;
  margin: 0;
  padding: 13px 15px;
  color: #9df7bd;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.answer {
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e7ebf3;
  padding: 16px;
}

.answer h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.answer p {
  margin: 0;
  color: #4b5568;
  line-height: 1.5;
}

.actions {
  display: flex;
  gap: 10px;
  padding: 0 34px 28px;
}

.actions button {
  background: #eef2fb;
  color: #252b38;
}

.actions a {
  background: var(--blue);
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 18px 0 28px;
  }

  .composer,
  .google-ish {
    padding: 22px;
  }

  .input-row,
  .share-row,
  .actions {
    flex-direction: column;
  }

  .actions {
    padding: 0 22px 22px;
  }
}
