*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #202124;
}

.ac-app {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.ac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #dadce0;
  margin-bottom: 20px;
}

.ac-header a { color: #1a73e8; text-decoration: none; font-size: 0.85rem; }
.ac-header h1 { margin: 0; font-size: 1.1rem; font-weight: 600; }

.ac-brief {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 16px;
}

.ac-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
  color: #5f6368;
}

.ac-meter-track {
  flex: 1;
  height: 6px;
  background: #dadce0;
  border-radius: 3px;
  overflow: hidden;
}

.ac-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #9c27b0, #b71c1c);
  transition: width 0.3s;
}

.ac-form {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 20px;
}

.ac-progress {
  margin: 0 0 16px;
  font-size: 0.8rem;
  color: #5f6368;
}

.ac-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.ac-field-wrap {
  position: relative;
}

.ac-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-family: inherit;
}

.ac-input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

.ac-input.is-haunted {
  border-color: #b71c1c;
  color: #5f2120;
  background: #fff5f5;
}

.ac-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin: 4px 0 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 10;
}

.ac-suggest[hidden] { display: none; }

.ac-suggest li {
  padding: 10px 14px;
  font-size: 0.92rem;
  cursor: pointer;
}

.ac-suggest li:hover,
.ac-suggest li.is-active {
  background: #e8f0fe;
}

.ac-suggest li.is-creepy {
  color: #5f2120;
  font-style: italic;
}

.ac-hint {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: #1a73e8;
}

.ac-submit {
  margin-top: 18px;
  padding: 10px 24px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.ac-submit:hover { background: #1765cc; }

.ac-msg {
  margin: 12px 0 0;
  font-size: 0.88rem;
  min-height: 1.2em;
}

.ac-msg.is-error { color: #c5221f; }
.ac-msg.is-ok { color: #137333; }

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

.ac-overlay[hidden] { display: none !important; }

.ac-overlay-box {
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px;
  max-width: 420px;
  text-align: center;
}

.ac-overlay-box h1,
.ac-overlay-box h2 { margin: 0 0 12px; }

.ac-overlay-box p { margin: 0 0 10px; line-height: 1.45; }

.ac-credit {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #5f6368;
}

.ac-warn { color: #c5221f; font-weight: 600; }

.ac-btn {
  margin-top: 12px;
  padding: 10px 22px;
  border-radius: 6px;
  border: 1px solid #dadce0;
  background: #f8f9fa;
  font-family: inherit;
  cursor: pointer;
}

.ac-btn--primary {
  background: #1a73e8;
  color: #fff;
  border-color: #1a73e8;
}

.ac-overlay-box h2 { color: #137333; }
#ac-over .ac-overlay-box h2 { color: #c5221f; }

.ac-app.is-corrupted {
  animation: ac-shake 0.35s ease;
}

@keyframes ac-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
