* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #202124;
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  flex: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
  transition: all 0.3s ease;
}

#app.centered {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 0;
}

#app.top {
  justify-content: flex-start;
  padding-top: 40px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

h1 {
  font-size: 56px;
  font-weight: 400;
  letter-spacing: -1px;
  color: #333;
}

.accent {
  color: #1a73e8;
  font-weight: 600;
}

.tagline {
  font-size: 16px;
  color: #5f6368;
  margin-top: 4px;
}

#search-form {
  width: 100%;
}

.search-box {
  display: flex;
  border: 1px solid #dfe1e5;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.08);
  transition: box-shadow 0.2s;
}

.search-box:focus-within {
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.2);
  border-color: #ccc;
}

#question {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  padding: 14px 20px;
  background: transparent;
}

#question::placeholder {
  color: #9aa0a6;
}

#submit-btn {
  border: none;
  background: #1a73e8;
  color: white;
  font-size: 15px;
  font-weight: 500;
  padding: 14px 24px;
  cursor: pointer;
  transition: background 0.2s;
}

#submit-btn:hover {
  background: #1557b0;
}

#submit-btn:disabled {
  background: #94b8e8;
  cursor: not-allowed;
}

.examples {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: #5f6368;
}

.example-btn {
  background: none;
  border: 1px solid #dadce0;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 13px;
  color: #1a73e8;
  cursor: pointer;
  margin: 4px 2px;
  transition: background 0.2s;
}

.example-btn:hover {
  background: #f0f6ff;
}

/* Results */

#results {
  width: 100%;
  margin-top: 32px;
}

#results.hidden {
  display: none;
}

#status-area {
  margin-bottom: 16px;
}

.status-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8f9fa;
  border: 1px solid #e8eaed;
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 13px;
  color: #5f6368;
  margin: 0 4px 8px 0;
}

.status-item .spinner {
  width: 12px;
  height: 12px;
  border: 2px solid #dadce0;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.status-item.done .spinner {
  display: none;
}

.status-item.done::before {
  content: "\2713";
  color: #34a853;
  font-weight: bold;
}

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

#answer-area {
  font-size: 15px;
  line-height: 1.7;
  color: #202124;
}

#answer-area p {
  margin-bottom: 12px;
}

#answer-area a {
  color: #1a73e8;
  text-decoration: none;
}

#answer-area a:hover {
  text-decoration: underline;
}

#answer-area ul, #answer-area ol {
  margin: 8px 0 12px 20px;
}

#answer-area li {
  margin-bottom: 4px;
}

#answer-area h3 {
  font-size: 16px;
  margin: 16px 0 8px;
  color: #333;
}

#answer-area code {
  background: #f1f3f4;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
}

#answer-area blockquote {
  border-left: 3px solid #dadce0;
  margin: 8px 0;
  padding: 4px 16px;
  color: #5f6368;
}

.table-wrap {
  overflow-x: auto;
  margin: 12px 0;
}

#answer-area table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  line-height: 1.5;
}

#answer-area th,
#answer-area td {
  border: 1px solid #dadce0;
  padding: 8px 12px;
  text-align: left;
}

#answer-area th {
  background: #f8f9fa;
  font-weight: 600;
  color: #202124;
}

#answer-area tr:nth-child(even) {
  background: #fafafa;
}

.error-message {
  color: #d93025;
  background: #fce8e6;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
}

.share-btn {
  display: inline-block;
  margin-top: 16px;
  background: none;
  border: 1px solid #dadce0;
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 13px;
  color: #1a73e8;
  cursor: pointer;
  transition: background 0.2s;
}

.share-btn:hover {
  background: #f0f6ff;
}

/* Footer */

footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 12px;
  color: #9aa0a6;
  border-top: 1px solid #f1f3f4;
}

footer a {
  color: #70757a;
}

/* Loading shimmer for answer */

.loading-placeholder {
  height: 14px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 10px;
}

.loading-placeholder:nth-child(2) { width: 85%; }
.loading-placeholder:nth-child(3) { width: 70%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
