:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #5f6368;
  --line: #dfe1e5;
  --soft: #f8f9fa;
  --accent: #c44732;
  --blue: #4285f4;
  --red: #ea4335;
  --yellow: #fbbc05;
  --green: #34a853;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
html { background: #fff; }
body { color: var(--ink); margin: 0; min-width: 300px; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  clip: rect(0, 0, 0, 0);
}

.app {
  margin: 0 auto;
  min-height: 100vh;
  padding: clamp(3rem, 10vh, 6.5rem) 1.25rem 3rem;
  width: min(100%, 680px);
}

.wordmark { text-align: center; }
.wordmark h1 {
  font-size: clamp(4.7rem, 14vw, 6rem);
  font-weight: 600;
  letter-spacing: -.09em;
  line-height: .92;
  margin: 0;
  transition: letter-spacing .55s cubic-bezier(.2,.75,.25,1), transform .55s ease;
}
.wordmark h1 span:nth-child(1) { color: var(--blue); }
.wordmark h1 span:nth-child(2) { color: var(--red); }
.wordmark h1 span:nth-child(3) { color: var(--green); }
.definition {
  color: var(--muted);
  font-size: .9rem;
  margin: .65rem 0 0;
}
.system-result {
  color: var(--muted);
  font-size: clamp(.86rem, 2.5vw, 1rem);
  left: 50%;
  margin: .7rem 0 0;
  opacity: 0;
  position: absolute;
  transform: translate(-50%, 8px);
  transition: opacity .35s ease, transform .35s ease;
  white-space: nowrap;
}
.system-result strong { color: var(--ink); }

.search-form { margin-top: 2rem; }
.search-box {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  height: 48px;
  padding: 0 .55rem 0 1rem;
  transition: border-color .15s, box-shadow .15s;
}
.search-box:hover,
.search-box:focus-within {
  border-color: transparent;
  box-shadow: 0 1px 6px rgba(32, 33, 36, .28);
}
.search-box svg {
  fill: none;
  flex: 0 0 auto;
  height: 20px;
  stroke: #9aa0a6;
  stroke-linecap: round;
  stroke-width: 1.8;
  width: 20px;
}
.search-box input {
  background: transparent;
  border: 0;
  color: var(--ink);
  flex: 1;
  font-size: 1rem;
  min-width: 0;
  outline: 0;
  padding: .75rem;
}
.search-box input::placeholder { color: #858a90; }
.search-tools { align-items: center; display: flex; flex: 0 0 auto; gap: .35rem; }
.sound-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: #5f6368;
  cursor: pointer;
  display: inline-flex;
  font-size: 1rem;
  height: 32px;
  justify-content: center;
  width: 32px;
}
.sound-toggle:hover { background: #f1f3f4; }
.sound-toggle[aria-pressed="false"] { color: #b0b4b9; text-decoration: line-through; }
.ai-mode {
  align-items: center;
  background: #eef2fb;
  border-radius: 999px;
  color: #3c4043;
  display: inline-flex;
  font-size: .78rem;
  gap: .32rem;
  padding: .48rem .72rem;
  text-decoration: none;
  white-space: nowrap;
}
.ai-mode:hover { background: #e4e9f6; }
.ai-mode span { color: var(--blue); }
.clear {
  background: transparent;
  border: 0;
  color: #70757a;
  cursor: pointer;
  font-size: 1.3rem;
  height: 36px;
  opacity: 0;
  pointer-events: none;
  width: 36px;
}
.search-box:has(input:not(:placeholder-shown)) .clear { opacity: 1; pointer-events: auto; }
.validation { color: #b3261e; font-size: .76rem; margin: .55rem 0 0 1rem; }
.actions { display: flex; gap: .7rem; justify-content: center; margin-top: 1.75rem; }
.actions button {
  background: var(--soft);
  border: 1px solid var(--soft);
  border-radius: 4px;
  color: #3c4043;
  cursor: pointer;
  font-size: .84rem;
  min-height: 36px;
  padding: 0 1rem;
}
.actions button:hover { border-color: #dadce0; box-shadow: 0 1px 1px rgba(0,0,0,.1); color: #202124; }
.actions button:disabled { cursor: wait; opacity: .52; }
.primary { min-width: 92px; }
.powered-by {
  color: #858a90;
  font-size: .68rem;
  line-height: 1.45;
  margin: .85rem 0 0;
  text-align: center;
}
.powered-by strong { color: #5f6368; font-weight: 500; }
.powered-by span { display: block; }

.processor { margin: 1rem auto 0; max-width: 600px; }
.processor-heading {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: .65rem;
  font-weight: 700;
  justify-content: space-between;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.progress { background: #eef0f2; border-radius: 999px; height: 5px; margin: .55rem 0 .8rem; overflow: hidden; }
.progress span {
  background: linear-gradient(90deg, var(--blue), var(--red), var(--yellow), var(--green));
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .42s ease;
}
.status-log {
  display: grid;
  gap: .42rem;
  margin: 0;
  min-height: 2.8em;
  padding: .05rem .15rem .1rem 0;
}
.status-line {
  align-items: baseline;
  color: #70757a;
  display: flex;
  font-size: clamp(.8rem, 2vw, .9rem);
  line-height: 1.5;
  margin: 0;
}
.status-line.is-active { color: #202124; }
.status-marker {
  color: var(--blue);
  flex: 0 0 1.25rem;
  font-size: .75rem;
  transform-origin: 35% 55%;
}
.status-line.is-active .status-marker { animation: thinking-pulse 1.2s ease-in-out infinite; }
.status-line.is-complete .status-marker { color: #9aa0a6; }
.skip { color: var(--muted); display: inline-block; font-size: .68rem; margin-top: .5rem; text-underline-offset: 3px; }
.share-output {
  color: #858a90;
  display: block;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .62rem;
  margin-top: 1.2rem;
  min-height: 1em;
  overflow-wrap: anywhere;
  text-align: center;
}
.share-output:empty { display: none; }

.app[data-state="searching"] .wordmark h1 { letter-spacing: .08em; transform: scale(1.07); }
.app[data-state="searching"] .definition { opacity: 0; }
.app[data-state="searching"] .system-result { opacity: 1; transform: translate(-50%, 0); }
.app[data-state="working"] .actions,
.app[data-state="working"] .powered-by,
.app[data-state="searching"] .actions,
.app[data-state="searching"] .powered-by { display: none; }

.brand-cursor {
  --cursor-spin-speed: .72s;
  display: none;
  height: 41px;
  left: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  transform: translate(-10px, -10px);
  transform-origin: 11px 11px;
  width: 41px;
  z-index: 1000;
}
.brand-cursor svg {
  filter: drop-shadow(2px 4px 2px rgba(0,0,0,.28));
  height: 100%;
  overflow: visible;
  width: 100%;
}
.cursor-aa-outline,
.cursor-aa-face { fill: none; stroke-linecap: square; stroke-linejoin: miter; }
.cursor-aa-outline { stroke: #111; stroke-width: 9; }
.cursor-aa-face { stroke: #fff; stroke-width: 5; }
.has-brand-cursor,
.has-brand-cursor button,
.has-brand-cursor a { cursor: none; }
.has-brand-cursor input { cursor: text; }
.has-brand-cursor .brand-cursor { display: block; }
.has-brand-cursor:has(input:hover) .brand-cursor { opacity: 0; }
.has-brand-cursor:has(input:hover) .brand-cursor.is-autopilot,
.has-brand-cursor:has(input:hover) .brand-cursor.is-working,
.has-brand-cursor:has(input:hover) .brand-cursor.is-searching { opacity: 1; }
.brand-cursor.is-working { animation: cursor-spin var(--cursor-spin-speed) linear infinite; }
.brand-cursor.is-searching { animation: cursor-finish .52s ease both; }

button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(66,133,244,.28); outline-offset: 3px; }
@keyframes cursor-spin { to { transform: translate(-10px, -10px) rotate(360deg); } }
@keyframes cursor-finish {
  0% { transform: translate(-10px, -10px) rotate(0) scale(1); }
  55% { transform: translate(-10px, -10px) rotate(160deg) scale(1.18); }
  100% { transform: translate(-10px, -10px) rotate(180deg) scale(.96); }
}
@keyframes thinking-pulse { 0%, 100% { opacity: .35; transform: scale(.75); } 50% { opacity: 1; transform: scale(1.25); } }

@media (max-width: 620px) {
  .app { padding-top: clamp(2.5rem, 9vh, 4.5rem); }
  .search-form { margin-top: 1.7rem; }
  .actions { margin-top: 1.4rem; }
  .brand-cursor { height: 36px; width: 36px; }
  .system-result { white-space: normal; width: min(92vw, 420px); }
}

@media (max-width: 420px) {
  .actions { flex-direction: column; }
  .actions button { width: 100%; }
  .ai-mode { font-size: 0; padding: .5rem; }
  .ai-mode span { font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .brand-cursor { display: none !important; }
  .has-brand-cursor, .has-brand-cursor button, .has-brand-cursor a { cursor: auto; }
  .has-brand-cursor input { cursor: text; }
}
